初始化商家app代码
This commit is contained in:
parent
1aa732ad02
commit
00869adb70
46
App.vue
46
App.vue
|
|
@ -1,10 +1,5 @@
|
|||
<script>
|
||||
// #ifdef APP-PLUS
|
||||
import {
|
||||
isNotificationsEnabled,
|
||||
permissions,
|
||||
registPush
|
||||
} from '@/utils/AS-NotifyTheAuthority.js'
|
||||
import {
|
||||
permissionListener
|
||||
} from './utils/permissionTips.js'
|
||||
|
|
@ -20,7 +15,7 @@
|
|||
const aLiSDKModule = uni.requireNativePlugin('AliCloud-NirvanaPns');
|
||||
export default {
|
||||
globalData: {
|
||||
artisanType: null,
|
||||
artisanType: 2,
|
||||
latitude: '38.366667',
|
||||
longitude: '117.333333',
|
||||
address: '黄骅市',
|
||||
|
|
@ -53,37 +48,6 @@
|
|||
}
|
||||
},
|
||||
onLaunch: async function() {
|
||||
// plus.android.requestPermissions(['POST_NOTIFICATIONS'], function(e) {
|
||||
// console.log('1111111111' + e.deniedAlways.length);
|
||||
// if (e.deniedAlways.length > 0) { //权限被永久拒绝
|
||||
// // 弹出提示框解释为何需要定位权限,引导用户打开设置页面开启
|
||||
// console.log('Always Denied!!! ' + e.deniedAlways.toString());
|
||||
// }
|
||||
// if (e.deniedPresent.length > 0) { //权限被临时拒绝
|
||||
// // 弹出提示框解释为何需要定位权限,可再次调用plus.android.requestPermissions申请权限
|
||||
// console.log('Present Denied!!! ' + e.deniedPresent.toString());
|
||||
// }
|
||||
// if (e.granted.length > 0) { //权限被允许
|
||||
// //调用依赖获取定位权限的代码
|
||||
// console.log('Granted!!! ' + e.granted.toString());
|
||||
// }
|
||||
// }, function(e) {
|
||||
// console.log('Request Permissions error:' + JSON.stringify(e));
|
||||
// });
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
if (uni.getStorageSync('accessToken')) {
|
||||
registPush()
|
||||
}
|
||||
// #endif
|
||||
|
||||
//跟新底部消息数量
|
||||
this.messageUpudateNum()
|
||||
|
||||
//隐藏原生Tabar
|
||||
uni.hideTabBar({
|
||||
animation: true
|
||||
});
|
||||
//缓存手机版本号
|
||||
// await setVersion()
|
||||
|
||||
|
|
@ -92,7 +56,7 @@
|
|||
let version = uni.getStorageSync('setVersion')
|
||||
let baseUrl
|
||||
await uni.request({
|
||||
url: 'https://app.mrrweb.com.cn/api/openPuc/getApiUrl', // 接口地址
|
||||
url: 'https://api.mrrwlkj.top/api/openPuc/getSjApiUrl', // 接口地址
|
||||
method: 'GET', // 请求方法(默认 GET)
|
||||
header: {
|
||||
'Content-Type': 'application/json', // 请求头
|
||||
|
|
@ -152,10 +116,10 @@
|
|||
//是否跟随系统深色模式
|
||||
aLiSDKModule.setAuthPageUseDayLight(false);
|
||||
sdkInfo =
|
||||
'VXQhWWtyx6hqQIh6W8oMB2Kdzarg+2TSlQOvRb8fCUA1ygRWUKLsYkTuncn1VB1EK5gVvwoYZNXPF26x853cRzOfYW+lLKDNjMX7QZFgift8remIOFof9wjwyZFuHW2gBQAef6O6vxXeobInLVmJ/6sPqpJylk0ipYe+KBkEhKwiaNZudEHGrTFMQ2PvaNNjnnIWTB6WQJRTljArPvbgVT4FjXTwY8BJlFBR84CGE4k6HRRs1/ov1cBbON3zz6xE9DUlJhS43eEYVRYosJxrfDHfgz+++CfjinSGOX1m474=';
|
||||
'cvJWYFO9s7xgJrzD+Ok2m2kCh3x0kdRkfJzGI0oxnyUXGlNAwAzvj87Yd6y030BWposVHUT84av2adBG9SdHl5CJpL0mGi+BRtachnyADJjfdpkJC0e0Uqb45pO7h7ZZvT+sNWQs1sa4JpL0U7hYKkgCP1iVXHoA1zKfzZynON6eKyvkzL1xpoPPag4O50slww4+6XuRVplCOSNCcsLRtot4CYnfsdcMvlV34MY5qB/rV+HNb1velpx4rg5atk3iTEiSLjla69c6pOT6vpjkK1qFVpNMxrEY';
|
||||
} else if (platform == 'ios') {
|
||||
sdkInfo =
|
||||
'+4L59pm2xfA84cMIyUc4//tTAznhbtCGZ5bXa3Ax8UUTCH3IwxX0F0o8gVw7eanDoI3XVvriXMpQA3wcnAEbBD75JswXKAG0+ekz2cVUAgpHLGU3rDkakqTyRC9LIS4aHsJ/i9yv94tEAifXkxlIzdmZbT6dyYAexeJL6dLd6olEnFuKaaSRRl0VBtvSC5HQKlYqRZQ82ljIpAWCqaDG74lvsKfdxKU0wQPBQPzO15nJQOSfLIQpRsBm8STvkmeR'
|
||||
'BONXQSabNMt1a8Cru1TjeW94aXen5rQHeAxzLGgpFzIUicDYeb9SD0l35MkKvjq7gQemE2HDp6B7adKZ8nrdUk4wgg1LIYSGDYVSc/Q1CwrJ9A3lMUeBfS1UUu3nBBg58bDvG1bl3j6tS4h6FjnYmP5+dDsyqb0YNmIhlSmia5Et7cfBMv2OT85N9WLJc/tOMQ9ZQCnuizKVlofkmDGFgjsBN/Bf2gLq6lTQyVqsgPJE5yEPd4riNg=='
|
||||
}
|
||||
aLiSDKModule.setAuthSDKInfo(sdkInfo)
|
||||
|
||||
|
|
@ -203,8 +167,6 @@
|
|||
// #endif
|
||||
},
|
||||
onShow: function() {
|
||||
//隐藏原生Tabar
|
||||
uni.hideTabBar()
|
||||
console.log('App Show')
|
||||
},
|
||||
onHide: function() {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"version" : "1",
|
||||
"prompt" : "template",
|
||||
"title" : "美融融平台服务协议及隐私政策",
|
||||
"message" : "您注册为美融融用户的过程中,需要完成我们的注册流程并且以点击的形式在线签署以下协议, 请您务必仔细阅读、充分理解协议中的条款内容后点击同意: <a href=\"https://www.mrrweb.com.cn/junit/system/yhxy\">《美融融平台服务协议》</a>和<a href=\"https://www.mrrweb.com.cn/junit/system/yszc\">《隐私政策》</a>",
|
||||
"message" : "您注册为美融融用户的过程中,需要完成我们的注册流程并且以点击的形式在线签署以下协议, 请您务必仔细阅读、充分理解协议中的条款内容后点击同意: <a href=\"https://www.mrrweb.com.cn/junit/system/sjappzcxy\">《美融融商家服务协议》</a>和<a href=\"https://www.mrrweb.com.cn/junit/system/sjappyszc\">《隐私政策》</a>",
|
||||
"buttonAccept" : "同意",
|
||||
"buttonRefuse" : "不同意",
|
||||
"hrefLoader" : "system",
|
||||
|
|
|
|||
|
|
@ -188,115 +188,101 @@ export default {
|
|||
},
|
||||
// 触发上传
|
||||
async handleUpload() {
|
||||
// 判断
|
||||
try {
|
||||
const systemInfo = uni.getSystemInfoSync()
|
||||
if(systemInfo.platform === 'ios') {
|
||||
this.openCamera();
|
||||
}else {
|
||||
let xcpermission = '';
|
||||
let xjpermission = '';
|
||||
if(systemInfo.platform === 'ios') {
|
||||
xcpermission = 'photo_library',
|
||||
xjpermission = 'camera'
|
||||
}else {
|
||||
xcpermission = `android.permission.READ_EXTERNAL_STORAGE,android.permission.WRITE_EXTERNAL_STORAGE`
|
||||
xjpermission = 'android.permission.CAMERA'
|
||||
}
|
||||
const xjfirstRequest = !plus.storage.getItem(`perm_${xjpermission}`)
|
||||
const xcfirstRequest = !plus.storage.getItem(`perm_${xcpermission}`)
|
||||
if(xcfirstRequest || xjfirstRequest) {
|
||||
// this.isShowPer = true;
|
||||
console.log('ckeckisShowPer',true)
|
||||
this.$emit('ckeckisShowPer',true)
|
||||
}
|
||||
|
||||
// 1. 检查权限
|
||||
// const { granted } = await permissionUtils.checkPermission('photo_library', '需要相册权限用于上传照片');
|
||||
this.$emit('ckecknowQer','xc')
|
||||
const xc = await permissionUtils.checkPermission('photo_library', '需要相册权限用于上传照片');
|
||||
this.$emit('ckecknowQer','xj')
|
||||
const xj = await permissionUtils.checkPermission('camera', '需要相机权限用于拍摄照片');
|
||||
this.$emit('ckeckisShowPer',false)
|
||||
this.$emit('ckecknowQer','')
|
||||
if (xc.granted && xj.granted) {
|
||||
this.openCamera();
|
||||
return;
|
||||
}
|
||||
// this.isShowPer = false;
|
||||
// 2. 显示权限说明弹窗
|
||||
const confirm = await this.showPermissionDialog(
|
||||
'相机相册权限申请',
|
||||
'我们需要访问您的相机以及相册以完成更换头像功能'
|
||||
);
|
||||
|
||||
if (!confirm) return;
|
||||
|
||||
// 3. 请求权限
|
||||
this.$emit('ckeckisShowPer',true)
|
||||
this.$emit('ckecknowQer','xc')
|
||||
const result1 = await permissionUtils.requestPermission('photo_library', '我们需要访问您的相册以上传图片/视频');
|
||||
this.$emit('ckecknowQer','xj')
|
||||
const result2 = await permissionUtils.requestPermission('camera', '我们需要访问您的相机以上传图片/视频');
|
||||
if (result1 && result2) {
|
||||
this.openCamera();
|
||||
} else {
|
||||
locationService.openAppSettings();
|
||||
// uni.showToast({ title: '相机权限被拒绝', icon: 'none' });
|
||||
}
|
||||
this.$emit('ckeckisShowPer',false)
|
||||
this.$emit('ckecknowQer','')
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('上传出错:', error)
|
||||
this.$emit('error', error)
|
||||
} finally {
|
||||
this.loading = false
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const isIOS = systemInfo.platform === 'ios';
|
||||
|
||||
// 弹出操作菜单
|
||||
const res = await new Promise((resolve, reject) => {
|
||||
uni.showActionSheet({
|
||||
itemList: ['拍照', '从相册选择'],
|
||||
success: resolve,
|
||||
fail: reject
|
||||
});
|
||||
}).catch(() => ({ tapIndex: -1 }));
|
||||
|
||||
if (res.tapIndex === -1) return;
|
||||
|
||||
// 拍照
|
||||
if (res.tapIndex === 0) {
|
||||
if (isIOS) {
|
||||
this._openPicker('camera');
|
||||
} else {
|
||||
// 显示相机权限说明
|
||||
this.$emit('ckeckisShowPer', true);
|
||||
this.$emit('ckecknowQer', 'xj');
|
||||
const { granted } = await permissionUtils.checkPermission('camera', '需要相机权限以拍照');
|
||||
if (granted) {
|
||||
this.$emit('ckeckisShowPer', false);
|
||||
this._openPicker('camera');
|
||||
return;
|
||||
}
|
||||
this.$emit('ckeckisShowPer', false);
|
||||
const confirm = await this.showPermissionDialog('相机权限申请', '我们需要访问您的相机权限,以便您拍照上传');
|
||||
if (!confirm) return;
|
||||
const result = await permissionUtils.requestPermission('camera', '需要相机权限以拍照');
|
||||
if (result) {
|
||||
this._openPicker('camera');
|
||||
} else {
|
||||
locationService.openAppSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
// 从相册选择
|
||||
else if (res.tapIndex === 1) {
|
||||
if (isIOS) {
|
||||
this._openPicker('album');
|
||||
} else {
|
||||
// 显示存储权限说明
|
||||
this.$emit('ckeckisShowPer', true);
|
||||
this.$emit('ckecknowQer', 'xc');
|
||||
const { granted } = await permissionUtils.checkPermission('photo_library', '需要存储权限以选择照片');
|
||||
if (granted) {
|
||||
this.$emit('ckeckisShowPer', false);
|
||||
this._openPicker('album');
|
||||
return;
|
||||
}
|
||||
this.$emit('ckeckisShowPer', false);
|
||||
const confirm = await this.showPermissionDialog('存储权限申请', '我们需要访问您的相册权限,以便您选择照片');
|
||||
if (!confirm) return;
|
||||
const result = await permissionUtils.requestPermission('photo_library', '需要存储权限以选择照片');
|
||||
if (result) {
|
||||
this._openPicker('album');
|
||||
} else {
|
||||
locationService.openAppSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 实际打开选择器(图片或视频)
|
||||
async _openPicker(sourceType) {
|
||||
try {
|
||||
if (this.accept === 'image/*') {
|
||||
const count = this.maxCount - this.fileList.length;
|
||||
if (count <= 0) {
|
||||
uni.showToast({ title: `最多上传${this.maxCount}个文件`, icon: 'none' });
|
||||
return;
|
||||
}
|
||||
const res = await uni.chooseImage({
|
||||
count: count,
|
||||
sizeType: ['compressed'],
|
||||
sourceType: [sourceType]
|
||||
});
|
||||
for (const file of res.tempFiles) {
|
||||
await this.uploadFile(file);
|
||||
}
|
||||
} else if (this.accept === 'video/*') {
|
||||
const res = await uni.chooseVideo({
|
||||
sourceType: [sourceType],
|
||||
compressed: true,
|
||||
maxDuration: 60
|
||||
});
|
||||
await this.uploadFile(res);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('选择文件失败:', error);
|
||||
}
|
||||
},
|
||||
async openCamera() {
|
||||
if (this.loading) return
|
||||
if (this.fileList.length >= this.maxCount) {
|
||||
return uni.showToast({
|
||||
title: `最多上传${this.maxCount}个文件`,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
try {
|
||||
this.loading = true
|
||||
let res;
|
||||
let tempFiles;
|
||||
if(this.accept == 'image/*') {
|
||||
const res = await uni.chooseImage({
|
||||
count: this.maxCount - this.fileList.length,
|
||||
sizeType: ['original', 'compressed'],
|
||||
sourceType: ['album', 'camera']
|
||||
})
|
||||
const tempFiles = res.tempFiles
|
||||
for (const file of tempFiles) {
|
||||
await this.uploadFile(file)
|
||||
}
|
||||
}else if(this.accept == 'video/*') {
|
||||
const res = await uni.chooseVideo({
|
||||
count: 1,
|
||||
sourceType: ['album', 'camera'],
|
||||
compressed: false
|
||||
})
|
||||
// #ifdef H5
|
||||
const file = res.tempFile;
|
||||
// #endif
|
||||
// #ifdef APP-PLUS || MP-WEIXIN
|
||||
const file = res;
|
||||
// #endif
|
||||
await this.uploadFile(file)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('上传出错:', error)
|
||||
this.$emit('error', error)
|
||||
}
|
||||
},
|
||||
// 上传文件到OSS
|
||||
async uploadFile(file) {
|
||||
// 检查文件大小
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@
|
|||
|
||||
/* 列表容器 */
|
||||
.list-container {
|
||||
padding: 0 20rpx;
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
|
||||
/* 加载提示 */
|
||||
|
|
|
|||
|
|
@ -1,32 +1,56 @@
|
|||
<template>
|
||||
<view class="noData">
|
||||
<image src="/static/images/shop/noData.png" class="noData-img" mode="widthFix"></image>
|
||||
<text class="noData-text">暂无数据哦~</text>
|
||||
</view>
|
||||
<view class="noData">
|
||||
<image
|
||||
:style="{ 'margin-top': top }"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/57309ff1-476c-43ec-8bad-f9e529e0a25b"
|
||||
class="noData-img"
|
||||
mode="widthFix"
|
||||
></image>
|
||||
<text class="noData-text">{{ tipText }}</text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "noData",
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
props: {
|
||||
tipText: {
|
||||
type: String,
|
||||
default: "暂无数据哦~",
|
||||
},
|
||||
top: {
|
||||
type: String,
|
||||
default: "154rpx",
|
||||
},
|
||||
},
|
||||
components: {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.noData{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
.noData-img{
|
||||
margin-top: 100rpx;
|
||||
width: 348rpx;
|
||||
height: 348rpx;
|
||||
}
|
||||
.noData-text{
|
||||
width: 100%;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
.noData {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
// justify-content: center;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
.noData-img {
|
||||
margin-top: 154rpx;
|
||||
width: 348rpx;
|
||||
height: 348rpx;
|
||||
}
|
||||
.noData-text {
|
||||
width: 100%;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,71 @@
|
|||
<template>
|
||||
<view class="noLogin">
|
||||
<image
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/55d8e65a-04e4-4164-b956-278c6bc28a2b.png"
|
||||
class="noLogin-img"
|
||||
mode="widthFix"
|
||||
></image>
|
||||
<text class="noLogin-text">{{ tipText }}</text>
|
||||
<view class="loginBtn" @click="goLogin">立即登录</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "noLogin",
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
props: {
|
||||
tipText: {
|
||||
type: String,
|
||||
default: "您还没有登录,请登录后查看订单",
|
||||
},
|
||||
},
|
||||
components: {},
|
||||
methods: {
|
||||
goLogin() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/blogPopup/blogPopup",
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.noLogin {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
// justify-content: center;
|
||||
height: 100%;
|
||||
.noLogin-img {
|
||||
margin-top: 154rpx;
|
||||
width: 247rpx;
|
||||
height: 187rpx;
|
||||
}
|
||||
.noLogin-text {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
line-height: 42rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-top: 60rpx;
|
||||
margin-bottom: 31rpx;
|
||||
}
|
||||
.loginBtn {
|
||||
width: 262rpx;
|
||||
height: 86rpx;
|
||||
background: #e8101e;
|
||||
border-radius: 43rpx;
|
||||
text-align: center;
|
||||
line-height: 86rpx;
|
||||
font-weight: 500;
|
||||
font-size: 34rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -35,13 +35,13 @@
|
|||
class="time-picker-content__time__list__item"
|
||||
v-for="(time, index) in timeOptions[selectedDateIndex]"
|
||||
:key="index"
|
||||
:class="[getItemClass(time.state || 0), {
|
||||
firstActive: selectedTimeIndex == index,
|
||||
lastActive: selectedTimeIndex + serviceTimeNum - 1 == index,
|
||||
isActive: index >= selectedTimeIndex &&
|
||||
index <= selectedTimeIndex + serviceTimeNum - 1 &&
|
||||
sureTimeDataIndex === selectedDateIndex &&
|
||||
selectedTimeIndex !== null
|
||||
:class="[getItemClass(time.state || 0),{
|
||||
lastActive:selectedTimeIndex + serviceTimeNum==index,
|
||||
firstActive:selectedTimeIndex==index,
|
||||
isActive:
|
||||
index >= selectedTimeIndex && index <= selectedTimeIndex + serviceTimeNum &&
|
||||
sureTimeDataIndex === selectedDateIndex &&
|
||||
selectedTimeIndex !== null,
|
||||
}]"
|
||||
@click="selectTime(time, index)"
|
||||
>
|
||||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
watch: {
|
||||
service: {
|
||||
handler(newValue) {
|
||||
this.serviceTimeNum = Math.max(1, Math.ceil((newValue.server_time || 0) / 10 + 1));
|
||||
this.serviceTimeNum = Math.max(1, Math.ceil((newValue.server_time || 0) / 10));
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<uv-tabbar fixed :value="selected" @change="change1" activeColor="#ee0a24" :placeholder="false"
|
||||
:safeAreaInsetBottom="false" :customStyle="{height:`110rpx`}">
|
||||
<uv-tabbar-item v-for="(item,index) in $store.state.tabbarList" :key="index" :badge="getNum(index)" :customStyle="{height:`110rpx`}">
|
||||
<uv-tabbar-item v-for="(item,index) in $store.state.tabbarList" :key="index" :customStyle="{height:`110rpx`}">
|
||||
<template v-slot:active-icon>
|
||||
<image class="icon" :src="item.selectedIconPath"></image>
|
||||
</template>
|
||||
|
|
@ -35,12 +35,6 @@
|
|||
"selectedIconPath": "/static/images/tabbar/new_order.png",
|
||||
"pagePath": "/pages/order/userorder-list"
|
||||
},
|
||||
{
|
||||
"iconPath": "/static/images/tabbar/new_message_gray.png",
|
||||
"text": "消息",
|
||||
"selectedIconPath": "/static/images/tabbar/new_message.png",
|
||||
"pagePath": "/pages/message/message"
|
||||
},
|
||||
{
|
||||
"iconPath": "/static/images/tabbar/new_my_gray.png",
|
||||
"text": "我的",
|
||||
|
|
@ -50,11 +44,6 @@
|
|||
]
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
messageNum(){
|
||||
return this.$store.state.messageNum || 0
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
if (!this.$store.state.tabbarList.length) {
|
||||
let isnNetwork = uni.getStorageSync("isnNetwork");
|
||||
|
|
@ -62,10 +51,9 @@
|
|||
await this.getButtonImg()
|
||||
} else {
|
||||
uni.getNetworkType({
|
||||
success: (res) => {
|
||||
success: (res)=> {
|
||||
console.log(res.networkType);
|
||||
if (res.networkType == "none") {
|
||||
|
||||
this.$store.commit("setTabbarList", this.tabbarList)
|
||||
} else {
|
||||
// 页面加载逻辑
|
||||
|
|
@ -75,22 +63,16 @@
|
|||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
getNum(index){
|
||||
if(index==2){
|
||||
return this.messageNum
|
||||
}else{
|
||||
return 0
|
||||
}
|
||||
},
|
||||
//获取头部背景图片
|
||||
async getButtonImg() {
|
||||
let res = await request.post("/user/poster/getButtonImg", {});
|
||||
if (res.code == 200) {
|
||||
this.tabbarList
|
||||
// if (res.data?.photo) {
|
||||
// this.topBgImage = res.data?.photo + '?time=666'
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import request from "../../utils/request";
|
||||
import request from "@/utils/request";
|
||||
import uniPopup from "@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue";
|
||||
export default {
|
||||
name: "uploadAppVue",
|
||||
|
|
@ -237,7 +237,7 @@ export default {
|
|||
return this.version;
|
||||
},
|
||||
async getUpdateInfo() {
|
||||
const response = await request.post("/user/getappversion");
|
||||
const response = await request.post("/sj/getAppVersion");
|
||||
this.newVersion = response.data?.version;
|
||||
this.updateAPKPath = response.data?.url;
|
||||
this.is_force = response.data?.is_force;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"name" : "美融融plus",
|
||||
"appid" : "__UNI__DA7CE05",
|
||||
"name" : "美融融商家",
|
||||
"appid" : "__UNI__BBE6285",
|
||||
"description" : "同城便捷到家美业“技术外卖”服务、同城预约到店服务平台美融融为同城爱美人群提供更优质的更全面的服务。",
|
||||
"versionName" : "1.2.20",
|
||||
"versionCode" : 1220,
|
||||
"versionName" : "1.0.03",
|
||||
"versionCode" : 1003,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
|
|
@ -180,10 +180,8 @@
|
|||
"description" : "阿里云号码认证SDK,包含一键登录和本机号码校验两个功能。",
|
||||
"platforms" : "Android,iOS",
|
||||
"url" : "https://ext.dcloud.net.cn/plugin?id=4297",
|
||||
"android_package_name" : "cn.mrrweb",
|
||||
"ios_bundle_id" : "cn.mrrweb",
|
||||
"android_package_name" : "cn.mrrweb",
|
||||
"ios_bundle_id" : "cn.mrrweb",
|
||||
"android_package_name" : "cn.mrrsj",
|
||||
"ios_bundle_id" : "cn.mrrsj",
|
||||
"isCloud" : true,
|
||||
"bought" : 1,
|
||||
"pid" : "4297",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
// mixins/share.js
|
||||
import request from '@/utils/request'
|
||||
export default {
|
||||
methods: {
|
||||
formatPriceNumber(num) {
|
||||
|
|
@ -110,14 +109,6 @@ export default {
|
|||
let screenWidth = this.$store.state.systemInfo.screenWidth
|
||||
return this.pxToRpx(statusBarHeight, screenWidth)
|
||||
},
|
||||
//消息数量跟新
|
||||
messageUpudateNum() {
|
||||
request.post("/user/push/messageUnreadNum").then(res => {
|
||||
if( res.code==200){
|
||||
this.$store.commit("setMessageNum", res.data.count)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取图片路径(通过条件编译区分环境:仅App缓存,非App直接返回网络URL)
|
||||
|
|
@ -125,7 +116,7 @@ export default {
|
|||
* @returns {Promise<string | string[]>} - 单个URL返回字符串,数组返回对应路径数组
|
||||
*/
|
||||
async getImagePath(urls) {
|
||||
|
||||
|
||||
// ======================
|
||||
// 条件编译:非App环境(小程序/H5/快应用等)
|
||||
// #ifndef APP-PLUS
|
||||
|
|
@ -145,17 +136,18 @@ export default {
|
|||
console.error('getImagePath:请传入有效的URL(字符串/数组)');
|
||||
return Array.isArray(urls) ? [] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 统一转为数组处理
|
||||
const isBatch = Array.isArray(urls);
|
||||
const urlList = isBatch ?
|
||||
urls.filter(url => typeof url === 'string' && url.trim()) : [urls.trim()];
|
||||
urls.filter(url => typeof url === 'string' && url.trim()) :
|
||||
[urls.trim()];
|
||||
|
||||
if (urlList.length === 0) {
|
||||
return isBatch ? [] : '';
|
||||
}
|
||||
|
||||
|
||||
// 遍历处理每个URL(优先读缓存,无缓存则下载)
|
||||
const resultList = [];
|
||||
for (const url of urlList) {
|
||||
|
|
@ -164,12 +156,12 @@ export default {
|
|||
const cacheKey = this._getImageCacheKey(url);
|
||||
// 读取本地缓存
|
||||
const cachedPath = uni.getStorageSync(cacheKey);
|
||||
|
||||
|
||||
if (cachedPath) {
|
||||
resultList.push(cachedPath);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// 无缓存则下载并保存
|
||||
await this._downloadAndCacheImage(url);
|
||||
// 再次读取缓存(兜底:防止保存失败)
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
{"agcgw":{"url":"connect-drcn.dbankcloud.cn","backurl":"connect-drcn.hispace.hicloud.com","websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn","websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com"},"agcgw_all":{"SG":"connect-dra.dbankcloud.cn","SG_back":"connect-dra.hispace.hicloud.com","CN":"connect-drcn.dbankcloud.cn","CN_back":"connect-drcn.hispace.hicloud.com","RU":"connect-drru.hispace.dbankcloud.ru","RU_back":"connect-drru.hispace.dbankcloud.cn","DE":"connect-dre.dbankcloud.cn","DE_back":"connect-dre.hispace.hicloud.com"},"websocketgw_all":{"SG":"connect-ws-dra.hispace.dbankcloud.cn","SG_back":"connect-ws-dra.hispace.dbankcloud.com","CN":"connect-ws-drcn.hispace.dbankcloud.cn","CN_back":"connect-ws-drcn.hispace.dbankcloud.com","RU":"connect-ws-drru.hispace.dbankcloud.ru","RU_back":"connect-ws-drru.hispace.dbankcloud.cn","DE":"connect-ws-dre.hispace.dbankcloud.cn","DE_back":"connect-ws-dre.hispace.dbankcloud.com"},"client":{"cp_id":"260086000058238908","product_id":"461323198430018699","client_id":"1707180678149323456","client_secret":"2FCF8113D06D9C43DDDD4D291632F3769D4B991BBBF142448955B982673F3BF6","project_id":"461323198430018699","app_id":"114445451","api_key":"DgEDAP73r+rgXVMxFcwnVKN09OMmc1zg7Je7hSyx1o+hZpcOBR7cBZC40l/ehJBUzOuUGblIPOhhJOVPMHBdX1L1SFnEMcUjAEtgWA==","package_name":"cn.mrrweb"},"oauth_client":{"client_id":"114445451","client_type":1},"app_info":{"app_id":"114445451","package_name":"cn.mrrweb"},"service":{"analytics":{"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn","collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn","collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn","collector_url_ru":"datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com","collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn","resource_id":"p1","channel_id":""},"ml":{"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"},"cloudstorage":{"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn","storage_url_ru":"https://agc-storage-drru.cloud.huawei.ru","storage_url_sg":"https://ops-dra.agcstorage.link","storage_url_de":"https://ops-dre.agcstorage.link","storage_url_cn":"https://agc-storage-drcn.platform.dbankcloud.cn","storage_url_ru_back":"https://agc-storage-drru.cloud.huawei.ru","storage_url_sg_back":"https://agc-storage-dra.cloud.huawei.asia","storage_url_de_back":"https://agc-storage-dre.cloud.huawei.eu","storage_url_cn_back":"https://agc-storage-drcn.cloud.huawei.com.cn"},"search":{"url":"https://search-drcn.cloud.huawei.com"},"edukit":{"edu_url":"edukit.cloud.huawei.com.cn","dh_url":"edukit.cloud.huawei.com.cn"}},"region":"CN","configuration_version":"3.0","appInfos":[{"package_name":"cn.mrrweb","client":{"app_id":"114445451"},"app_info":{"package_name":"cn.mrrweb","app_id":"114445451"},"oauth_client":{"client_type":1,"client_id":"114445451"}}]}
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":"1.0.1","cn.mrrweb":{"manifestPlaceholders":{"VIVO_APPKEY":"aa27f4e4839fd1345bf57025778df558","VIVO_APPID":"105916679","HONOR_APPID":"104505186"},"oppoPushBussinessId":"46175","oppoPushAppKey":"b30fc37dd1f54108bb464e963dc427df","oppoPushAppSecret":"7cfff81389cf426c92e249d89f41ddb0","huaweiPushBussinessId":"46176","huaweiBadgeClassName":"","honorPushBussinessId":"46177","honorBadgeClassName":"","xiaomiPushBussinessId":"46191","xiaomiPushAppId":"2882303761520423236","xiaomiPushAppKey":"5772042339236","vivoPushBussinessId":"46192"}}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"VIVO_APPKEY": "aa27f4e4839fd1345bf57025778df558 ",
|
||||
"VIVO_APPID": "105916679",
|
||||
"HONOR_APPID":"104505186"
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"developer_id":"110000064495",
|
||||
"app_id":"104505186",
|
||||
"package_name":"cn.mrrweb",
|
||||
"version":"1.0"
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"businessID":"47959"
|
||||
}
|
||||
Binary file not shown.
|
|
@ -1,11 +1,10 @@
|
|||
{
|
||||
"name": "mrr.app.front",
|
||||
"name": "mrr.app.front.js",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"@tencentcloud/chat": "^3.6.5",
|
||||
"ali-oss": "^6.23.0",
|
||||
"js-pinyin": "^0.2.7",
|
||||
"save": "^2.9.0",
|
||||
|
|
@ -71,12 +70,6 @@
|
|||
"license": "MIT",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/@tencentcloud/chat": {
|
||||
"version": "3.6.5",
|
||||
"resolved": "https://registry.npmmirror.com/@tencentcloud/chat/-/chat-3.6.5.tgz",
|
||||
"integrity": "sha512-2Wseaqn8AWdkO4iaznJcdtvIsD6U/rujoWWOlFtSK778ZFASWNLEdw0PFwycZaGZJYUb2WSyR9oOXqQH/YvrCw==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/@vue/compiler-core": {
|
||||
"version": "3.5.18",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.5.18.tgz",
|
||||
|
|
@ -1364,7 +1357,7 @@
|
|||
},
|
||||
"node_modules/weapp-qrcode-canvas-2d": {
|
||||
"version": "1.1.6",
|
||||
"resolved": "https://registry.npmmirror.com/weapp-qrcode-canvas-2d/-/weapp-qrcode-canvas-2d-1.1.6.tgz",
|
||||
"resolved": "https://registry.npmjs.org/weapp-qrcode-canvas-2d/-/weapp-qrcode-canvas-2d-1.1.6.tgz",
|
||||
"integrity": "sha512-98/Al6OgYJwJIQFRypux43a21TZpeVy/63uYzAR4YQrIm9+vxq7bKH5v+hRwshWdku4TySDmhXC8la8wZmh5UQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"@tencentcloud/chat": "^3.6.5",
|
||||
"ali-oss": "^6.23.0",
|
||||
"js-pinyin": "^0.2.7",
|
||||
"save": "^2.9.0",
|
||||
|
|
@ -8,4 +7,4 @@
|
|||
"vuex-persistedstate": "^4.1.0",
|
||||
"weapp-qrcode-canvas-2d": "^1.1.6"
|
||||
}
|
||||
}
|
||||
}
|
||||
182
pages.json
182
pages.json
|
|
@ -31,63 +31,12 @@
|
|||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/message/message",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/message/coupon_notice",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/message/settings",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/message/message_setting",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/message/active_setting",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/ruzhu/ruzhu",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/search/search-history",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"app-plus": {
|
||||
"bounce": "none" // "none" 禁用回弹,"vertical" 仅允许垂直回弹(默认)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/search/search-result",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"app-plus": {
|
||||
"bounce": "none" // "none" 禁用回弹,"vertical" 仅允许垂直回弹(默认)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/login/login",
|
||||
"style": {
|
||||
|
|
@ -95,12 +44,6 @@
|
|||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/register/register",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/artisan/service-list",
|
||||
"style": {
|
||||
|
|
@ -338,18 +281,6 @@
|
|||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/coupon/couponDetail",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/coupon/couponHistory",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/wallet/wallet",
|
||||
"style": {
|
||||
|
|
@ -402,8 +333,7 @@
|
|||
{
|
||||
"path": "pages/user/employee-detail",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"pageOrientation": "auto" // 关键:允许页面自动旋转
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -574,14 +504,6 @@
|
|||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/shop/home",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": true,
|
||||
"bounce": "none"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/syr/home",
|
||||
"style": {
|
||||
|
|
@ -590,12 +512,6 @@
|
|||
"bounce": "none"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/shop/my",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/shop/staff/manage",
|
||||
"style": {
|
||||
|
|
@ -659,8 +575,7 @@
|
|||
{
|
||||
"path": "pages/shop/photoAlbum/addPhoto",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"pageOrientation": "auto" // 关键:允许页面自动旋转
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -669,6 +584,12 @@
|
|||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/shop/set",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/syr/my",
|
||||
|
|
@ -882,27 +803,6 @@
|
|||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/groupBuy/list",
|
||||
"style": {
|
||||
"app-plus": {
|
||||
"bounce": "none"
|
||||
}, // 防止ios端上下拖动
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/groupBuy/detail",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/groupBuy/submit",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/recruit/recruit",
|
||||
"style": {
|
||||
|
|
@ -936,24 +836,6 @@
|
|||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/evaluate/comment",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/evaluate/evaluationDetails",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/evaluate/evaluationList",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/promotion/promotion",
|
||||
"style": {
|
||||
|
|
@ -1032,36 +914,11 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/lottery/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/lottery/list",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/lottery/winDetail",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/album/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/coupon/myCoupon",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的优惠券",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1073,32 +930,19 @@
|
|||
"backgroundColor": "#F8F8F8"
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#AFB8BD",
|
||||
"color": "#999",
|
||||
"selectedColor": "#E8101E",
|
||||
"backgroundColor": "#fff",
|
||||
"custom": true,
|
||||
|
||||
"list": [{
|
||||
"iconPath": "/static/images/tabbar/new_home_gray.png",
|
||||
"iconPath": "/static/images/tabbar/home_icon_dis.png",
|
||||
"text": "首页",
|
||||
"selectedIconPath": "/static/images/tabbar/new_home.png",
|
||||
"selectedIconPath": "/static/images/tabbar/home_icon_active.png",
|
||||
"pagePath": "pages/home/home"
|
||||
},
|
||||
{
|
||||
"iconPath": "/static/images/tabbar/new_order_gray.png",
|
||||
"text": "订单",
|
||||
"selectedIconPath": "/static/images/tabbar/new_order.png",
|
||||
"pagePath": "pages/order/userorder-list"
|
||||
},
|
||||
{ "iconPath": "/static/images/tabbar/new_message_gray.png",
|
||||
"text": "消息",
|
||||
"selectedIconPath": "/static/images/tabbar/new_message.png",
|
||||
"pagePath": "pages/message/message"
|
||||
},
|
||||
{
|
||||
"iconPath": "/static/images/tabbar/new_my_gray.png",
|
||||
"iconPath": "/static/images/tabbar/my_icon_dis.png",
|
||||
"text": "我的",
|
||||
"selectedIconPath": "/static/images/tabbar/new_my.png",
|
||||
"selectedIconPath": "/static/images/tabbar/my_icon_active.png",
|
||||
"pagePath": "pages/my/my"
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
},
|
||||
onLoad(options) {
|
||||
if (options.type) {
|
||||
this.title = options.type == 3 ? '用户注册协议' : options.type == 4 ? '隐私政策' : '';
|
||||
this.title = options.type == 28 ? '用户注册协议' : options.type == 26 ? '隐私政策' : '';
|
||||
this.getXieyi(options.type)
|
||||
}
|
||||
if (options.title) {
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@
|
|||
@touchend.stop='videotouchend' @click.stop="videoClick"></view>
|
||||
<!-- 视频文本区域 - 每个视频都有 -->
|
||||
<view class="video-texts">
|
||||
<!-- <view class="flex-row-center" style="flex: 1;">
|
||||
<text class="video-title">{{ videoInfo_0.name }}</text>
|
||||
<view class="flex-row-center" style="flex: 1;">
|
||||
<text class="video-title">{{ videoInfo_0.src }}</text>
|
||||
<text class="video-score">评分 4.8</text>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="flex-row-center-between" style="flex: 1;">
|
||||
<text class="video-text">{{videoInfo_0.name}}</text>
|
||||
<!-- 声音图标 - 绑定0号视频的状态,点击切换静音 -->
|
||||
|
|
@ -53,10 +53,10 @@
|
|||
@touchend='videotouchend' @click="videoClick"></view>
|
||||
<!-- 视频文本区域 - 1号视频 -->
|
||||
<view class="video-texts">
|
||||
<!-- <view class="flex-row-center" style="flex: 1;">
|
||||
<view class="flex-row-center" style="flex: 1;">
|
||||
<text class="video-title">珍草品汇理疗馆珍馆服务流程11订单</text>
|
||||
<text class="video-score">评分 4.8</text>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="flex-row-center-between" style="flex: 1;">
|
||||
<text class="video-text">{{videoInfo_1.name}}</text>
|
||||
<!-- 声音图标 - 绑定1号视频的状态 -->
|
||||
|
|
@ -85,10 +85,10 @@
|
|||
@touchend='videotouchend' @click="videoClick"></view>
|
||||
<!-- 视频文本区域 - 2号视频 -->
|
||||
<view class="video-texts">
|
||||
<!-- <view class="flex-row-center" style="flex: 1;">
|
||||
<view class="flex-row-center" style="flex: 1;">
|
||||
<text class="video-title">珍草品汇理疗馆珍馆服务流程11订单</text>
|
||||
<text class="video-score">评分 4.8</text>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="flex-row-center-between" style="flex: 1;">
|
||||
<text class="video-text">{{videoInfo_2.name}}</text>
|
||||
<!-- 声音图标 - 绑定2号视频的状态 -->
|
||||
|
|
@ -117,10 +117,10 @@
|
|||
@touchend='videotouchend' @click="videoClick"></view>
|
||||
<!-- 视频文本区域 - 3号视频 -->
|
||||
<view class="video-texts">
|
||||
<!-- <view class="flex-row-center" style="flex: 1;">
|
||||
<view class="flex-row-center" style="flex: 1;">
|
||||
<text class="video-title">珍草品汇理疗馆珍馆服务流程11订单</text>
|
||||
<text class="video-score">评分 4.8</text>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="flex-row-center-between" style="flex: 1;">
|
||||
<text class="video-text">{{videoInfo_3.name}}</text>
|
||||
<!-- 声音图标 - 绑定3号视频的状态 -->
|
||||
|
|
@ -149,10 +149,10 @@
|
|||
@touchend='videotouchend' @click="videoClick"></view>
|
||||
<!-- 视频文本区域 - 4号视频 -->
|
||||
<view class="video-texts">
|
||||
<!-- <view class="flex-row-center" style="flex: 1;">
|
||||
<view class="flex-row-center" style="flex: 1;">
|
||||
<text class="video-title">珍草品汇理疗馆珍馆服务流程11订单</text>
|
||||
<text class="video-score">评分 4.8</text>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="flex-row-center-between" style="flex: 1;">
|
||||
<text class="video-text">{{videoInfo_4.name}}</text>
|
||||
<!-- 声音图标 - 绑定4号视频的状态 -->
|
||||
|
|
@ -163,14 +163,13 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<view @touchend='progressTouchend' class="progress-view" v-if="current==0">
|
||||
|
||||
<view @touchend='progressTouchend' class="progress-view">
|
||||
<uv-slider v-if="showSlider" v-model="progressValue" activeColor="#D8D8D8" block-size="6"
|
||||
backgroundColor="#494949;" class="progress-slider"></uv-slider>
|
||||
</view>
|
||||
|
||||
<!-- 修改:Dot指示器 - 最多显示5个 -->
|
||||
<view class="dots" :style="{top:`${0.5*winHeight}px`}" v-if="videoListLength > 1 && current==0" >
|
||||
<view class="dots" :style="{top:`${0.5*winHeight}px`}" v-if="videoListLength > 1">
|
||||
<view class="dots-container">
|
||||
<view class="dot-item" v-for="(dotIndex, idx) in visibleDots" :key="idx"
|
||||
:class="{ active: dotIndex === videoIndex }" @click="jumpToVideo(dotIndex)"></view>
|
||||
|
|
@ -212,10 +211,6 @@
|
|||
marginTop: {
|
||||
type: String,
|
||||
default: "88" // 默认值设为空数组JSON,避免parse报错
|
||||
},
|
||||
current: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<view class="container-content" :style="swiperStyle2">
|
||||
<swiper class="swiper" circular :style="swiperStyle" :current="current" @change="swiperChange" :disable-touch="current==0">
|
||||
<swiper-item>
|
||||
<videoSlide ref="ideoSlideRrf" :popVideoList="videoList" :marginTop="`${88 + this.statusBarHeight}`" :current="current" v-show="current==0" v-if="videoList.length"></videoSlide>
|
||||
<videoSlide ref="ideoSlideRrf" :popVideoList="videoList" :marginTop="`${88 + this.statusBarHeight}`" v-show="current==0" v-if="videoList.length"></videoSlide>
|
||||
</swiper-item>
|
||||
<swiper-item>
|
||||
<scroll-view scroll-y :style="{height:`${viewportHeight-88-this.statusBarHeight-100}rpx`}">
|
||||
|
|
|
|||
|
|
@ -10,14 +10,14 @@
|
|||
|
||||
<!-- 右侧状态栏 -->
|
||||
<view class="navbar-right">
|
||||
<view class="nav-status-item" @click="handleShareWechat">
|
||||
<!-- <view class="nav-status-item" @click="handleShareWechat">
|
||||
<image class="nav-status-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/8a412688-b794-4407-bba6-a6dc65d75f08" mode="aspectFit"></image>
|
||||
<text class="nav-status-text">分享到微信</text>
|
||||
</view>
|
||||
<view class="nav-status-item" @click="handleViewShop">
|
||||
<image class="nav-status-icon" :src="identity == '2' ? 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/2b5de852-2d35-4786-a643-d20cabb3eaee' : 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/85638da9-804e-4811-8378-d1bb6007f99d'" mode="aspectFit"></image>
|
||||
<text class="nav-status-text">{{ identity == '2' ? '查看店铺' : '查看手艺人' }}</text>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -78,22 +78,22 @@
|
|||
</view>
|
||||
|
||||
<!-- 个人信息(手艺人显示) -->
|
||||
<view class="info-item" @click="navigateToimg">
|
||||
<!-- <view class="info-item" @click="navigateToimg">
|
||||
<view class="info-left">
|
||||
<image class="item-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/53a9d1e1-e2d2-4001-b599-82e0c0747f1a.png" mode="aspectFit"></image>
|
||||
<text class="item-label">相册管理</text>
|
||||
</view>
|
||||
<image class="arrow-right" src="/static/images/arrow_right.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 个人信息(手艺人显示) -->
|
||||
<view class="info-item" @click="navigateTovideo">
|
||||
<!-- <view class="info-item" @click="navigateTovideo">
|
||||
<view class="info-left">
|
||||
<image class="item-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/6fc821cd-8dd1-41f1-8854-889fb5f76b78.png" mode="aspectFit"></image>
|
||||
<text class="item-label">视频管理</text>
|
||||
</view>
|
||||
<image class="arrow-right" src="/static/images/arrow_right.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@
|
|||
<text class="price-symbol">¥</text>
|
||||
<text class="price-value">{{ item.server_price }}</text>
|
||||
<text class="price-unit">元</text>
|
||||
<text class="price-line">{{ item.line_price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -170,12 +169,7 @@
|
|||
},
|
||||
methods: {
|
||||
getServicesList() {
|
||||
let url = null;
|
||||
if (getApp().globalData.artisanType == 1) {
|
||||
url = "/user/syrserverlist";
|
||||
} else if (getApp().globalData.artisanType == 2) {
|
||||
url = "/user/sjserverlist";
|
||||
}
|
||||
let url = "/user/sjserverlist";
|
||||
request
|
||||
.post(url, {
|
||||
state: this.state,
|
||||
|
|
@ -248,27 +242,15 @@
|
|||
});
|
||||
},
|
||||
viewEdit(item) {
|
||||
if (getApp().globalData.artisanType == 1) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/artisan/add-service?id=${item.id}&state=${item.state}`,
|
||||
});
|
||||
} else if (getApp().globalData.artisanType == 2) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/shop/add-service?id=${item.id}&state=${item.state}`,
|
||||
});
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pages/shop/add-service?id=${item.id}&state=${item.state}`,
|
||||
});
|
||||
|
||||
},
|
||||
addService() {
|
||||
if (getApp().globalData.artisanType == 1) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/artisan/add-service`,
|
||||
});
|
||||
} else if (getApp().globalData.artisanType == 2) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/shop/add-service`,
|
||||
});
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pages/shop/add-service`,
|
||||
});
|
||||
},
|
||||
deleteService(item) {
|
||||
uni.showModal({
|
||||
|
|
@ -565,7 +547,7 @@
|
|||
.service-title {
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
margin-bottom: 60rpx;
|
||||
margin-bottom: 24rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
|
|
@ -575,33 +557,21 @@
|
|||
}
|
||||
|
||||
.price-symbol {
|
||||
font-family: DINPro, DINPro;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #E8101E;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.price-value {
|
||||
font-family: DINPro, DINPro;
|
||||
font-weight: 500;
|
||||
font-size: 36rpx;
|
||||
font-size: 28rpx;
|
||||
color: #E8101E;
|
||||
font-weight: 500;
|
||||
margin: 0 4rpx;
|
||||
}
|
||||
|
||||
.price-unit {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #E8101E;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.price-line {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
line-height: 34rpx;
|
||||
margin-left: 10rpx;
|
||||
text-decoration: line-through;
|
||||
color: #E8101E;
|
||||
}
|
||||
|
||||
.status-tag {
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@
|
|||
<agree-radio :isAgree="isAgree" @change-agree="changeAgree" class="agree-btn"></agree-radio>
|
||||
<view class="agree-card">
|
||||
<text class="agree-text">未注册手机号登录后将自动生成账号,且代表您已阅读并同意,</text>
|
||||
<text class="agreement" @click="goAgreement(3)">《用户注册协议》</text>
|
||||
<text class="agreement" @click="goAgreement(4)">《隐私政策》</text>
|
||||
<text class="agreement" @click="goAgreement(28)">《用户注册协议》</text>
|
||||
<text class="agreement" @click="goAgreement(26)">《隐私政策》</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -86,13 +86,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
isNotificationsEnabled,
|
||||
permissions,
|
||||
registPush
|
||||
} from '@/utils/AS-NotifyTheAuthority.js'
|
||||
import AgreeRadio from '@/components/agree-radio/agree-radio.vue'
|
||||
import request from '../../utils/request';
|
||||
import request from '@/utils/request';
|
||||
import uiConfig from "@/utils/ui-config.js"
|
||||
const aLiSDKModule = uni.requireNativePlugin('AliCloud-NirvanaPns');
|
||||
|
||||
|
|
@ -102,9 +97,9 @@
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
isFirst: false, //是否第一次打开
|
||||
isFirst:false,//是否第一次打开
|
||||
showPassword: false, // 是否展示密码
|
||||
maskShow: true,
|
||||
maskShow: false,
|
||||
loginType: 'code', // 当前选项卡:code/account/onekey
|
||||
phone: '', // 验证码-手机号
|
||||
code: '', // 验证码-验证码
|
||||
|
|
@ -140,36 +135,33 @@
|
|||
* 检查安卓系统权限(设备信息/短信)
|
||||
*/
|
||||
checkAndroidPermission() {
|
||||
// #ifdef APP-PLUS
|
||||
const permissions = [
|
||||
'android.permission.READ_PHONE_STATE'
|
||||
];
|
||||
|
||||
plus.android.requestPermissions(permissions, (result) => {
|
||||
const {
|
||||
granted,
|
||||
neverDenied
|
||||
} = result;
|
||||
console.log(11111111, result)
|
||||
if (neverDenied.length > 0) {
|
||||
// 永久拒绝:引导用户去系统设置页开启
|
||||
uni.showModal({
|
||||
title: '权限提示',
|
||||
content: '需要您开启设备信息和短信权限才能使用一键登录',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
plus.android.openSettings(); // 打开安卓设置页
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (granted.length === permissions.length) {
|
||||
// 已授权:继续运营商一键登录
|
||||
this.checkOperatorAuth();
|
||||
}
|
||||
}, (err) => {
|
||||
console.error('申请权限失败:', err);
|
||||
});
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
const permissions = [
|
||||
'android.permission.READ_PHONE_STATE'
|
||||
];
|
||||
|
||||
plus.android.requestPermissions(permissions, (result) => {
|
||||
const { granted, neverDenied } = result;
|
||||
console.log(11111111,result)
|
||||
if (neverDenied.length > 0) {
|
||||
// 永久拒绝:引导用户去系统设置页开启
|
||||
uni.showModal({
|
||||
title: '权限提示',
|
||||
content: '需要您开启设备信息和短信权限才能使用一键登录',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
plus.android.openSettings(); // 打开安卓设置页
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (granted.length === permissions.length) {
|
||||
// 已授权:继续运营商一键登录
|
||||
this.checkOperatorAuth();
|
||||
}
|
||||
}, (err) => {
|
||||
console.error('申请权限失败:', err);
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
// 是否同意修改
|
||||
changeAgree(value) {
|
||||
|
|
@ -296,7 +288,7 @@
|
|||
// 加速登录页加载
|
||||
aLiSDKModule.accelerateLoginPage(5000, (result) => {
|
||||
console.log('加速授权页结果:', JSON.stringify(result));
|
||||
|
||||
|
||||
if (result.resultCode === '600000') {
|
||||
console.log("加速授权页拉起成功");
|
||||
// 延迟执行,确保配置构建完成
|
||||
|
|
@ -312,38 +304,35 @@
|
|||
}
|
||||
}, 100);
|
||||
} else {
|
||||
if (!this.isFirst) {
|
||||
if (result.resultCode == 600004 || result.resultCode == 600008) {
|
||||
if(!this.isFirst){
|
||||
if(result.resultCode == 600004 || result.resultCode ==600008){
|
||||
uni.showToast({
|
||||
title: "蜂窝网络未开启",
|
||||
icon: 'none'
|
||||
});
|
||||
} else if (result.resultCode == 600007 || result.resultCode == 600009) {
|
||||
}else if(result.resultCode == 600007 || result.resultCode ==600009){
|
||||
uni.showToast({
|
||||
title: "未检测到sim卡",
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: "唤起授权页失败",
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.maskShow = true
|
||||
this.isFirst = false
|
||||
console.error("授权页加速拉起失败:", result);
|
||||
}, 50)
|
||||
|
||||
|
||||
|
||||
this.maskShow = true
|
||||
this.isFirst = false
|
||||
console.error("授权页加速拉起失败:", result);
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
// 捕获aLiSDKModule未定义或其他执行错误
|
||||
this.maskShow = true
|
||||
console.error("跳转到登录页时发生错误:", error);
|
||||
|
||||
|
||||
}
|
||||
// aLiSDKModule.accelerateLoginPage(5000, result => {
|
||||
// console.log(JSON.stringify(result));
|
||||
|
|
@ -478,19 +467,17 @@
|
|||
});
|
||||
return false;
|
||||
} else {
|
||||
request.post('/user/codelogin', {
|
||||
request.post('/sj/codelogin', {
|
||||
account: that.phone,
|
||||
code: that.code,
|
||||
deviceid: getApp().globalData.deviceid
|
||||
}).then(result => {
|
||||
if (result.state == 1) {
|
||||
uni.setStorageSync('accessToken', result.access_token);
|
||||
uni.setStorageSync('refreshToken', result.refresh_token);
|
||||
uni.setStorageSync('refresh_token_expries', result.refresh_token_expries);
|
||||
if (result.code == 200) {
|
||||
uni.setStorageSync('accessToken', result.data.access_token);
|
||||
uni.setStorageSync('refreshToken', result.data.refresh_token);
|
||||
uni.setStorageSync('refresh_token_expries', result.data.refresh_token_expries);
|
||||
uni.setStorageSync('loginAccount', that.phone); // 保存登录的手机号
|
||||
this.closeWindow();
|
||||
this.setSelectCity();
|
||||
registPush();
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: result.msg,
|
||||
|
|
@ -559,24 +546,23 @@
|
|||
});
|
||||
return false;
|
||||
} else {
|
||||
request.post('/user/accountlogin', {
|
||||
request.post('/sj/accountlogin', {
|
||||
account: that.phone,
|
||||
password: that.password,
|
||||
deviceid: getApp().globalData.deviceid
|
||||
}).then(result => {
|
||||
if (result.state == 1) {
|
||||
console.log(result)
|
||||
if (result.code == 200) {
|
||||
// 登录成功:清除该账号的密码错误次数和锁定缓存
|
||||
that.clearPwdLockCache(that.phone);
|
||||
uni.setStorageSync('accessToken', result.access_token);
|
||||
uni.setStorageSync('refreshToken', result.refresh_token);
|
||||
uni.setStorageSync('refresh_token_expries', result.refresh_token_expries);
|
||||
uni.setStorageSync('accessToken', result.data.access_token);
|
||||
uni.setStorageSync('refreshToken', result.data.refresh_token);
|
||||
uni.setStorageSync('refresh_token_expries', result.data.refresh_token_expries);
|
||||
uni.setStorageSync('loginAccount', that.phone); // 保存登录的手机号
|
||||
that.closeWindow();
|
||||
that.setSelectCity();
|
||||
registPush();
|
||||
} else {
|
||||
// 登录失败:判断是否为密码错误(假设后端返回msg包含“密码错误”关键词,可根据实际接口调整)
|
||||
if (result.state === 3) {
|
||||
if (result.code === 502) {
|
||||
const currentErrorCount = that.getPwdErrorCount(that.phone);
|
||||
const maxErrorCount = 5;
|
||||
const remainingCount = maxErrorCount - currentErrorCount - 1;
|
||||
|
|
@ -616,19 +602,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
//登陆时存储默认城市信息
|
||||
setSelectCity() {
|
||||
if (!uni.getStorageSync('searchCity')) {
|
||||
let searchCity = {
|
||||
adcode: "130983",
|
||||
cCode: "130900",
|
||||
center: "117.332895,38.372566",
|
||||
name: "沧州市",
|
||||
pcode: "130000",
|
||||
}
|
||||
uni.setStorageSync('searchCity', searchCity)
|
||||
}
|
||||
},
|
||||
// 密码格式校验
|
||||
validatePassword(password) {
|
||||
// 正则说明:
|
||||
|
|
@ -658,14 +631,14 @@
|
|||
tokenResult => {
|
||||
uni.hideLoading();
|
||||
console.log("tokenResult:", JSON.stringify(tokenResult));
|
||||
|
||||
|
||||
if ("600001" == tokenResult.resultCode) {
|
||||
console.log("授权页拉起成功");
|
||||
this.maskShow = false
|
||||
aLiSDKModule.setCheckboxIsChecked(false);
|
||||
} else if ("600000" == tokenResult.resultCode) {
|
||||
console.log("获取Token成功,接下来拿着结果里面的Token去服务端换取手机号码,SDK服务到此结束");
|
||||
request.post('/user/phoneLogin', {
|
||||
request.post('/sj/phoneLogin', {
|
||||
token: tokenResult.token,
|
||||
}).then(result => {
|
||||
if (result.code == 200) {
|
||||
|
|
@ -676,8 +649,6 @@
|
|||
.refresh_token_expries);
|
||||
uni.setStorageSync('loginAccount', result.data.account); // 保存登录的手机号
|
||||
that.closeWindow();
|
||||
that.setSelectCity();
|
||||
registPush();
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: result.msg,
|
||||
|
|
@ -695,22 +666,22 @@
|
|||
})
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
if (tokenResult.msg) {
|
||||
//手动关闭授权页
|
||||
if (!this.isFirst) {
|
||||
if(!this.isFirst){
|
||||
uni.showToast({
|
||||
title: tokenResult.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
this.maskShow = true
|
||||
this.quitLoginPage();
|
||||
}
|
||||
this.isFirst = false
|
||||
|
||||
|
||||
},
|
||||
clickResult => {
|
||||
console.log(JSON.stringify(clickResult));
|
||||
|
|
@ -1034,8 +1005,8 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.uni-input-placeholder {
|
||||
|
||||
.uni-input-placeholder{
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #BCC0C0;
|
||||
|
|
|
|||
|
|
@ -15,13 +15,21 @@
|
|||
<view class="btn-box" @click="callPhone">
|
||||
<text class="btn-text">拨打电话</text>
|
||||
</view>
|
||||
<!-- 获取权限提示匡内容 -->
|
||||
<view class="permission" :class="{ transform: isShowPer }">
|
||||
<view class="per-tit">美融融plus 对拨打电话权限申请说明</view>
|
||||
<view class="per-cont">当您需要联系商家或平台客服的时候,需要获取拨打电话权限。</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import permissionUtils from "@/utils/per";
|
||||
import locationService from "@/utils/locationService";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isShowPer: false, // 控制电话权限说明视图显示
|
||||
phone: '19950079687'
|
||||
}
|
||||
},
|
||||
|
|
@ -30,10 +38,56 @@
|
|||
},
|
||||
methods: {
|
||||
// 拨打电话
|
||||
callPhone() {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: this.phone //仅为示例
|
||||
})
|
||||
async callPhone() {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
if (systemInfo.platform === "ios") {
|
||||
uni.makePhoneCall({ phoneNumber: this.phone });
|
||||
} else {
|
||||
let permission = "android.permission.CALL_PHONE";
|
||||
this.isShowPer = true;
|
||||
|
||||
// 1. 检查权限
|
||||
const { granted } = await permissionUtils.checkPermission(
|
||||
"phone",
|
||||
"需要拨打电话权限,方便您联系客服"
|
||||
);
|
||||
if (granted) {
|
||||
this.isShowPer = false;
|
||||
uni.makePhoneCall({ phoneNumber: this.phone });
|
||||
return;
|
||||
}
|
||||
|
||||
this.isShowPer = false;
|
||||
// 2. 显示权限说明弹窗
|
||||
const confirm = await this.showPermissionDialog(
|
||||
"拨打电话权限申请",
|
||||
"我们需要拨打电话权限,方便您联系客服"
|
||||
);
|
||||
if (!confirm) return;
|
||||
|
||||
// 3. 请求权限
|
||||
const result = await permissionUtils.requestPermission(
|
||||
"phone",
|
||||
"需要拨打电话权限,方便您联系客服"
|
||||
);
|
||||
if (result) {
|
||||
uni.makePhoneCall({ phoneNumber: this.phone });
|
||||
} else {
|
||||
locationService.openAppSettings();
|
||||
}
|
||||
}
|
||||
},
|
||||
showPermissionDialog(title, content) {
|
||||
return new Promise((resolve) => {
|
||||
uni.showModal({
|
||||
title,
|
||||
content,
|
||||
confirmText: "去开启",
|
||||
success(res) {
|
||||
resolve(res.confirm);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -77,4 +131,10 @@
|
|||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.permission.transform {
|
||||
top: calc(var(--status-bar-height) + 100rpx);
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,233 +0,0 @@
|
|||
<template>
|
||||
<view class="coupon-card" :class="{ 'action-card': isActionStatus }" style="position: relative;">
|
||||
<!-- 左列:金额 + 条件 -->
|
||||
<view class="col-left" :class="{ 'action-left': isActionStatus }">
|
||||
<view class="coupon-amount">
|
||||
<text class="amount">{{ coupon.amount }}</text>
|
||||
<text class="yuan">元</text>
|
||||
</view>
|
||||
<text class="condition">{{ coupon.condition }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 中列:平台标签 + 有效期 -->
|
||||
<view class="col-middle" :class="{ 'action-middle': isActionStatus }">
|
||||
<view class="platform-tag">
|
||||
<text>{{ coupon.platform }}</text>
|
||||
<text class="separator">|</text>
|
||||
<text>{{ coupon.tag }}</text>
|
||||
</view>
|
||||
<text class="expiry">{{ coupon.expiry }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 右列:状态标签/按钮 + 图标 -->
|
||||
<view class="col-right">
|
||||
<view class="status-tag" :class="[coupon.status, { 'gradient-btn': isActionStatus }]" @click="handleAction">
|
||||
{{ statusText }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 新获取图标(仅可操作状态且 isNew 为 true 时显示) -->
|
||||
<view class="sate-icon" v-if="isActionStatus">
|
||||
<image v-if="coupon.isNew" class="icon-new"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/0da3e86d-8567-4c43-9a9e-392668701749.png"
|
||||
mode="aspectFit"></image>
|
||||
<!-- 快过期图标(仅可操作状态且 isExpiringSoon 为 true 时显示) -->
|
||||
<image v-if="coupon.isExpiringSoon" class="icon-expiring"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/21e102f7-b4a5-4b52-8c6d-8284b5e5b1c9.png"
|
||||
mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'CouponCard',
|
||||
props: {
|
||||
coupon: {
|
||||
type: Object,
|
||||
required: true,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isActionStatus() {
|
||||
return this.coupon.status === 'receive' || this.coupon.status === 'use';
|
||||
},
|
||||
statusText() {
|
||||
const map = {
|
||||
expired: '已过期',
|
||||
used: '已使用',
|
||||
receive: '立即领取',
|
||||
use: '立即使用'
|
||||
};
|
||||
return map[this.coupon.status] || '已过期';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleAction() {
|
||||
if (this.isActionStatus) {
|
||||
this.$emit('action', this.coupon.status);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.coupon-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-radius: 24rpx;
|
||||
padding: 30rpx 20rpx;
|
||||
background-image: url('https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/220ad6bb-a4c7-4197-84b7-80aa92501008.png');
|
||||
background-size: cover;
|
||||
background-size: 100% 100%;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.03);
|
||||
position: relative;
|
||||
|
||||
&.action-card {
|
||||
background-image: url('https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/b8d0a4c2-ef17-4dda-af0b-2d7c556ceb8b.png');
|
||||
}
|
||||
|
||||
/* 左列 */
|
||||
.col-left {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
min-width: 167rpx;
|
||||
margin-left: -10rpx;
|
||||
flex-shrink: 0;
|
||||
color: #FFAAA4;
|
||||
// border: #E8101E 1rpx solid;
|
||||
|
||||
&.action-left {
|
||||
color: #FF3340;
|
||||
}
|
||||
|
||||
.coupon-amount {
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.amount {
|
||||
font-family: DINPro, DINPro;
|
||||
font-size: 54rpx;
|
||||
font-weight: 500;
|
||||
line-height: 70rpx;
|
||||
margin-bottom: 8rpx;
|
||||
margin-right: 5rpx;
|
||||
}
|
||||
|
||||
.yuan {
|
||||
position: relative;
|
||||
top: -5rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.condition {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
line-height: 33rpx;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
/* 中列 */
|
||||
.col-middle {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0 25rpx;
|
||||
|
||||
.platform-tag {
|
||||
font-weight: 500;
|
||||
display: flex;
|
||||
font-size: 30rpx;
|
||||
color: #888888;
|
||||
margin-bottom: 10rpx;
|
||||
|
||||
.separator {
|
||||
margin: 0 8rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
.expiry {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #D3D3D3;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&.action-middle {
|
||||
.platform-tag {
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.separator {
|
||||
color: #807C7B;
|
||||
}
|
||||
|
||||
.expiry {
|
||||
color: #777777;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 右列 */
|
||||
.col-right {
|
||||
margin-right: 15rpx;
|
||||
flex-shrink: 0;
|
||||
|
||||
.status-tag {
|
||||
position: relative;
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
line-height: 33rpx;
|
||||
color: #ffffff;
|
||||
background-color: #DDD;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 27rpx;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
|
||||
&.expired,
|
||||
&.used {
|
||||
background-color: #DDD;
|
||||
}
|
||||
|
||||
&.gradient-btn {
|
||||
background: linear-gradient(135deg, #FF3344, #E8101E);
|
||||
border: none;
|
||||
color: #fff;
|
||||
padding: 11rpx 18rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 新获取快过期图标位置 */
|
||||
.sate-icon {
|
||||
position: absolute;
|
||||
top: -3rpx;
|
||||
right: -3rpx;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
z-index: 10;
|
||||
|
||||
.icon-new,
|
||||
.icon-expiring {
|
||||
width: 93rpx;
|
||||
height: 62rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,249 +0,0 @@
|
|||
<template>
|
||||
<view class="coupon-detail-page">
|
||||
<!-- 顶部背景图 -->
|
||||
<view class="top-bg"></view>
|
||||
|
||||
<!-- 透明导航栏 -->
|
||||
<custom-navbar
|
||||
:title="title"
|
||||
:show-back="true"
|
||||
title-color="#333333"
|
||||
background-color="transparent"
|
||||
:showHeadle="false"
|
||||
:borderBottom="'none'"
|
||||
></custom-navbar>
|
||||
|
||||
<!-- 主要内容区域 -->
|
||||
<view class="detail-content">
|
||||
<!-- 优惠券核心卡片 -->
|
||||
<view class="coupon-card">
|
||||
<!-- 标签行-->
|
||||
<view class="tag-section">
|
||||
<view class="tag-new-user">
|
||||
<image class="tag-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/1b4ff234-ac31-4b61-9d6b-baa8025ad3cc.png"></image>
|
||||
<text class="tag-text">满150元减20元优惠券</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 下划线-->
|
||||
<view class="title-underline"></view>
|
||||
|
||||
<!-- 活动名称行 -->
|
||||
<view class="info-row">
|
||||
<view class="info-label">活动名称:</view>
|
||||
<view class="info-value">新人优惠券</view>
|
||||
</view>
|
||||
|
||||
<!-- 有效期 -->
|
||||
<view class="validity-row">
|
||||
<view class="validity-label">有效期至:</view>
|
||||
<view class="validity-value">2025年11月23日 11:22:58</view>
|
||||
</view>
|
||||
|
||||
<!-- 规则说明区域 -->
|
||||
<view class="rule-row">
|
||||
<view class="rule-label">规则说明:</view>
|
||||
<view class="rule-content">本优惠券仅限指定商品 / 全店商品使用,单笔订单限用 1 张,不可与其他优惠叠加;请在有效期内使用,过期自动失效,不补发、不折现;订单退款时优惠券将按规则退回(过期则失效);严禁违规套现使用,本店保留最终解释权</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部固定按钮区域 -->
|
||||
<view class="bottom-fixed">
|
||||
<button class="use-btn" @click="handleUse">立即使用</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: '优惠券详情'
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleUse() {
|
||||
// 测试用
|
||||
console.log('立即使用按钮点击');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.coupon-detail-page {
|
||||
background-color: #f8f8f8;
|
||||
min-height: 100vh;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 160rpx;
|
||||
}
|
||||
|
||||
/* 顶部背景图*/
|
||||
.top-bg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 260rpx;
|
||||
background-image: url('https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/58ddd0be-e580-4da2-9f4f-4d088f32f11d.png');
|
||||
background-size: cover;
|
||||
background-position: top center;
|
||||
background-repeat: no-repeat;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* 主要内容区域 */
|
||||
.detail-content {
|
||||
padding: 20rpx 0;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
/* 优惠券卡片 */
|
||||
.coupon-card {
|
||||
background-color: #ffffff;
|
||||
border-radius: 40rpx;
|
||||
padding: 30rpx 30rpx 40rpx 30rpx;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.02);
|
||||
}
|
||||
|
||||
/* 标签行*/
|
||||
.tag-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.tag-new-user {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
line-height: 45rpx;
|
||||
text-align: left;
|
||||
|
||||
.tag-text {
|
||||
margin-top: 2rpx;
|
||||
}
|
||||
|
||||
.tag-icon {
|
||||
width: 42rpx;
|
||||
height: 42rpx;
|
||||
margin-right: 10rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* 下划线*/
|
||||
.title-underline {
|
||||
width: 690rpx;
|
||||
height: 1rpx;
|
||||
background-color: #F1F1F1 ;
|
||||
border-radius: 6rpx;
|
||||
margin: 20rpx 0 30rpx 0;
|
||||
}
|
||||
|
||||
/* 活动名称 + 有效期 */
|
||||
.info-row {
|
||||
display: flex;
|
||||
margin-bottom: 20rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
|
||||
.info-label {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
flex: 1;
|
||||
// margin-left: 27rpx;
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
/* 有效期行 */
|
||||
.validity-row {
|
||||
display: flex;
|
||||
margin-bottom: 20rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
|
||||
.validity-label {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.validity-value {
|
||||
flex: 1;
|
||||
// margin-left: 27rpx;
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
/* 规则说明行 */
|
||||
.rule-row {
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
|
||||
.rule-label {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.rule-content {
|
||||
flex: 1;
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
/* 底部固定按钮区域 */
|
||||
.bottom-fixed {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 141rpx;
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 -4rpx 12rpx rgba(0, 0, 0, 0.02);
|
||||
// 安全区适配
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
/* 立即使用按钮 */
|
||||
.use-btn {
|
||||
width: 690rpx;
|
||||
height: 88rpx;
|
||||
background: #e8101e;
|
||||
border-radius: 49rpx;
|
||||
color: #ffffff;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: none;
|
||||
margin: 0 auto;
|
||||
line-height: 88rpx;
|
||||
text-align: center;
|
||||
box-shadow: 0 8rpx 16rpx rgba(232, 16, 30, 0.15);
|
||||
z-index: 9;
|
||||
|
||||
&::after {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,98 +0,0 @@
|
|||
<template>
|
||||
<view class="coupon-list-page">
|
||||
<custom-navbar title="历史记录" :show-back="true" title-color="#333" background-color="#FFFFFF"
|
||||
:showHeadle="false"></custom-navbar>
|
||||
|
||||
<view class="list-content">
|
||||
<!-- 已过期 -->
|
||||
<CouponCard
|
||||
v-for="item in couponList"
|
||||
:key="item.id"
|
||||
:coupon="item"
|
||||
@action="handleCardAction"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CouponCard from './components/couponCard.vue';
|
||||
export default {
|
||||
components: { CouponCard },
|
||||
data() {
|
||||
return {
|
||||
// 模拟接口数据
|
||||
couponList: [
|
||||
{
|
||||
id: 1,
|
||||
amount: 20,
|
||||
condition: '满150元可用',
|
||||
platform: '平台',
|
||||
tag: '新人专享券',
|
||||
expiry: '有效期至2025.08.21 10:10',
|
||||
status: 'expired' // 已过期
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
amount: 40,
|
||||
condition: '满380元可用',
|
||||
platform: '平台',
|
||||
tag: '新人专享券',
|
||||
expiry: '有效期至2025.08.21 10:10',
|
||||
status: 'used' // 已使用
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
amount: 330,
|
||||
condition: '满5650元可用',
|
||||
platform: '平台',
|
||||
tag: '新人专享券',
|
||||
expiry: '有效期至2025.08.21 10:10',
|
||||
status: 'expired', // 立即领取
|
||||
isNew: false, // 显示新获取图标
|
||||
isExpiringSoon: false // 不显示快过期图标
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
amount: 20,
|
||||
condition: '满120元可用',
|
||||
platform: '平台',
|
||||
tag: '新人专享券',
|
||||
expiry: '有效期至2025.08.21 10:10',
|
||||
status: 'expired', // 立即使用
|
||||
isNew: false, // 不显示新获取图标
|
||||
isExpiringSoon: true // 显示快过期图标
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleCardAction(status) {
|
||||
if (status === 'receive') {
|
||||
console.log('领取优惠券');
|
||||
// 调用领取接口
|
||||
} else if (status === 'use') {
|
||||
console.log('使用优惠券');
|
||||
// 跳转使用页面
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/* 页面整体容器 */
|
||||
.coupon-list-page {
|
||||
background-color: #f8f8f8;
|
||||
min-height: 100vh;
|
||||
padding: 20rpx 30rpx 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 卡片列表区域 */
|
||||
.list-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,552 +0,0 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<!-- 顶部渐变背景(作为固定区域的背景) -->
|
||||
<view class="fixed-top-bg"></view>
|
||||
|
||||
<!-- 固定在顶部的区域:导航栏 + 标签栏 -->
|
||||
<view class="fixed-top-container">
|
||||
<!-- 导航栏 -->
|
||||
<view class="nav-bar">
|
||||
<view class="nav-bar-l" @click="goBack">
|
||||
<image class="nav-bar-l-img"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/a52cd5ad-a26f-4426-ad59-e2d481fe0e92.png"
|
||||
mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="nav-bar-c">
|
||||
<view class="nav-bar-c-text">我的优惠券</view>
|
||||
</view>
|
||||
<view class="nav-bar-r">
|
||||
<view class="nav-bar-r-text" @click="gotoCouponHistory()">历史记录</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="coupon-title">
|
||||
<view class="coupon-tab" @click="selectd(0)">
|
||||
<view class="coupon-tab-text" :class="{ active: isselect === 0 }">全部优惠券</view>
|
||||
<image class="tab-line-img" v-if="isselect === 0"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/b304a532-2c5d-467b-b7f7-f30f58cdc7ec.png">
|
||||
</image>
|
||||
</view>
|
||||
<view class="coupon-tab" @click="selectd(1)">
|
||||
<view class="coupon-tab-text" :class="{ active: isselect === 1 }">即将到期</view>
|
||||
<image class="tab-line-img" v-if="isselect === 1"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/b304a532-2c5d-467b-b7f7-f30f58cdc7ec.png">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="list-coupon-container">
|
||||
<!-- 已领取的优惠券 -->
|
||||
<view class="list-coupon" v-if="isselectd && !timesout">
|
||||
<!-- 已领取标题 -->
|
||||
<view class="collectd-title">
|
||||
<image class="collectd-title-icon"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/71c747be-b80c-496e-aeab-821a7dddcfc2.png"
|
||||
mode="widthFix"></image>
|
||||
<view class="collectd-title-text">已领取的优惠券</view>
|
||||
</view>
|
||||
|
||||
<!-- 空状态提示 -->
|
||||
<view v-if="filterCollectedList.length === 0" class="empty-tip">
|
||||
<view class="empty-text">暂无已领取的优惠券</view>
|
||||
</view>
|
||||
|
||||
<!-- 已领取优惠券卡片列表(使用组件) -->
|
||||
<CouponCard v-for="(item, index) in showCollectedList" :key="'collected-' + index" :coupon="item"
|
||||
@action="(status) => handleAvailableAction(status, item)" />
|
||||
|
||||
<!-- 展开/收起按钮(仅已领取优惠券使用) -->
|
||||
<view v-if="filterCollectedList.length > 4" class="expand-btn" @click="toggleExpand">
|
||||
<view class="expand-text">{{ isExpanded ? '收起全部' : '展开全部' }}</view>
|
||||
<image class="expand-icon"
|
||||
:src="isExpanded ? 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/fe418cfb-99c5-43ca-8ffd-5c656fb1cd06.png' : 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/169e99f5-8181-43d9-b290-f0526690ff83.png'"
|
||||
mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 更多可领优惠券(无展开/收起) -->
|
||||
<view class="list-coupon" v-if="!timesout">
|
||||
<!-- 可领取标题 -->
|
||||
<view class="collectd-title">
|
||||
<image class="collectd-title-icon"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/71c747be-b80c-496e-aeab-821a7dddcfc2.png"
|
||||
mode="widthFix"></image>
|
||||
<view class="collectd-title-text">更多可领优惠券</view>
|
||||
</view>
|
||||
|
||||
<!-- 空状态提示 -->
|
||||
<view v-if="availableCouponList.length === 0" class="empty-tip">
|
||||
<view class="empty-text">暂无可领取的优惠券</view>
|
||||
</view>
|
||||
|
||||
<!-- 可领取优惠券卡片列表(使用组件) -->
|
||||
<CouponCard v-for="(item, index) in formattedAvailableList" :key="'available-' + index" :coupon="item"
|
||||
@action="(status) => handleAvailableAction(status, item)" />
|
||||
</view>
|
||||
<view class="no-data" v-if="collectedCouponList.length<0">
|
||||
<image class="no-data-img"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/035b7613-338b-4a71-9975-291cec794f89.png"
|
||||
mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="daoqi" v-if="isselect==1">
|
||||
<CouponCard class="daoqi-list" v-for="(item, index) in formattedAvailableLis"
|
||||
:key="'available-' + index" :coupon="item"
|
||||
@action="(status) => handleAvailableAction(status, item)" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CouponCard from './components/couponCard.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
CouponCard
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
timesout: false,
|
||||
statusBarHeight: 0,
|
||||
isselectd: true,
|
||||
isselect: 0, // 默认选中全部优惠券
|
||||
isExpanded: false, // 已领取优惠券是否展开
|
||||
// 已领取优惠券列表
|
||||
collectedCouponList: [{
|
||||
denomination: 20,
|
||||
condition: '满150元可用',
|
||||
name: '平台|新人专享券',
|
||||
expireTime: '有效期至2025.08.21 10:10',
|
||||
tagType: 'new',
|
||||
status: 'available'
|
||||
},
|
||||
{
|
||||
denomination: 45,
|
||||
condition: '满300元可用',
|
||||
name: '平台|新人专享券',
|
||||
expireTime: '有效期至2025.08.21 10:10',
|
||||
tagType: 'new',
|
||||
status: 'available'
|
||||
},
|
||||
{
|
||||
denomination: 330,
|
||||
condition: '满5650元可用',
|
||||
name: '平台|新人专享券',
|
||||
expireTime: '有效期至2025.08.21 10:10',
|
||||
tagType: 'soon',
|
||||
status: 'available'
|
||||
},
|
||||
{
|
||||
denomination: 20,
|
||||
condition: '满150元可用',
|
||||
name: '平台|新人专享券',
|
||||
expireTime: '有效期至2025.04.21 23:10',
|
||||
tagType: 'expire',
|
||||
status: 'available'
|
||||
},
|
||||
{
|
||||
denomination: 10,
|
||||
condition: '满99元可用',
|
||||
name: '平台|满减券',
|
||||
expireTime: '有效期至2025.09.10 23:59',
|
||||
tagType: 'new',
|
||||
status: 'available'
|
||||
},
|
||||
{
|
||||
denomination: 50,
|
||||
condition: '满500元可用',
|
||||
name: '平台|满减券',
|
||||
expireTime: '有效期至2025.08.30 12:00',
|
||||
tagType: 'new',
|
||||
status: 'available'
|
||||
}
|
||||
],
|
||||
// 更多可领优惠券列表
|
||||
availableCouponList: [{
|
||||
denomination: 20,
|
||||
condition: '满150元可用',
|
||||
name: '平台|新人专享券',
|
||||
expireTime: '有效期至2025.08.21 10:10',
|
||||
tagType: 'new' // 用于图标
|
||||
},
|
||||
{
|
||||
denomination: 330,
|
||||
condition: '满5650元可用',
|
||||
name: '平台|新人专享券',
|
||||
expireTime: '有效期至2025.08.21 10:10',
|
||||
tagType: 'new'
|
||||
},
|
||||
{
|
||||
denomination: 888,
|
||||
condition: '满9999元可用',
|
||||
name: '平台|新人专享券',
|
||||
expireTime: '有效期至2025.08.21 10:10',
|
||||
tagType: 'new'
|
||||
}
|
||||
],
|
||||
timeoutdatalist: [{
|
||||
denomination: 20,
|
||||
condition: '满150元可用',
|
||||
name: '平台|新人专享券',
|
||||
expireTime: '还剩09:59:59过期',
|
||||
tagType: 'new' // 用于图标
|
||||
},
|
||||
{
|
||||
denomination: 20,
|
||||
condition: '满150元可用',
|
||||
name: '平台|新人专享券',
|
||||
expireTime: '还剩09:59:59过期',
|
||||
tagType: 'new' // 用于图标
|
||||
},
|
||||
{
|
||||
denomination: 20,
|
||||
condition: '满150元可用',
|
||||
name: '平台|新人专享券',
|
||||
expireTime: '还剩09:59:59过期',
|
||||
tagType: 'expired' // 用于图标
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 已领取优惠券筛选后列表(根据标签)
|
||||
filterCollectedList() {
|
||||
if (this.isselect === 0) {
|
||||
return this.collectedCouponList
|
||||
} else {
|
||||
// 即将到期逻辑交由后端处理,这里暂时返回空(可根据后端返回字段调整)
|
||||
return []
|
||||
}
|
||||
},
|
||||
// 已领取优惠券实际展示列表:默认前4个,展开后显示全部
|
||||
showCollectedList() {
|
||||
const list = this.filterCollectedList
|
||||
const rawList = this.isExpanded ? list : list.slice(0, 4)
|
||||
// 映射为组件所需格式
|
||||
return rawList.map(item => this.formatCollectedCoupon(item))
|
||||
},
|
||||
// 可领取列表映射为组件格式
|
||||
formattedAvailableList() {
|
||||
return this.availableCouponList.map(item => this.formatAvailableCoupon(item))
|
||||
},
|
||||
formattedAvailableLis() {
|
||||
return this.timeoutdatalist.map(item => this.formatAvailableCoupon(item))
|
||||
},
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 将已领取优惠券原始数据转换为组件 coupon 对象
|
||||
formatCollectedCoupon(item) {
|
||||
const [platform, tag] = item.name.split('|')
|
||||
let status = ''
|
||||
if (item.status === 'available') status = 'use'
|
||||
else if (item.status === 'expired') status = 'expired'
|
||||
else if (item.status === 'used') status = 'used'
|
||||
else status = 'use' // 默认
|
||||
|
||||
return {
|
||||
amount: item.denomination,
|
||||
condition: item.condition,
|
||||
platform: platform || '平台',
|
||||
tag: tag || '优惠券',
|
||||
expiry: item.expireTime,
|
||||
status: status,
|
||||
isNew: item.tagType === 'new',
|
||||
isExpiringSoon: item.tagType === 'soon' || item.tagType === 'expire'
|
||||
}
|
||||
},
|
||||
// 将可领取优惠券原始数据转换为组件 coupon 对象
|
||||
formatAvailableCoupon(item) {
|
||||
const [platform, tag] = item.name.split('|')
|
||||
return {
|
||||
amount: item.denomination,
|
||||
condition: item.condition,
|
||||
platform: platform || '平台',
|
||||
tag: tag || '优惠券',
|
||||
expiry: item.expireTime,
|
||||
status: 'receive', // 可领取
|
||||
isNew: item.tagType === 'new', // 根据需要设置,默认 true 也可以
|
||||
isExpiringSoon: false
|
||||
}
|
||||
},
|
||||
// 处理已领取卡片的点击(立即使用/已过期/已使用)
|
||||
handleAvailableAction(status, clickedItem) {
|
||||
if (status === 'receive') {
|
||||
console.log('领取优惠券', clickedItem);
|
||||
uni.showToast({
|
||||
title: '领取成功',
|
||||
icon: 'success'
|
||||
});
|
||||
const originItem = this.availableCouponList.find(item =>
|
||||
item.denomination === clickedItem.amount &&
|
||||
item.condition === clickedItem.condition &&
|
||||
item.name === `${clickedItem.platform}|${clickedItem.tag}`
|
||||
);
|
||||
|
||||
if (originItem) {
|
||||
const index = this.availableCouponList.indexOf(originItem);
|
||||
this.availableCouponList.splice(index, 1);
|
||||
this.collectedCouponList.unshift({
|
||||
...originItem,
|
||||
tagType: 'new', // 标记为新领取
|
||||
status: 'available'
|
||||
});
|
||||
}
|
||||
} else if (status === 'use') {
|
||||
console.log('使用优惠券', clickedItem);
|
||||
uni.navigateTo({
|
||||
url: '/pages/coupon/couponDetail'
|
||||
});
|
||||
}
|
||||
},
|
||||
toggleExpand() {
|
||||
this.isExpanded = !this.isExpanded
|
||||
},
|
||||
selectd(i) {
|
||||
this.isselect = i
|
||||
console.log(this.isselect, '选中项');
|
||||
// 切换标签时重置为收起状态
|
||||
// this.isExpanded = false
|
||||
// this.isselectd=false
|
||||
if (i == 1) {
|
||||
this.timesout = true
|
||||
} else {
|
||||
this.timesout = false
|
||||
}
|
||||
},
|
||||
gotoCouponHistory() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/coupon/couponHistory',
|
||||
fail(err) {
|
||||
console.error('跳转失败', err)
|
||||
}
|
||||
})
|
||||
},
|
||||
goBack() {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
// 移除定时器启动逻辑
|
||||
},
|
||||
onUnload() {},
|
||||
onHide() {
|
||||
// 移除定时器暂停逻辑
|
||||
},
|
||||
onShow() {
|
||||
const systemInfo = uni.getWindowInfo()
|
||||
const statusBarHeight = systemInfo.statusBarHeight;
|
||||
this.statusBarHeight = statusBarHeight
|
||||
console.log('刘海/状态栏高度:', statusBarHeight + 'px');
|
||||
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.nav-bar-l {
|
||||
margin-top: 200rpx;
|
||||
}
|
||||
|
||||
/* 全局容器 */
|
||||
.content {
|
||||
position: relative;
|
||||
width: 750rpx;
|
||||
min-height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
/* 预留固定区域高度,避免内容被遮挡 */
|
||||
padding-top: 200rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 固定区域的渐变背景(和原背景样式一致) */
|
||||
.fixed-top-bg {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 99;
|
||||
width: 750rpx;
|
||||
height: 260rpx;
|
||||
background: linear-gradient(180deg, #FFEAE6 0%, #FFFBF9 100%);
|
||||
}
|
||||
|
||||
/* 固定在顶部的容器:导航栏+标签栏 */
|
||||
.fixed-top-container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 100;
|
||||
width: 750rpx;
|
||||
height: 200rpx;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 导航栏样式 */
|
||||
.nav-bar {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
padding-top: 60rpx;
|
||||
/* 适配状态栏高度 */
|
||||
height: 140rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.nav-bar-l-img {
|
||||
width: 18rpx;
|
||||
height: 35.74rpx;
|
||||
}
|
||||
|
||||
.nav-bar-c {
|
||||
margin-left: 24rpx;
|
||||
margin-bottom: 5rpx;
|
||||
}
|
||||
|
||||
.nav-bar-c-text {
|
||||
font-family: AlimamaShuHeiTi, AlimamaShuHeiTi;
|
||||
font-weight: bold;
|
||||
font-size: 40rpx;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.nav-bar-r {
|
||||
margin-left: auto;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.nav-bar-r-text {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-size: 30rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.list-coupon .coupon-card {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
/* 标签栏样式 */
|
||||
.coupon-title {
|
||||
display: flex;
|
||||
height: 60rpx;
|
||||
align-items: center;
|
||||
margin-top: 37rpx;
|
||||
}
|
||||
|
||||
.coupon-tab {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
|
||||
.coupon-tab-text {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-size: 30rpx;
|
||||
color: #666666;
|
||||
margin-bottom: 8rpx;
|
||||
width: 150rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.coupon-tab-text.active {
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.tab-line-img {
|
||||
width: 53rpx;
|
||||
height: 6rpx;
|
||||
}
|
||||
|
||||
/* 优惠券列表外层容器 */
|
||||
.list-coupon-container {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
margin-top: 50rpx;
|
||||
}
|
||||
|
||||
/* 优惠券列表容器(复用样式) */
|
||||
.list-coupon {
|
||||
width: 750rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 40rpx;
|
||||
margin-bottom: 10rpx;
|
||||
margin-top: 10rpx;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 空状态样式 */
|
||||
.empty-tip {
|
||||
text-align: center;
|
||||
padding: 60rpx 0;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
/* 标题样式 */
|
||||
.collectd-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.collectd-title-icon {
|
||||
width: 41rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.collectd-title-text {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
/* 展开/收起按钮 */
|
||||
.expand-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0 auto;
|
||||
padding: 12rpx 45rpx 12rpx 20rpx;
|
||||
border: 1rpx solid #eee;
|
||||
border-radius: 40rpx;
|
||||
width: 161rpx;
|
||||
}
|
||||
|
||||
.expand-text {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.expand-icon {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
|
||||
.no-data-img {
|
||||
width: 430rpx;
|
||||
margin: 299rpx 0 0 160rpx;
|
||||
}
|
||||
|
||||
.daoqi {
|
||||
margin: 80rpx 0 0rpx 30rpx;
|
||||
}
|
||||
|
||||
.daoqi-list {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,280 +0,0 @@
|
|||
<template>
|
||||
<view class="list-card" @click="$emit('goDetail', info)">
|
||||
<image
|
||||
:mode="`aspectFill`"
|
||||
:src="info.photo[0]"
|
||||
class="list-card-img"
|
||||
></image>
|
||||
<view class="list-card-right">
|
||||
<view class="list-card-right-top">
|
||||
<view style="display: flex; align-items: center">
|
||||
<text class="list-card-right-top__num"
|
||||
>{{ info.person_num }}人团</text
|
||||
>
|
||||
<view class="list-card-right-top__title white-space-nowrap">{{
|
||||
info.title
|
||||
}}</view>
|
||||
</view>
|
||||
|
||||
<text class="list-card-right-top__distance">
|
||||
<image
|
||||
class="list-card-right-top_image"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/e37b3bd7-841f-4d57-a11a-2365c81f740e"
|
||||
/>
|
||||
<text style="color: #333">{{ this.getDistance }}</text></text
|
||||
>
|
||||
</view>
|
||||
<view class="list-card-right-bottom">
|
||||
<view class="list-card-right-bottom__box"
|
||||
>立省{{
|
||||
formatPriceNumber(this.info.server_price - this.info.price)
|
||||
}}元</view
|
||||
>
|
||||
<view class="list-card-right-bottom__left">
|
||||
<view class="list-card-right-bottom__left__price"
|
||||
>拼团价 ¥
|
||||
<text style="font-size: 34rpx">{{ `${info.price}` }}</text>
|
||||
</view>
|
||||
<view class="list-card-right-bottom__left__price2"
|
||||
>原价 ¥{{ ` ${info.server_price}` }}
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="list-card-right-bottom__right"
|
||||
|
||||
>
|
||||
速抢
|
||||
<image
|
||||
:mode="`aspectFill`"
|
||||
src="@/static/images/shop/pintuan/whiteRight.png"
|
||||
class="list-card-right-bottom__right__icon"
|
||||
></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "listCard",
|
||||
props: {
|
||||
info: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {
|
||||
getDistance() {
|
||||
if (this.info.distance) {
|
||||
if (this.info.distance <= 1) {
|
||||
return ` ${(this.info.distance * 1000).toFixed(2)}m`;
|
||||
} else {
|
||||
return ` ${this.info.distance.toFixed(0)}km`;
|
||||
}
|
||||
} else {
|
||||
return ` 0m`;
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.list-card {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
padding: 20rpx 25rpx 20rpx 20rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.list-card-img {
|
||||
width: 172rpx;
|
||||
height: 172rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.list-card-right {
|
||||
flex: 1;
|
||||
margin-left: 30rpx;
|
||||
height: 172rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
.list-card-right-top {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
&__num {
|
||||
padding: 0 6rpx;
|
||||
background: linear-gradient(166deg, #FC5E72 0%, #E8101E 100%);
|
||||
border-radius: 6rpx;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-right: 10rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&__title {
|
||||
font-weight: 500;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
width: 205rpx;
|
||||
}
|
||||
|
||||
&__distance {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.list-card-right-bottom {
|
||||
background-image: url("@/static/images/shop/pintuan/bj2.png");
|
||||
background-size: cover;
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
width: 443rpx;
|
||||
height: 83rpx;
|
||||
border-radius: 10rpx;
|
||||
position: relative;
|
||||
|
||||
&__box {
|
||||
position: absolute;
|
||||
left: 0rpx;
|
||||
top: -6rpx;
|
||||
transform: translateY(-100%);
|
||||
padding: 0 10rpx;
|
||||
height: 28rpx;
|
||||
background: rgba(249, 67, 96, 0.1);
|
||||
border: 2rpx solid #e8101e;
|
||||
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #e8101e;
|
||||
line-height: 28rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
border-radius: 8rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* 外层伪元素:生成「边框三角」(比内层大,颜色为边框色) */
|
||||
&__box::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: -8rpx;
|
||||
/* 比内层低1rpx(与边框粗细对应) */
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
/* 水平居中 */
|
||||
pointer-events: none;
|
||||
/* 避免遮挡点击 */
|
||||
|
||||
/* 边框三角尺寸:比内层三角大1rpx(左右各宽1rpx,高度高1rpx) */
|
||||
border-width: 8rpx 6rpx 0;
|
||||
/* 上边框=三角高度(比内层多1rpx),左右边框=三角宽度(比内层多1rpx) */
|
||||
border-style: solid;
|
||||
border-top-color: #e8101e;
|
||||
/* 三角的边框色(自己改想要的颜色) */
|
||||
border-left-color: transparent;
|
||||
border-right-color: transparent;
|
||||
border-bottom-color: transparent;
|
||||
}
|
||||
|
||||
/* 内层伪元素:原填充色三角(覆盖在外层上,露出边框) */
|
||||
&__box::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: -4rpx;
|
||||
/* 比外层高1rpx,确保覆盖 */
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
pointer-events: none;
|
||||
|
||||
/* 原三角样式不变,仅定位与外层错开 */
|
||||
border-width: 6rpx 4rpx 0;
|
||||
/* 原尺寸:高度10rpx,宽度8rpx(左右) */
|
||||
border-style: solid;
|
||||
border-top-color: #ffe6eb;
|
||||
border-left-color: transparent;
|
||||
border-right-color: transparent;
|
||||
border-bottom-color: transparent;
|
||||
}
|
||||
|
||||
&__left {
|
||||
position: absolute;
|
||||
left: 30rpx;
|
||||
top: 13rpx;
|
||||
|
||||
&__price {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #e8101e;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
&__price2 {
|
||||
margin-top: 3rpx;
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: rgba(252, 67, 124, 0.57);
|
||||
line-height: 28rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
&__right {
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-weight: 500;
|
||||
font-size: 30rpx;
|
||||
color: #ffffff;
|
||||
line-height: 42rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
|
||||
&__icon {
|
||||
width: 8rpx;
|
||||
height: 16rpx;
|
||||
margin-left: 9rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.list-card-right-top_image{
|
||||
width: 20rpx;
|
||||
height: 22rpx;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,157 +0,0 @@
|
|||
<template>
|
||||
<view class="pintuan">
|
||||
<custom-navbar title="拼团" :show-back="true" :showUser="false" titleColor="#000">
|
||||
</custom-navbar>
|
||||
<view class="pintuan-footer">
|
||||
<image class="pintuan-footer-img" src="@/static/images/shop/pintuan/bj.png"></image>
|
||||
<view class="pintuan-footer-search">
|
||||
<text class="pintuan-footer-search__text">多人团</text>
|
||||
<uv-search placeholder="搜索服务" v-model="title" :color="'rgba(204, 204, 204, 1)'" :showAction="false"
|
||||
:bgColor="`#ffffff`" :height="'70rpx'" :boxStyle="{ width: `534rpx` }" @clickIcon="search"
|
||||
@clear="search" @search="search" searchIcon="/static/home/search.png"></uv-search>
|
||||
</view>
|
||||
</view>
|
||||
<CommonList ref="groupRef" :apiUrl="'/user/teamBuy/list'"
|
||||
:listScrollHeight="`calc(100vh - ${statusBarHeight * 2 + 399}rpx)`">
|
||||
<template #listData="{ list }">
|
||||
<view class="list-item">
|
||||
<listCard :info="item" @goDetail="goDetail" v-for="(item, index) in list" :key="index"></listCard>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<!-- 空数据状态 -->
|
||||
<template #empty>
|
||||
<noData></noData>
|
||||
</template>
|
||||
</CommonList>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import listCard from "./components/listCard.vue";
|
||||
import CommonList from "@/components/common/CommonList.vue";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: "",
|
||||
statusBarHeight: 0,
|
||||
listQuery: {
|
||||
userLngz: "",
|
||||
userLat: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
this.statusBarHeight = systemInfo.statusBarHeight;
|
||||
let userAdrees = uni.getStorageSync("userAdrees");
|
||||
if (userAdrees) {
|
||||
this.listQuery.userLngz = userAdrees.longitude;
|
||||
this.listQuery.userLat = userAdrees.latitude;
|
||||
} else {
|
||||
this.listQuery.userLngz = "117.330043";
|
||||
this.listQuery.userLat = "38.372266";
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.search();
|
||||
});
|
||||
},
|
||||
|
||||
components: {
|
||||
CommonList,
|
||||
listCard
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.listQuery.title = this.title;
|
||||
// 触发列表刷新
|
||||
this.$refs.groupRef.manualRefresh(this.listQuery);
|
||||
},
|
||||
goDetail(e) {
|
||||
console.log()
|
||||
uni.navigateTo({
|
||||
url: `/pages/groupBuy/detail?id=${e.server_id}`,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep .uv-icon__img {
|
||||
width: 34rpx !important;
|
||||
height: 34rpx !important;
|
||||
}
|
||||
|
||||
::v-deep .uni-input-placeholder {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #CCCCCC !important;
|
||||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.pintuan {
|
||||
width: 750rpx;
|
||||
background: #f5f5f5;
|
||||
|
||||
.pintuan-footer {
|
||||
width: 750rpx;
|
||||
height: 330rpx;
|
||||
position: relative;
|
||||
|
||||
.pintuan-footer-img {
|
||||
width: 750rpx;
|
||||
height: 330rpx;
|
||||
}
|
||||
|
||||
.pintuan-footer-search {
|
||||
height: 70rpx;
|
||||
position: absolute;
|
||||
top: 30rpx;
|
||||
left: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.pintuan-footer-search__text {
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #ffffff;
|
||||
line-height: 45rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-right: 32rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.common-list {
|
||||
padding-bottom: 0rpx;
|
||||
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0rpx;
|
||||
border-radius: 20rpx 20rpx 0rpx 0rpx;
|
||||
background: linear-gradient(180deg, #ffebf0 0%, #f8f8f8 100%);
|
||||
|
||||
::v-deep .list-scroll {
|
||||
.uni-scroll-view-content {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
.list-container {
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.list-item {
|
||||
padding: 0;
|
||||
background-color: transparent;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 20rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,832 +0,0 @@
|
|||
<template>
|
||||
<view class="submit-order">
|
||||
<!-- 自定义导航栏 -->
|
||||
<custom-navbar
|
||||
title="提交订单"
|
||||
:showBack="true"
|
||||
backgroundColor="#FFFFFF"
|
||||
></custom-navbar>
|
||||
|
||||
|
||||
|
||||
<!-- 预约服务 -->
|
||||
<view class="service-section">
|
||||
<view class="section-title">
|
||||
<view class="icon"></view>
|
||||
<text class="section-lable">预约服务</text>
|
||||
</view>
|
||||
<view class="service-item" @click="goToDetail(service.id)">
|
||||
<image
|
||||
class="service-image"
|
||||
v-if="service.photo && service.photo.length != 0"
|
||||
:src="service.photo[0]"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
<view class="service-info">
|
||||
<text class="service-name text-overflow">{{ service.title }}</text>
|
||||
<view class="service-count">
|
||||
<text class="count-lable">服务数量</text>
|
||||
<text class="count-num">x1</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="price-info">
|
||||
<text class="price-label">原始价格:</text>
|
||||
<text class="price-value">¥{{ service.server_price }}</text>
|
||||
</view>
|
||||
<view class="price-info" v-if="!isOriginalPrice">
|
||||
<text class="price-label" >拼团价格:</text>
|
||||
<text class="price-value">¥{{ service.team_buy.price }}</text>
|
||||
</view>
|
||||
<view class="total-price">
|
||||
<text class="total-label">订单小计:</text>
|
||||
<text class="total-value">¥{{ isOriginalPrice?service.server_price:service.team_buy.price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 底部结算栏 -->
|
||||
<view class="footer">
|
||||
<view class="price-total">
|
||||
<text class="price">¥{{ isOriginalPrice?service.server_price:service.team_buy.price }}</text>
|
||||
<text class="amount-lable">订单小计</text>
|
||||
</view>
|
||||
<view class="submit-btn" @click="submitOrder">提交订单</view>
|
||||
</view>
|
||||
|
||||
<!-- 时间选择弹框 -->
|
||||
<select-time-page
|
||||
ref="selecTime"
|
||||
:timeOptions="timeOptions"
|
||||
:service="service"
|
||||
@sureTime="sureTime"
|
||||
@closeTime="closeTime"
|
||||
></select-time-page>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import selectTimePage from "../../components/select-time-page/select-time-page.vue";
|
||||
import customNavbar from "@/components/custom-navbar/custom-navbar.vue";
|
||||
import { debounce } from "../../utils/debounce";
|
||||
import request from "@/utils/request";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
customNavbar,
|
||||
selectTimePage,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isOriginalPrice:false,//是否是原价
|
||||
serviceTimeNum:3,
|
||||
serviceId: "",
|
||||
syrorsjInfo: {}, // 手艺人或商家信息
|
||||
// 地址信息
|
||||
reservation_address: {},
|
||||
s1: "",
|
||||
s2: "",
|
||||
s3: "",
|
||||
selected_date: "",
|
||||
selected_time: "",
|
||||
server_kind:null,
|
||||
// 时间信息
|
||||
selectedTime: null,
|
||||
dateList: ["今天", "明天", "后天"],
|
||||
timeOptions: [],
|
||||
selectedDateIndex: 0,
|
||||
selectedTimeIndex: 0,
|
||||
sureTimeDataIndex: 0,
|
||||
showTimePicker: false,
|
||||
// 服务信息
|
||||
service: {
|
||||
photo: [],
|
||||
server_kind: "",
|
||||
title: "",
|
||||
server_price: "",
|
||||
team_buy:{
|
||||
price: "",
|
||||
}
|
||||
},
|
||||
// 备注
|
||||
remark: "",
|
||||
// 订单信息
|
||||
orderInfo: {
|
||||
originalPrice: 0.01,
|
||||
totalPrice: 0.01,
|
||||
},
|
||||
isSubmit: false,
|
||||
// 状态映射配置
|
||||
stateConfig: {
|
||||
1: {
|
||||
class: "state-available",
|
||||
text: "可约",
|
||||
},
|
||||
2: {
|
||||
class: "state-full",
|
||||
text: "约满",
|
||||
},
|
||||
3: {
|
||||
class: "state-rest",
|
||||
text: "休息",
|
||||
},
|
||||
4: {
|
||||
class: "state-locked",
|
||||
text: "锁定",
|
||||
},
|
||||
5: {
|
||||
class: "state-unavailable",
|
||||
text: "不可用",
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
async onLoad(options) {
|
||||
if(options.isOriginalPrice){
|
||||
this.isOriginalPrice = options.isOriginalPrice=="1"?true:false
|
||||
}
|
||||
try {
|
||||
if (options.id) {
|
||||
this.name = options.name;
|
||||
// 获取服务详情
|
||||
const serverdetail = await request.post("/user/serverdetail", {
|
||||
id: options.id,
|
||||
});
|
||||
if (serverdetail.state === 1) {
|
||||
this.service = serverdetail.data;
|
||||
if (this.service.server_time) {
|
||||
this.serviceTimeNum = Math.ceil(this.service.server_time / 10);
|
||||
}
|
||||
|
||||
let url;
|
||||
this.server_kind = serverdetail.data.server_kind
|
||||
if (serverdetail.data.server_kind == 1) {
|
||||
url = "/user/syrdetail";
|
||||
} else if (serverdetail.data.server_kind == 2) {
|
||||
url = "/user/sjdetail";
|
||||
}
|
||||
const syrorsjInfo = await request.post(url, {
|
||||
id: serverdetail.data.publish_user_id,
|
||||
});
|
||||
this.syrorsjInfo = syrorsjInfo.data;
|
||||
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.log("报错", err);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 列表项的class获取方法
|
||||
getItemClass(state) {
|
||||
return this.stateConfig[state]?.class || "state-unknown";
|
||||
},
|
||||
|
||||
// 提交订单
|
||||
submitOrder: debounce(async function () {
|
||||
|
||||
if(this.selected_time.length == 0 && this.server_kind == 1){
|
||||
uni.showToast({
|
||||
title: `请选择时间`,
|
||||
icon: "none",
|
||||
});
|
||||
return
|
||||
}
|
||||
if (this.isSubmit) return;
|
||||
try {
|
||||
// 判断当前时间是否可用
|
||||
// const timeavailable = request.post('/user/servertimeavailable');
|
||||
uni.showLoading({
|
||||
title: "提交中...",
|
||||
});
|
||||
let orderData = {};
|
||||
if (this.service.server_kind == 1) {
|
||||
if (!this.reservation_address_id) {
|
||||
uni.showToast({
|
||||
title: "请选择到家地址",
|
||||
icon: "none",
|
||||
});
|
||||
return;
|
||||
}
|
||||
orderData = {
|
||||
server_id: this.service.id, // 测试ID
|
||||
server_title: this.service.title, // 测试ID
|
||||
server_type_first_id: this.service.first_class_id, // 测试ID
|
||||
server_type_secod_id: this.service.second_class_id, // 测试ID
|
||||
order_kind: this.service.server_kind, // 测试ID
|
||||
order_type: 1, // 测试ID
|
||||
order_money: this.service.server_price, // 测试ID
|
||||
reservation_time: `${this.selected_date} ${this.selected_time}:00`,
|
||||
reservation_address_id: this.reservation_address_id,
|
||||
remark: this.remark,
|
||||
};
|
||||
} else {
|
||||
|
||||
orderData = {
|
||||
server_id: this.service.id, // 测试ID
|
||||
server_title: this.service.title, // 测试ID
|
||||
server_type_first_id: this.service.first_class_id, // 测试ID
|
||||
server_type_secod_id: this.service.second_class_id, // 测试ID
|
||||
order_kind: this.service.server_kind, // 测试ID
|
||||
order_type: 1, // 测试ID
|
||||
order_money: this.isOriginalPrice?this.service.server_price:this.service.team_buy.price, // 测试ID
|
||||
remark: this.remark,
|
||||
};
|
||||
if(!this.isOriginalPrice){
|
||||
orderData.team_buy_id = this.service.team_buy.id
|
||||
}
|
||||
}
|
||||
|
||||
const res = await request.post("/user/creatorder", orderData);
|
||||
|
||||
uni.hideLoading();
|
||||
|
||||
if (res.state === 1) {
|
||||
uni.showToast({
|
||||
title: "提交成功",
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
});
|
||||
|
||||
this.isSubmit = true;
|
||||
setTimeout(() => {
|
||||
let price = this.isOriginalPrice?this.service.server_price:this.service.team_buy.price
|
||||
uni.redirectTo({
|
||||
url: `/pages/order/pay?id=${res.data.id}&money=${price}&title=${this.service.title}&number=${res.data.number}`,
|
||||
});
|
||||
}, 500);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg || "提交失败",
|
||||
icon: "none",
|
||||
});
|
||||
this.isSubmit = false;
|
||||
}
|
||||
} catch (error) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: "提交失败,请重试",
|
||||
icon: "none",
|
||||
});
|
||||
console.error("提交订单失败:", error);
|
||||
this.isSubmit = false;
|
||||
}
|
||||
}, 500),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.submit-order {
|
||||
padding-bottom: calc(120rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
/* 地址信息 */
|
||||
.address-section {
|
||||
background-color: #ffffff;
|
||||
padding: 32rpx 24rpx;
|
||||
margin: 32rpx 24rpx 0;
|
||||
border-radius: 16rpx;
|
||||
box-shadow: 0 4rpx 16rpx 0 rgba(210, 213, 224, 0.5);
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.address-choice,
|
||||
.address-info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.positon-icon {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
|
||||
.user-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 32rpx;
|
||||
color: #3d3d3d;
|
||||
font-weight: 500;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
|
||||
.phone {
|
||||
font-size: 32rpx;
|
||||
color: #3d3d3d;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.address {
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.section-cont {
|
||||
margin: 24rpx 24rpx 0;
|
||||
padding: 0 24rpx;
|
||||
border-radius: 16rpx;
|
||||
box-shadow: 0 4rpx 16rpx 0 rgba(210, 213, 224, 0.5);
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
/* 时间选择 */
|
||||
.time-section {
|
||||
padding: 32rpx 0;
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1rpx solid rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.time-label {
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.time-value {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
/* 师傅信息 */
|
||||
.master-section {
|
||||
padding: 32rpx 0;
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.master-name {
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.master-info {
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
/* 预约服务 */
|
||||
.service-section {
|
||||
background-color: #ffffff;
|
||||
padding: 0 24rpx;
|
||||
margin: 24rpx 24rpx 0;
|
||||
box-shadow: 0 4rpx 16rpx 0 rgba(210, 213, 224, 0.5);
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
padding: 24rpx 0;
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
border-bottom: 1rpx solid rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 6rpx;
|
||||
height: 28rpx;
|
||||
border: 3rpx;
|
||||
margin-right: 16rpx;
|
||||
background-color: rgba(232, 16, 30, 1);
|
||||
}
|
||||
|
||||
.service-item {
|
||||
padding-top: 24rpx;
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: space-between;
|
||||
align-items: stretch;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.section-lable {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #3d3d3d;
|
||||
}
|
||||
|
||||
.service-image {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 16rpx;
|
||||
margin-right: 24rpx;
|
||||
background-color: #e2e2e2;
|
||||
}
|
||||
|
||||
.service-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-flow: column nowrap;
|
||||
justify-content: space-between;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.service-name {
|
||||
font-size: 28rpx;
|
||||
color: #3d3d3d;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.service-count {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.count-lable {
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.count-num {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.price-info {
|
||||
margin-top: 32rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.total-price {
|
||||
padding-bottom: 32rpx;
|
||||
}
|
||||
|
||||
.price-info,
|
||||
.total-price {
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.price-label,
|
||||
.total-label {
|
||||
color: #666666;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.price-value,
|
||||
.total-value {
|
||||
color: #333333;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 备注 */
|
||||
.remark-section {
|
||||
background-color: #ffffff;
|
||||
padding: 32rpx 24rpx;
|
||||
margin: 24rpx;
|
||||
border-radius: 16rpx;
|
||||
box-shadow: 0 4rpx 16rpx 0 rgba(210, 213, 224, 0.5);
|
||||
}
|
||||
|
||||
.remark-title {
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 24rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.remark-input {
|
||||
width: 100%;
|
||||
height: 160rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
color: #999999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
/* 底部结算栏 */
|
||||
.footer {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 150rpx;
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 0 24rpx;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
.price-total {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-flow: column nowrap;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.price-total .price {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(232, 16, 30, 1);
|
||||
}
|
||||
|
||||
.amount-lable {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
width: 492rpx;
|
||||
height: 64rpx;
|
||||
background: rgba(232, 16, 30, 1);
|
||||
border-radius: 32rpx;
|
||||
color: #ffffff;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.arrow-icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
/* 弹框遮罩 */
|
||||
.popup {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 998;
|
||||
}
|
||||
|
||||
.popup-mask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
/* 时间选择弹框 */
|
||||
.time-popup {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #ffffff;
|
||||
border-radius: 24rpx 24rpx 0 0;
|
||||
overflow: hidden;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
transform: translateY(0);
|
||||
transition: transform 0.3s;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.popup-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx 30rpx 36rpx 30rpx;
|
||||
|
||||
.popup-close {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
line-height: 37rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 500;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
line-height: 42rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.time-picker-content {
|
||||
padding: 32rpx 32rpx;
|
||||
|
||||
&__datas {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
&__date__item {
|
||||
width: 214rpx;
|
||||
height: 67rpx;
|
||||
background: #f7f8fa;
|
||||
border-radius: 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
&__text {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
line-height: 37rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
position: relative;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
&__text.active {
|
||||
color: #ffffff;
|
||||
background: transparent;
|
||||
background-position: bottom;
|
||||
}
|
||||
|
||||
&__box {
|
||||
width: 214rpx;
|
||||
height: 74rpx;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__time__list {
|
||||
flex: 1;
|
||||
height: 600rpx;
|
||||
margin-top: 30rpx;
|
||||
|
||||
::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
::v-deep .uni-scroll-view-content {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
-webkit-column-gap: 21rpx;
|
||||
column-gap: 21rpx;
|
||||
row-gap: 30rpx;
|
||||
max-height: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
&__item {
|
||||
box-sizing: border-box;
|
||||
width: 156rpx;
|
||||
height: 90rpx;
|
||||
background: #f7f8fa;
|
||||
border-radius: 10rpx;
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #3c3638;
|
||||
line-height: 37rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.__text {
|
||||
}
|
||||
|
||||
.__state {
|
||||
}
|
||||
}
|
||||
|
||||
.state-available {
|
||||
color: #3c3638;
|
||||
background: #f7f8fa;
|
||||
/* 可约 */
|
||||
}
|
||||
|
||||
.state-full {
|
||||
color: #3c3638;
|
||||
background: #e4e9f0;
|
||||
/* 约满 */
|
||||
}
|
||||
|
||||
.state-rest {
|
||||
color: #cdcdcd;
|
||||
background: #f7f8f9;
|
||||
/* 休息 */
|
||||
}
|
||||
|
||||
.state-locked {
|
||||
color: #3c3638;
|
||||
background: #e4e9f0;
|
||||
/* 锁定 */
|
||||
}
|
||||
|
||||
.state-unavailable {
|
||||
color: #ffffff;
|
||||
background: #e4e9f0;
|
||||
/* 不可用 */
|
||||
}
|
||||
|
||||
.state-unknown {
|
||||
/* 未知状态 */
|
||||
}
|
||||
|
||||
.isActive {
|
||||
background: rgba(252, 67, 124, 0.08);
|
||||
border-radius: 10rpx;
|
||||
border: 1rpx solid #E8101E;
|
||||
color: #E8101E;
|
||||
/* 选中状态 */
|
||||
}
|
||||
|
||||
&__item.active {
|
||||
background-color: #fff0f0;
|
||||
color: #ff3e3e;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
&__item.noselected {
|
||||
/* background-color: #FFF0F0; */
|
||||
color: #999999;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
&__time__sure {
|
||||
padding: 39rpx 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
&__box {
|
||||
width: 648rpx;
|
||||
height: 94rpx;
|
||||
background: linear-gradient(140deg, #fa4e9a 0%, #E8101E 100%);
|
||||
border-radius: 48rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #ffffff;
|
||||
line-height: 42rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 多端适配 */
|
||||
/* #ifdef H5 */
|
||||
.time-popup {
|
||||
max-height: 85vh;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
|
||||
/* #ifdef APP-PLUS */
|
||||
.time-popup {
|
||||
max-height: 90vh;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
|
||||
/* #ifdef MP-WEIXIN */
|
||||
.time-popup {
|
||||
max-height: 95vh;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
</style>
|
||||
|
|
@ -0,0 +1,660 @@
|
|||
<template>
|
||||
<view class="list-filter">
|
||||
<scroll-view scroll-x>
|
||||
<view class="list-filter-tabs">
|
||||
<!-- 一级tabs:添加点击事件和动态active类 -->
|
||||
<view v-for="(item, index) in firstTabs" :key="index" class="list-filter-tabs-item"
|
||||
:class="{ active: activeFirstId === item.id }" @click="handleFirstTabClick(item)">
|
||||
{{ item.title }}
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="list-filter-tabs2">
|
||||
<!-- 二级tabs-数据项:添加点击事件和动态active类 -->
|
||||
<view v-for="(item, index) in secondTabs" :key="index" class="list-filter-tabs2-item"
|
||||
:class="{ active: activeSecondId === item.id }" @click="handleSecondTabClick(item.id, item.title)">
|
||||
{{ item.title }}
|
||||
</view>
|
||||
</view>
|
||||
<CommonList ref="groupRef" :isLogin="isLogin" :apiUrl="apiUrl" :listScrollHeight="`calc(100vh - ${426}rpx)`"
|
||||
@load-success="loadSuccess">
|
||||
<template #listData="{ list }">
|
||||
<view v-for="item in popList">
|
||||
<!-- <orderCardManHours v-if="activeFirstId == 4 && order.first_class_title" :dataItem="order"
|
||||
@cancel="cancelOrder($event, order)" @accept="confirmOrder($event, order)"
|
||||
@start="startOrder($event, order)" @done="endOrder($event, order)"
|
||||
@goOrderDetail="goOrderDetail"></orderCardManHours>
|
||||
<orderCardList v-else :dataItem="order" :typeId="1" @cancel="cancelOrder($event, order)"
|
||||
@accept="confirmOrder($event, order)" @start="startOrder($event, order)"
|
||||
@done="endOrder($event, order)" @goOrderDetail="goOrderDetail" /> -->
|
||||
|
||||
<OrderCard v-if="activeFirstId != 3" :haveButton="haveButton" :showState="false" :dataItem="item"
|
||||
:typeId="activeFirstId" @cancel="cancelOrder($event, item)" @start="startOrder($event, item)"
|
||||
@done="endOrder($event, item)" @goOrderDetail="goOrderDetail" />
|
||||
<WorkHourOrderCard v-else :showState="false" :dataItem="item" :typeId="activeFirstId"
|
||||
@cancel="cancelOrder($event, item)" @accept="confirmOrder($event, item)"
|
||||
@start="startOrder($event, item)" @done="endOrder($event, item)" @goOrderDetail="goOrderDetail">
|
||||
</WorkHourOrderCard>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<!-- 空数据状态 -->
|
||||
<template #empty>
|
||||
<view class="noDataBox">
|
||||
|
||||
<noData tipText="暂无服务订单哟~" v-if="isLogin"></noData>
|
||||
<noLogin v-else></noLogin>
|
||||
</view>
|
||||
</template>
|
||||
</CommonList>
|
||||
<serviceCodeInput :show="showInput" @close="showInput = false" @confirm="onConfirm" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OrderCard from "./orderCard2.vue";
|
||||
import WorkHourOrderCard from "./workOrderCard.vue";
|
||||
import CommonList from "@/components/common/CommonList.vue";
|
||||
import noLogin from "@/components/noData/noLogin.vue";
|
||||
import request from "@/utils/request";
|
||||
import serviceCodeInput from "@/components/service-code-input/service-code-input.vue";
|
||||
export default {
|
||||
name: "filters",
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
userInfo: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
isLogin: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 自营状态 0未加入 1加入 2停用
|
||||
selfState: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
components: {
|
||||
CommonList,
|
||||
noLogin,
|
||||
serviceCodeInput,
|
||||
OrderCard,
|
||||
WorkHourOrderCard,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
popList:[],
|
||||
haveButton: true,
|
||||
statusBarHeight: 0,
|
||||
tabs: [{
|
||||
title: "到店订单",
|
||||
id: 1
|
||||
},
|
||||
{
|
||||
title: "自营到店订单",
|
||||
id: 2,
|
||||
isNeedLogin: true,
|
||||
isRuzHu: true,
|
||||
isSelfOrder: true
|
||||
},
|
||||
{
|
||||
title: "工位订单",
|
||||
id: 3,
|
||||
isNeedLogin: true,
|
||||
id_type: 1
|
||||
},
|
||||
{
|
||||
title: "上门订单",
|
||||
id: 4,
|
||||
isNeedLogin: true,
|
||||
id_type: 1
|
||||
},
|
||||
{
|
||||
title: "自营上门订单",
|
||||
id: 5,
|
||||
isNeedLogin: true,
|
||||
id_type: 1
|
||||
},
|
||||
], // 1级类目
|
||||
activeFirstId: 1, // 记录选中的1级tab id
|
||||
activeSecondId: 3, // 记录选中的2级tab id(null表示"全部")
|
||||
numInfo: {
|
||||
djd: 0,
|
||||
dfw: 0,
|
||||
dwc: 0,
|
||||
nocompletednum: 0,
|
||||
noconfirmnum: 0,
|
||||
noservernum: 0,
|
||||
},
|
||||
sjId: undefined,
|
||||
idType: undefined,
|
||||
showInput: false,
|
||||
orderInfo: {},
|
||||
urls: {
|
||||
1: {
|
||||
weChatRefund: "/sj/yhwechatrefund",
|
||||
aliRefund: "/sj/yhalirefund",
|
||||
startOrder: "/sj/startserver",
|
||||
endOrder: "/sj/endserver",
|
||||
ordernum: "/sj/ordernum",
|
||||
list: "/sj/sjgetyhorder",
|
||||
},
|
||||
2: {
|
||||
weChatRefund: "/sj/orderSelf/weChatRefund",
|
||||
aliRefund: "/sj/orderSelf/aliRefund",
|
||||
startOrder: "/sj/orderSelf/start",
|
||||
endOrder: "/sj/orderSelf/end",
|
||||
ordernum: "/sj/orderSelf/orderNum",
|
||||
list: "/sj/orderSelf/list",
|
||||
},
|
||||
3: {
|
||||
weChatRefund: "/sj/workSeatOrder/weChatRefund",
|
||||
aliRefund: "/sj/workSeatOrder/aliRefund",
|
||||
startOrder: "/sj/workSeatOrder/start",
|
||||
endOrder: "/sj/workSeatOrder/end",
|
||||
ordernum: "/sj/workSeatOrder/orderNum",
|
||||
list: "/sj/workSeatOrder/list",
|
||||
},
|
||||
4: {
|
||||
ordernum: "/sj/sjonsiteordernum",
|
||||
list: "/sj/sjonsiteorder",
|
||||
},
|
||||
5: {
|
||||
ordernum: "/sj/sjonsiteordernumself",
|
||||
list: "/sj/sjonsiteorderself",
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
apiUrl() {
|
||||
if(!this.urls[this.activeFirstId]){
|
||||
return ""
|
||||
}
|
||||
const urls = this.urls[this.activeFirstId];
|
||||
return urls.list;
|
||||
},
|
||||
getNumUrl() {
|
||||
const urls = this.urls[this.activeFirstId];
|
||||
return urls.ordernum;
|
||||
},
|
||||
// 计算是否显示自营订单tab
|
||||
showSelfOrderTab() {
|
||||
// 只有当self_state为1或2时才显示自营订单tab
|
||||
return this.selfState == 1 || this.selfState == 2;
|
||||
},
|
||||
firstTabs() {
|
||||
return this.tabs
|
||||
.filter((tab) => !tab.isNeedLogin || this.isLogin)
|
||||
.filter((tab) => {
|
||||
if (tab.id_type) {
|
||||
return this.idType == tab.id_type;
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.filter((tab) => !tab.isRuzHu || this.idType != 0)
|
||||
// 自营订单tab显示条件
|
||||
.filter((tab) => {
|
||||
if (tab.isSelfOrder) {
|
||||
return this.showSelfOrderTab;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
},
|
||||
secondTabs() {
|
||||
if (this.activeFirstId == 1 || this.activeFirstId == 2) {
|
||||
return [{
|
||||
title: `待服务(${this.numInfo.noservernum})`,
|
||||
id: 3
|
||||
},
|
||||
{
|
||||
title: `待完成(${this.numInfo.nocompletednum})`,
|
||||
id: 4
|
||||
},
|
||||
];
|
||||
} else if (this.activeFirstId == 4 || this.activeFirstId == 5) {
|
||||
return [{
|
||||
title: `待接单(${this.numInfo.noconfirmnum})`,
|
||||
id: 2
|
||||
},
|
||||
{
|
||||
title: `待开始(${this.numInfo.noservernum})`,
|
||||
id: 3
|
||||
},
|
||||
{
|
||||
title: `待完成(${this.numInfo.nocompletednum})`,
|
||||
id: 4
|
||||
},
|
||||
];
|
||||
} else {
|
||||
return [{
|
||||
title: `待接单(${this.numInfo.djd})`,
|
||||
id: 2
|
||||
},
|
||||
{
|
||||
title: `待服务(${this.numInfo.dfw})`,
|
||||
id: 3
|
||||
},
|
||||
{
|
||||
title: `待完成(${this.numInfo.dwc})`,
|
||||
id: 4
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.statusBarHeight = this.getRpxStatusBarHeight();
|
||||
if (this.isLogin) {
|
||||
this.activeFirstId = 1;
|
||||
this.activeSecondId = 3; // 默认选中"待接单"
|
||||
this.searchList();
|
||||
} else {
|
||||
this.activeFirstId = null;
|
||||
this.activeSecondId = null; // 默认选中"待接单"
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isLogin(newVal) {
|
||||
if (newVal) {
|
||||
this.activeFirstId = 1;
|
||||
this.activeSecondId = 2; // 默认选中"待接单"
|
||||
this.searchList();
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
searchList() {
|
||||
if (this.syrId && this.idType) {
|
||||
this.$refs.groupRef.manualRefresh({
|
||||
sjid: this.sjId,
|
||||
state: this.activeSecondId || undefined,
|
||||
|
||||
});
|
||||
} else {
|
||||
request.post("/sj/user/getUser").then((result) => {
|
||||
this.sjId = result.data.id;
|
||||
this.idType = result.data.id_type;
|
||||
this.$refs.groupRef.manualRefresh({
|
||||
sjid: this.sjId,
|
||||
state: this.activeSecondId,
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
loadSuccess(res) {
|
||||
|
||||
this.popList = res.list
|
||||
request
|
||||
.post(this.getNumUrl, {
|
||||
sjid: this.sjId,
|
||||
})
|
||||
.then((result) => {
|
||||
for (let key in result.data) {
|
||||
this.numInfo[key] = result.data[key];
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
// 一级tab点击事件
|
||||
handleFirstTabClick(item) {
|
||||
this.popList = []
|
||||
if (!this.isLogin) return;
|
||||
// 避免重复点击
|
||||
if (this.activeFirstId === item.id) return;
|
||||
// 更新1级选中状态
|
||||
this.activeFirstId = item.id;
|
||||
|
||||
this.haveButton = true
|
||||
if (this.activeFirstId == 4 || this.activeFirstId == 5) {
|
||||
this.haveButton = false
|
||||
}
|
||||
|
||||
// 重置2级选中状态(默认选中"全部")
|
||||
if (this.activeFirstId == 1 || this.activeFirstId == 2) {
|
||||
this.activeSecondId = 3;
|
||||
} else {
|
||||
this.activeSecondId = 2;
|
||||
}
|
||||
|
||||
// 传递给父组件(1级选中数据)
|
||||
this.$emit("tabChange", {
|
||||
firstId: this.activeFirstId,
|
||||
secondId: this.activeSecondId,
|
||||
});
|
||||
this.$nextTick(() => {
|
||||
this.searchList();
|
||||
});
|
||||
},
|
||||
// 二级tab点击事件
|
||||
handleSecondTabClick(id, title) {
|
||||
this.popList = []
|
||||
if (!this.isLogin) return;
|
||||
if (this.activeSecondId === id) return;
|
||||
// 更新2级选中状态
|
||||
this.activeSecondId = id;
|
||||
// 传递给父组件(2级选中数据)
|
||||
this.$emit("tabChange", {
|
||||
firstId: this.activeFirstId,
|
||||
secondId: this.activeSecondId,
|
||||
});
|
||||
this.$nextTick(() => {
|
||||
this.searchList();
|
||||
});
|
||||
},
|
||||
cancelOrder(e, order) {
|
||||
uni.showModal({
|
||||
title: "取消订单",
|
||||
content: "确定要取消该订单吗?(订单取消后,支付金额将原路退回)",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// TODO: 取消订单
|
||||
let data = {
|
||||
orderNo: order.number,
|
||||
amount: order.pay_money,
|
||||
syrid: this.syrId,
|
||||
};
|
||||
let url = "";
|
||||
if (order.pay_kind == 1) {
|
||||
url = "";
|
||||
} else if (order.pay_kind == 2) {
|
||||
url = this.urls[this.activeFirstId].weChatRefund;
|
||||
} else if (order.pay_kind == 3) {
|
||||
url = this.urls[this.activeFirstId].aliRefund;
|
||||
}
|
||||
console.log(data, url);
|
||||
if (this.clickType) {
|
||||
return;
|
||||
}
|
||||
this.clickType = true;
|
||||
request
|
||||
.post(url, data)
|
||||
.then((res) => {
|
||||
if (res.state == 1 || res.code == 200 || res.code == 1) {
|
||||
uni.showToast({
|
||||
title: "取消成功!",
|
||||
icon: "none",
|
||||
});
|
||||
this.searchList();
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
})
|
||||
.finally(() => {
|
||||
this.clickType = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
// 确认接单
|
||||
confirmOrder(e, order) {
|
||||
if (this.clickType) {
|
||||
return;
|
||||
}
|
||||
this.clickType = true;
|
||||
request
|
||||
.post(this.urls[this.activeFirstId].sureOrder, {
|
||||
id: order.id,
|
||||
syrid: this.syrId,
|
||||
order_kind: this.idType == 2 ? 3 : 1,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.state != 1 || res.code != 200) {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "已接单",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
this.searchList();
|
||||
})
|
||||
.finally(() => {
|
||||
this.clickType = false;
|
||||
});
|
||||
},
|
||||
// 开始服务
|
||||
startOrder(e, order) {
|
||||
if (order.team_buy_order_state == 1) {
|
||||
uni.showToast({
|
||||
title: "订单当前处于拼团中,服务将在拼团完成后才开启~",
|
||||
icon: "none",
|
||||
});
|
||||
return
|
||||
}
|
||||
this.showInput = true;
|
||||
this.orderInfo = order;
|
||||
},
|
||||
// 输入完成
|
||||
onConfirm(code) {
|
||||
this.showInput = false;
|
||||
if (this.clickType) {
|
||||
return;
|
||||
}
|
||||
this.clickType = true;
|
||||
console.log(this.orderInfo, "this.urls[this.activeFirstId].startOrder");
|
||||
request
|
||||
.post(this.urls[this.activeFirstId].startOrder, {
|
||||
id: this.orderInfo.id,
|
||||
server_code: code,
|
||||
sjid: this.sjId,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
if (res.state == 1 || res.code == 200) {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
});
|
||||
this.searchList();
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
this.orderInfo = {};
|
||||
})
|
||||
.finally(() => {
|
||||
this.clickType = false;
|
||||
});
|
||||
},
|
||||
// 完成服务
|
||||
endOrder(e, order) {
|
||||
// app阻止事件冒泡
|
||||
// #ifdef APP-PLUS
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
// #endif
|
||||
if (this.clickType) {
|
||||
return;
|
||||
}
|
||||
this.clickType = true;
|
||||
request
|
||||
.post(this.urls[this.activeFirstId].endOrder, {
|
||||
id: order.id,
|
||||
sjid: this.sjId,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.state == 1 || res.code == 200) {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
});
|
||||
this.searchList();
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.clickType = false;
|
||||
});
|
||||
},
|
||||
goOrderDetail(order) {
|
||||
if (this.idType == 1) {
|
||||
if (this.activeFirstId == 1) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/shop/userorder-detail?id=${order.id}&haveButton=${this.haveButton}`,
|
||||
});
|
||||
}
|
||||
if (this.activeFirstId == 2) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/shop/userorder-detail?id=${order.id}&serviceType=2`,
|
||||
});
|
||||
}
|
||||
if (this.activeFirstId == 3) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/shop/SellerDetail?id=${order.id}`,
|
||||
});
|
||||
}
|
||||
if (this.activeFirstId == 4) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/shop/userorder-detail?id=${order.id}&haveButton=${this.haveButton}`,
|
||||
});
|
||||
}
|
||||
if (this.activeFirstId == 5) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/shop/userorder-detail?id=${order.id}&haveButton=${this.haveButton}&serviceType=2`,
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.list-filter {
|
||||
background: #ffffff;
|
||||
border-radius: 20rpx 20rpx 0rpx 0rpx;
|
||||
|
||||
.list-filter-tabs {
|
||||
display: flex;
|
||||
gap: 50rpx;
|
||||
padding-left: 30rpx;
|
||||
padding-top: 30rpx;
|
||||
// 给一级tabs容器添加底部内边距,避免横条被遮挡
|
||||
padding-bottom: 12rpx;
|
||||
|
||||
.list-filter-tabs-item {
|
||||
// 关键:设置为inline-block,让宽度跟随文字,横条宽度与文字一致
|
||||
display: inline-block;
|
||||
// 相对定位,用于横条的绝对定位参考
|
||||
position: relative;
|
||||
|
||||
font-weight: 500;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
line-height: 42rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
white-space: nowrap;
|
||||
|
||||
// 点击反馈
|
||||
&:active {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
// 选中状态样式
|
||||
&.active {
|
||||
color: #e8101e; // 选中文字颜色
|
||||
font-weight: 600; // 选中时加粗(可选,根据图片效果)
|
||||
|
||||
// 横条效果:通过伪元素实现
|
||||
&::after {
|
||||
content: "";
|
||||
// 绝对定位在元素底部
|
||||
position: absolute;
|
||||
width: 34rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
bottom: -6rpx; // 距离文字底部的距离(可调整)
|
||||
height: 6rpx; // 横条高度
|
||||
background: linear-gradient(306deg,
|
||||
#e8101e 0%,
|
||||
#e8101e 100%); // 横条颜色(与文字颜色一致)
|
||||
border-radius: 3rpx; // 横条圆角(可选,更柔和)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.list-filter-tabs2 {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 40rpx;
|
||||
padding: 24rpx 20rpx;
|
||||
|
||||
.list-filter-tabs2-item {
|
||||
width: 168rpx;
|
||||
height: 56rpx;
|
||||
background: #f0f0f0;
|
||||
border-radius: 6rpx;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
white-space: nowrap;
|
||||
|
||||
// 点击反馈
|
||||
&:active {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
// 选中状态样式
|
||||
&.active {
|
||||
color: #e8101e; // 选中颜色
|
||||
background: rgba(252, 67, 124, 0.1); // 可选:选中时背景色变化
|
||||
font-weight: 600; // 可选:选中时加粗
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.noDataBox {
|
||||
background-color: #ffffff;
|
||||
height: 100%;
|
||||
margin: 0rpx;
|
||||
border-radius: 20rpx;
|
||||
// padding-bottom: 314rpx;
|
||||
}
|
||||
|
||||
.common-list {
|
||||
background: #f5f5f5;
|
||||
padding-bottom: 0;
|
||||
|
||||
}
|
||||
|
||||
::v-deep .list-scroll {
|
||||
margin-top: 0 !important;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.order-card{
|
||||
margin: 0rpx 0rpx 20rpx 0rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,394 @@
|
|||
<template>
|
||||
<view class="order-card">
|
||||
<!-- 时间信息 -->
|
||||
<view class="time-info" v-if="dataItem.reservation_time || dataItem.reserve_end_time">
|
||||
<image class="time-info-img" :src="dataItem.order_shopheadphoto_other"></image>
|
||||
<text class="time-info-name">{{ dataItem.order_shop_other }}</text>
|
||||
<text class="time-info-text1">服务时段:</text>
|
||||
<text class="time-info-text2">{{ useTime }}</text>
|
||||
</view>
|
||||
<!-- 订单编号 -->
|
||||
<view class="orderNumBox" v-else>
|
||||
<view class="order-id white-space-nowrap">订单编号:{{ dataItem.number }}</view>
|
||||
<view class="stateText" v-if="showState">
|
||||
{{ stateText }}
|
||||
</view>
|
||||
<!-- <image class="rightArrow" src="/static/images/shop/pintuan/rightArrow.png" v-else
|
||||
@click="$emit('goOrderDetail', dataItem)"></image> -->
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 服务信息区域 -->
|
||||
<view class="service-container" @click="$emit('goOrderDetail', dataItem)">
|
||||
<image class="service-img" :src="
|
||||
dataItem.order_photo ? dataItem.order_photo[0] : JSON.parse(dataItem.photo)[0]
|
||||
" mode="aspectFill"></image>
|
||||
<view class="service-info">
|
||||
<view>
|
||||
<view class="service-type">
|
||||
<view class="service-name-type" v-if="dataItem.team_buy_id">
|
||||
{{getGroupType}}
|
||||
</view>
|
||||
<text class="service-name-text">
|
||||
{{ dataItem.server_title }}
|
||||
</text>
|
||||
|
||||
</view>
|
||||
<view class="service-time" v-if="dataItem.add_time">下单时间: {{ dataItem.add_time }}</view>
|
||||
</view>
|
||||
<view class="service-price">
|
||||
<text v-if="dataItem.team_buy_id">{{`团购价: `}}</text>¥<text
|
||||
style="font-size: 34rpx;">{{ dataItem.order_money }}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="order-address" v-if="dataItem.reservation_address">上门地址:{{ dataItem.reservation_address }}</view>
|
||||
|
||||
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<view class="button-group" v-if="haveButton">
|
||||
<view class="btn cancel-btn" v-if="dataItem.state == 2 || dataItem.state == 3" @click.stop="emitCancel">取消订单
|
||||
</view>
|
||||
<!-- <view class="btn accept-btn" @click.stop="emitAccept" v-if="dataItem.state == 2">接单</view> -->
|
||||
<view class="btn accept-btn" @click.stop="emitStart" v-if="dataItem.state == 3">开始服务</view>
|
||||
<view class="btn accept-btn" @click.stop="emitDone" v-if="dataItem.state == 4">服务完成</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "OrderCard",
|
||||
props: {
|
||||
dataItem: {
|
||||
type: Object,
|
||||
},
|
||||
typeId: {
|
||||
type: Number,
|
||||
},
|
||||
showState: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
haveButton: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
useTime() {
|
||||
const start = this.dataItem.reservation_time;
|
||||
const server_time = this.dataItem.server_time || 0;
|
||||
|
||||
// 格式化时间范围:兼容低版本iOS,输出 MM.DD HH:MM-MM.DD HH:MM 格式
|
||||
function formatTimeRange(startTimeStr, serviceMinutes) {
|
||||
// 1. 空值兜底:避免无开始时间时报错
|
||||
if (!startTimeStr) return "";
|
||||
|
||||
// 2. 兼容低版本iOS:iOS不识别 "-" 分隔的日期,必须替换为 "/"
|
||||
const iosSafeTimeStr = startTimeStr.replace(/-/g, "/");
|
||||
const startTime = new Date(iosSafeTimeStr);
|
||||
|
||||
// 校验时间有效性
|
||||
if (isNaN(startTime.getTime())) {
|
||||
throw new Error("无效的开始时间格式,请使用类似'2025-08-04 14:00:00'的格式");
|
||||
}
|
||||
|
||||
// 3. 计算结束时间(开始时间 + 服务分钟数)
|
||||
const endTime = new Date(startTime.getTime() + serviceMinutes * 60 * 1000);
|
||||
|
||||
// 格式化日期部分:MM.DD(补零,如 08.12)
|
||||
const formatDate = (date) => {
|
||||
const month = String(date.getMonth() + 1).padStart(2, "0"); // 月份从0开始,+1后补零
|
||||
const day = String(date.getDate()).padStart(2, "0");
|
||||
return `${month}.${day}`;
|
||||
};
|
||||
|
||||
// 格式化时间部分:HH:MM(补零,如 12:30)
|
||||
const formatTimePart = (date) => {
|
||||
const hours = String(date.getHours()).padStart(2, "0");
|
||||
const minutes = String(date.getMinutes()).padStart(2, "0");
|
||||
return `${hours}:${minutes}`;
|
||||
};
|
||||
|
||||
// 4. 拼接最终格式:MM.DD HH:MM-MM.DD HH:MM
|
||||
const startDate = formatDate(startTime);
|
||||
const startTimePart = formatTimePart(startTime);
|
||||
const endDate = formatDate(endTime);
|
||||
const endTimePart = formatTimePart(endTime);
|
||||
|
||||
return `${startDate} ${startTimePart}-${endDate} ${endTimePart}`;
|
||||
}
|
||||
|
||||
// 兜底:如果start为空,返回空字符串避免报错
|
||||
return start ? formatTimeRange(start, server_time) : "";
|
||||
},
|
||||
stateText() {
|
||||
const textList = [
|
||||
"",
|
||||
"待支付",
|
||||
"待接单",
|
||||
"待开始",
|
||||
"进行中",
|
||||
"已完成",
|
||||
"已评价",
|
||||
"已取消",
|
||||
];
|
||||
return textList[this.dataItem.state];
|
||||
},
|
||||
//获取拼团状态文字
|
||||
getGroupType() {
|
||||
let list = [{
|
||||
id: 1,
|
||||
text: "团购中",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
text: "已成团",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
text: "拼团失败",
|
||||
},
|
||||
];
|
||||
let name = list.find((it) => it.id == this.dataItem.team_buy_order_state)?.text;
|
||||
return name;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 触发取消事件
|
||||
emitCancel() {
|
||||
this.$emit("cancel");
|
||||
},
|
||||
// 触发接单事件
|
||||
emitAccept() {
|
||||
this.$emit("accept");
|
||||
},
|
||||
emitStart() {
|
||||
this.$emit("start");
|
||||
},
|
||||
emitDone() {
|
||||
this.$emit("done");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.order-card {
|
||||
padding: 20rpx 30rpx 20rpx 30rpx;
|
||||
margin: 0rpx 30rpx 20rpx 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 12px;
|
||||
/* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); */
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* 订单编号 */
|
||||
.order-id {
|
||||
width: 530rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.orderNumBox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 40rpx;
|
||||
|
||||
.stateText {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #E8101E;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
background-image: url("/static/images/icons/tabBj.png");
|
||||
background-size: 100% auto;
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
width: 128rpx;
|
||||
height: 49rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.rightArrow {
|
||||
width: 12rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 服务信息容器 */
|
||||
.service-container {
|
||||
display: flex;
|
||||
padding-bottom: 24rpx;
|
||||
border-bottom: 1px solid #f6f5f5;
|
||||
}
|
||||
|
||||
/* 服务图片 */
|
||||
.service-img {
|
||||
width: 172rpx;
|
||||
height: 168rpx;
|
||||
border-radius: 24rpx;
|
||||
margin-right: 30rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 服务信息 */
|
||||
.service-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.service-price {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #E8101E;
|
||||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.service-type {
|
||||
width: 400rpx;
|
||||
font-weight: 500;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 22rpx;
|
||||
|
||||
.service-name-type {
|
||||
/* #ifdef APP-PLUS */
|
||||
font-family: 'shuHeiTi';
|
||||
/* #endif */
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
line-height: 27rpx;
|
||||
letter-spacing: 2px;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
background: linear-gradient(166deg, #FC5E72 0%, #E8101E 100%);
|
||||
border-radius: 6rpx;
|
||||
padding: 4rpx 4rpx 4rpx 8rpx;
|
||||
margin-right: 13rpx;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.service-name-text {
|
||||
flex: 1;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
.service-time {
|
||||
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
/* 时间信息 */
|
||||
.time-info {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
margin-bottom: 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.time-info-img {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-right: 10rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.time-info-name {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.time-info-text1 {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.time-info-text2 {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
/* 按钮组 */
|
||||
.button-group {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 30rpx;
|
||||
}
|
||||
|
||||
/* 通用按钮样式 */
|
||||
.btn {
|
||||
width: 80rpx;
|
||||
height: 32rpx;
|
||||
border-radius: 64rpx;
|
||||
font-size: 26rpx;
|
||||
background-color: #fff;
|
||||
white-space: nowrap;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
/* 取消按钮 */
|
||||
.cancel-btn {
|
||||
border: 2rpx solid #979797;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
/* 接单按钮 */
|
||||
.accept-btn {
|
||||
border: 2rpx solid #E8101E;
|
||||
color: #E8101E;
|
||||
}
|
||||
|
||||
.order-address {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,156 @@
|
|||
<template>
|
||||
<view class="project">
|
||||
<view class="project-tabs">
|
||||
<scroll-view scroll-x class="tab-scroll" :show-scrollbar="false" @touchmove.prevent.stop>
|
||||
<view class="tab-container">
|
||||
<!-- 价格 -->
|
||||
<view class="tab-card" :class="{ active: activeId == item.id }" v-for="(item,index) in tabs"
|
||||
:key="index" @click="clickTap(item.id )">
|
||||
<text class="tab-text" >{{ item.name }}</text>
|
||||
<image :src="activeId == item.id?sortList[sortIndex].src:sortList[0].src" mode="aspectFill" class="tab-card-price-img" v-if="item.id"></image>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
activeId: 0, // 当前激活的排序项 0-综合 1-价格 2-销量 3-佣金比例
|
||||
tabs: [
|
||||
{
|
||||
id: 0,
|
||||
name: "综合",
|
||||
sort: null,
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name: "销量",
|
||||
sort: null,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "价格",
|
||||
sort: null,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "比例",
|
||||
sort: null,
|
||||
},
|
||||
],
|
||||
sortIndex: 0, //0为没选择,1升序 2降序
|
||||
sortList: [{
|
||||
id: null,
|
||||
src: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/d4d29a11-dc37-4852-907a-7ed3f31f01dd"
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
src: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/58518a61-ab6b-4580-90fd-3336b6512ece"
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
src: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/d79cd7c2-f9e2-4acc-a33b-c72e26c9a0b6"
|
||||
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
clickTap(id) {
|
||||
let obj = {
|
||||
sort_type: null,
|
||||
sort_by: null
|
||||
};
|
||||
//重置索引
|
||||
if (this.activeId != id) {
|
||||
this.sortIndex = 0
|
||||
}
|
||||
if (id === 0) {
|
||||
// 热销(无排序图标)
|
||||
this.activeId = id;
|
||||
} else {
|
||||
// 价格排序
|
||||
this.activeId = id;
|
||||
obj.sort_type = id;
|
||||
this.sortIndex = this.sortIndex === 1 ? 2 : 1;
|
||||
obj.sort_by = this.sortList[this.sortIndex].id;
|
||||
}
|
||||
this.$emit("clickTap", obj);
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.project {
|
||||
.project-tabs {
|
||||
position: relative;
|
||||
z-index: 500;
|
||||
padding: 30rpx 40rpx 24rpx 40rpx;
|
||||
background-color: #fafafa;
|
||||
.tab-scroll {
|
||||
.tab-container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
padding-bottom: 12rpx;
|
||||
/* 调整间距,避免四个项溢出 */
|
||||
|
||||
.tab-card {
|
||||
box-sizing: border-box;
|
||||
padding: 0 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
/* 文本与图标间距 */
|
||||
border-radius: 6rpx;
|
||||
.tab-text {
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.tab-card-price-img {
|
||||
width: 13rpx;
|
||||
height: 18rpx;
|
||||
}
|
||||
|
||||
&.active {
|
||||
|
||||
.tab-text {
|
||||
font-weight: 500;
|
||||
color: #E8101E;
|
||||
&::after{
|
||||
content: '';
|
||||
// 绝对定位在元素底部
|
||||
position: absolute;
|
||||
width: 34rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
bottom: -6rpx; // 距离文字底部的距离(可调整)
|
||||
height: 6rpx; // 横条高度
|
||||
background: linear-gradient( 306deg, #E8101E 0%, #F25988 100%); // 横条颜色(与文字颜色一致)
|
||||
border-radius: 3rpx; // 横条圆角(可选,更柔和)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,459 +0,0 @@
|
|||
<template>
|
||||
<view class="service-grid">
|
||||
<view class="service-item-box">
|
||||
<view
|
||||
class="service-item"
|
||||
v-if="index % 2 == 0"
|
||||
v-for="(item, index) in services"
|
||||
:key="services.id"
|
||||
@click="onServiceClick(item)"
|
||||
>
|
||||
<view class="imageBox">
|
||||
<image
|
||||
:src="item.photo[0]"
|
||||
v-if="item.photo && item.photo.length != 0"
|
||||
mode="widthFix"
|
||||
class="service-image"
|
||||
lazy-load
|
||||
></image>
|
||||
<view class="distance">
|
||||
<image
|
||||
class="position"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/056d3548-9a6d-4ca7-8398-92078cfc47ab"
|
||||
/>
|
||||
{{ item.distance.toFixed(2) }}km
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<text class="service-tag">{{
|
||||
item.server_kind == 1 ? "到家" : item.server_kind == 2 ? "到店" : item.server_kind == 3 ? "到店到家" : ""
|
||||
}}</text>
|
||||
<view class="service-info">
|
||||
<view class="service-title">
|
||||
<image
|
||||
class="service-title-type"
|
||||
mode="widthFix"
|
||||
src="@/static/images/shop/pintuan/group.png"
|
||||
v-if="item.team_buy && Object.keys(item.team_buy).length != 0"
|
||||
></image>
|
||||
<text class="service-title-text">
|
||||
{{ item.title }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="service-row">
|
||||
<view
|
||||
class="service-price"
|
||||
v-if="item.team_buy && Object.keys(item.team_buy).length != 0"
|
||||
>
|
||||
<text class="price-symbol">拼团价:¥</text>
|
||||
<text
|
||||
class="price-value"
|
||||
:style="{
|
||||
'font-size': `${formatPriceSize(
|
||||
item.team_buy.price,
|
||||
28,
|
||||
5
|
||||
)}rpx`,
|
||||
}"
|
||||
>{{ item.team_buy.price }}</text
|
||||
>
|
||||
</view>
|
||||
<view class="service-price" v-else>
|
||||
<!-- 有券时显示券后价 -->
|
||||
<view v-if="item.hasCoupon" class="coupon-wrapper">
|
||||
<text class="coupon-label">券后</text>
|
||||
<text class="price-symbol num_regular_text">¥</text>
|
||||
<text class="price-value coupon-price">{{ item.coupon_price }}</text>
|
||||
<!-- 显示原价划线就取消注释 -->
|
||||
<!-- <text class="line-price original-price">¥{{ item.server_price }}</text> -->
|
||||
</view>
|
||||
<!-- 无券时显示原价 -->
|
||||
<view v-else class="price-wrapper">
|
||||
<text class="price-symbol num_regular_text">¥</text>
|
||||
<text class="price-value num_regular_text">{{
|
||||
item.server_price
|
||||
}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<text class="service-sales"
|
||||
>销量
|
||||
<text class="num_regular_text">{{ item.sales_num }}</text>
|
||||
</text>
|
||||
</view>
|
||||
<view class="service-shop" v-if="item.server_kind == 2">
|
||||
<text class="shop-text text-overflow-1">{{ item.shop_name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="service-item-box">
|
||||
<view
|
||||
v-if="index % 2 == 1"
|
||||
class="service-item"
|
||||
v-for="(item, index) in services"
|
||||
:key="services.id"
|
||||
@click="onServiceClick(item)"
|
||||
>
|
||||
<view class="imageBox">
|
||||
<image
|
||||
:src="item.photo[0]"
|
||||
v-if="item.photo && item.photo.length != 0"
|
||||
mode="widthFix"
|
||||
class="service-image"
|
||||
lazy-load
|
||||
></image>
|
||||
<view class="distance">
|
||||
<image
|
||||
class="position"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/056d3548-9a6d-4ca7-8398-92078cfc47ab"
|
||||
/>
|
||||
{{ item.distance.toFixed(2) }}km
|
||||
</view>
|
||||
</view>
|
||||
<text class="service-tag">{{
|
||||
item.server_kind == 1 ? "到家" : item.server_kind == 2 ? "到店" : item.server_kind == 3 ? "到店到家" : ""
|
||||
}}</text>
|
||||
<view class="service-info">
|
||||
<view class="service-title">
|
||||
<image
|
||||
class="service-title-type"
|
||||
mode="widthFix"
|
||||
src="@/static/images/shop/pintuan/group.png"
|
||||
v-if="item.team_buy && Object.keys(item.team_buy).length != 0"
|
||||
></image>
|
||||
<text class="service-title-text">
|
||||
{{ item.title }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="service-row">
|
||||
<view
|
||||
class="service-price"
|
||||
v-if="item.team_buy && Object.keys(item.team_buy).length != 0"
|
||||
>
|
||||
<text class="price-symbol">拼团价:¥</text>
|
||||
<text
|
||||
class="price-value num_regular_text"
|
||||
:style="{
|
||||
'font-size': `${formatPriceSize(
|
||||
item.team_buy.price,
|
||||
28,
|
||||
5
|
||||
)}rpx`,
|
||||
}"
|
||||
>{{ item.team_buy.price }}</text
|
||||
>
|
||||
</view>
|
||||
<!-- 非拼团商品:展示券后价或原价 -->
|
||||
<view class="service-price" v-else>
|
||||
<!-- 有券时显示券后价 -->
|
||||
<view v-if="item.hasCoupon" class="coupon-wrapper">
|
||||
<text class="coupon-label">券后</text>
|
||||
<text class="price-symbol num_regular_text">¥</text>
|
||||
<text class="price-value coupon-price">{{ item.coupon_price }}</text>
|
||||
<!-- 显示原价划线就取消注释 -->
|
||||
<!-- <text class="line-price original-price">¥{{ item.server_price }}</text> -->
|
||||
</view>
|
||||
<!-- 无券时显示原价 -->
|
||||
<view v-else class="price-wrapper">
|
||||
<text class="price-symbol num_regular_text">¥</text>
|
||||
<text class="price-value num_regular_text">{{
|
||||
item.server_price
|
||||
}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<text class="service-sales"
|
||||
>销量
|
||||
<text class="num_regular_text">{{ item.sales_num }}</text></text
|
||||
>
|
||||
</view>
|
||||
<view class="service-shop" v-if="item.server_kind == 2">
|
||||
<text class="shop-text text-overflow-1">{{ item.shop_name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "ServiceGrid",
|
||||
props: {
|
||||
// 服务列表数据
|
||||
services: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
// 是否显示多图布局
|
||||
showMultiImages: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 是否显示找相似按钮
|
||||
showSimilar: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 上一页是nvue页面还是vue页面
|
||||
pageType: {
|
||||
type: String,
|
||||
default: "vue",
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: "346rpx",
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onServiceClick(service) {
|
||||
if (this.pageType == "nvue") {
|
||||
console.log(this.pageType);
|
||||
this.$emit("serviceclick", service);
|
||||
} else {
|
||||
this.$emit("service-click", service);
|
||||
}
|
||||
},
|
||||
formatPriceNumber(num) {
|
||||
num = Number(num);
|
||||
let formatted;
|
||||
formatted = num.toFixed(2);
|
||||
// 根据数字大小确定保留的小数位数
|
||||
// if (num >= 100) {
|
||||
// // 大于等于100时,不保留小数
|
||||
// formatted = Math.floor(num).toString();
|
||||
// } else if (num >= 10) {
|
||||
// // 大于等于10时,保留1位小数
|
||||
// formatted = num.toFixed(1);
|
||||
// } else {
|
||||
// // 其他情况,保留两位小数
|
||||
// formatted = num.toFixed(2);
|
||||
// }
|
||||
|
||||
// 处理小数最后一位是0的情况
|
||||
// 如果包含小数点,则检查并移除末尾的0和可能的小数点
|
||||
// if (formatted.includes(".")) {
|
||||
// formatted = formatted.replace(/0+$/, "").replace(/\.$/, "");
|
||||
// }
|
||||
|
||||
return formatted;
|
||||
},
|
||||
formatPriceSize(o_num, o_fontSize, type = 1) {
|
||||
let fontSize = o_fontSize;
|
||||
|
||||
const len = this.formatPriceNumber(o_num).length;
|
||||
//首页拼团立省价格
|
||||
if (len > 7 && type == 1) {
|
||||
fontSize -= 4;
|
||||
}
|
||||
//分享图立省价格
|
||||
if (len > 7 && type == 2) {
|
||||
fontSize -= 3;
|
||||
}
|
||||
//分享图拼团价格
|
||||
if (type === 3) {
|
||||
if (len > 4) {
|
||||
fontSize -= 10;
|
||||
}
|
||||
if (len > 5) {
|
||||
fontSize -= 4;
|
||||
}
|
||||
if (len > 6) {
|
||||
fontSize -= 6;
|
||||
}
|
||||
if (len > 7) {
|
||||
fontSize -= 6;
|
||||
}
|
||||
}
|
||||
//分享图原价
|
||||
if (type === 4) {
|
||||
if (len > 5) {
|
||||
fontSize -= 2;
|
||||
}
|
||||
if (len > 6) {
|
||||
fontSize -= 2;
|
||||
}
|
||||
}
|
||||
|
||||
//首页商家
|
||||
if (type === 5) {
|
||||
if (len > 6) {
|
||||
fontSize -= 6;
|
||||
}
|
||||
if (len > 7) {
|
||||
fontSize -= 4;
|
||||
}
|
||||
if (len > 8) {
|
||||
fontSize -= 4;
|
||||
}
|
||||
}
|
||||
|
||||
return fontSize;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.service-grid {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
justify-content: space-between;
|
||||
gap: 18rpx;
|
||||
}
|
||||
.service-item-box {
|
||||
width: 346rpx;
|
||||
}
|
||||
.service-item {
|
||||
width: 346rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.05);
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.service-image {
|
||||
width: 346rpx;
|
||||
height: 346rpx;
|
||||
background-color: #000000;
|
||||
}
|
||||
.imageBox {
|
||||
width: 346rpx;
|
||||
position: relative;
|
||||
.distance {
|
||||
position: absolute;
|
||||
font-family: DINPro, DINPro;
|
||||
font-weight: 500;
|
||||
font-size: 20rpx;
|
||||
color: #ffffff;
|
||||
bottom: 20rpx;
|
||||
left: 14rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6rpx;
|
||||
background-color: rgba(102, 102, 102,0.6);
|
||||
padding: 4rpx 10rpx;
|
||||
border-radius: 100rpx;
|
||||
overflow: hidden;
|
||||
.position {
|
||||
width: 12rpx;
|
||||
height: 15rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.service-tag {
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
left: 0rpx;
|
||||
color: #ffffff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 26rpx;
|
||||
padding: 0 8rpx;
|
||||
height: 49rpx;
|
||||
background: linear-gradient(124deg, #f52540 0%, #e8101e 100%);
|
||||
border-radius: 20rpx 2rpx 20rpx 2rpx;
|
||||
}
|
||||
|
||||
.service-info {
|
||||
padding: 16rpx;
|
||||
}
|
||||
|
||||
.service-title {
|
||||
// margin-bottom: 8rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.service-title-type {
|
||||
width: 64rpx;
|
||||
/* 图片与文字之间的间距 */
|
||||
margin-right: 13rpx;
|
||||
}
|
||||
|
||||
.service-title-text {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
/* 显示的行数 */
|
||||
lines: 1;
|
||||
/* NVUE下要用这个属性,来让文字超出隐藏变省略号 */
|
||||
}
|
||||
|
||||
.service-row {
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.service-sales {
|
||||
font-size: 24rpx;
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
.service-price {
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.coupon-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6rpx;
|
||||
}
|
||||
|
||||
/* 券后标签 */
|
||||
.coupon-label {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #e8101e;
|
||||
line-height: 33rpx;
|
||||
}
|
||||
|
||||
.price-symbol {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #e8101e;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
|
||||
.price-value {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #e8101e;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.shop-text {
|
||||
font-size: 24rpx;
|
||||
color: #3d3d3d;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
/* APP适配 */
|
||||
/* #ifdef APP-PLUS */
|
||||
.service-item {
|
||||
transform: translateZ(0);
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
</style>
|
||||
|
|
@ -1,513 +0,0 @@
|
|||
<template>
|
||||
<view class="shop-list">
|
||||
<!-- 店铺列表 -->
|
||||
<scroll-view >
|
||||
<view
|
||||
class="shop-item"
|
||||
v-for="(shop, index) in shopList"
|
||||
@click.stop="goToArtisan($event, shop.id)"
|
||||
:key="shop.id"
|
||||
>
|
||||
<!-- 店铺信息 -->
|
||||
<view class="shop-header">
|
||||
<view class="shop-title">
|
||||
<view class="shop-title__left" style="width: 100%">
|
||||
<image
|
||||
:src="shop.head_photo"
|
||||
class="head-photo"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
<view class="title-info">
|
||||
<view class="name">
|
||||
<view class="name_text text-overflow-1">{{ shop.name }}</view>
|
||||
<view class="shop-distance" v-if="shop.distance >= 0">
|
||||
<image
|
||||
class="position"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/e37b3bd7-841f-4d57-a11a-2365c81f740e"
|
||||
/>
|
||||
<text class="shop-distance__right"
|
||||
>{{ shop.distance.toFixed(2) }}km</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<view class="time"
|
||||
>营业时间:<text class="num_medium_text">{{
|
||||
shop.business_time
|
||||
}}</text></view
|
||||
>
|
||||
<scroll-view scroll-x="true" class="shop-info-left">
|
||||
<view class="shop-info-left-list">
|
||||
<text class="shop-tags" v-for="(tag, i) in shop.servers_kill_arr">
|
||||
{{ tag }}
|
||||
</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 服务列表 -->
|
||||
<view class="service-list">
|
||||
<view
|
||||
class="service-item"
|
||||
v-for="(item, index) in shop.servers_list"
|
||||
:key="index"
|
||||
@click.stop="onServiceClick($event, item)"
|
||||
>
|
||||
<view class="service-price">
|
||||
<view
|
||||
:class="{
|
||||
discount: getPriceNum(item) !== '惠',
|
||||
discounts: getPriceNum(item) == '惠',
|
||||
}"
|
||||
v-if="getPriceNum(item)"
|
||||
>{{ getPriceNum(item) }}</view
|
||||
>
|
||||
<!-- 价格区域:根据 hasCoupon 显示券后价或原价 -->
|
||||
<view v-if="item.hasCoupon" class="price coupon-wrapper">
|
||||
<text class="coupon-label">券后</text>
|
||||
<text class="price-symbol">¥</text>
|
||||
<text class="price-value coupon-price">{{ item.coupon_price }}</text>
|
||||
</view>
|
||||
<view v-else class="price">
|
||||
<text class="price-symbol">¥</text>
|
||||
<text class="price-value">{{ (item.team_buy && item.team_buy.price) || item.server_price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="service-info">
|
||||
<view class="service-title">
|
||||
<image
|
||||
v-if="item.team_buy && Object.keys(item.team_buy).length != 0"
|
||||
class="service-title-type"
|
||||
mode="widthFix"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/c0744cbd-6386-4391-89fc-09223377431b"
|
||||
></image>
|
||||
<view class="title">
|
||||
<text class="service-title-text">
|
||||
{{ item.title }}
|
||||
</text>
|
||||
<view class="num"
|
||||
>销量<text style="font-family: DINPro, DINPro">{{
|
||||
item.sales_num
|
||||
}}</text></view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "shop-list",
|
||||
props: {
|
||||
// 服务列表数据
|
||||
shopList: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
// 是否显示多图布局
|
||||
isRefreshing: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
|
||||
methods: {
|
||||
getPriceNum(item) {
|
||||
if (item.team_buy && item.team_buy.price) {
|
||||
const discount =
|
||||
(item.team_buy.price* 10 / item.server_price).toFixed(1) ;
|
||||
if (discount < 0.1 || item.team_buy.price > 9999) {
|
||||
return "惠";
|
||||
} else {
|
||||
return `${discount}折`;
|
||||
}
|
||||
}
|
||||
},
|
||||
onServiceClick(e, service) {
|
||||
console.log("service", service);
|
||||
// #ifdef APP-PLUS
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
// #endif
|
||||
this.$emit("service-click", service);
|
||||
},
|
||||
goToArtisan(e, id) {
|
||||
// #ifdef APP-PLUS
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
// #endif
|
||||
this.$emit("go-artisan", id);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.shop-list{
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
.title-info {
|
||||
width: 100%;
|
||||
.name {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 500;
|
||||
line-height: 42rpx;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
.name_text {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
}
|
||||
.position {
|
||||
width: 19rpx;
|
||||
height: 21rpx;
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
}
|
||||
.time {
|
||||
font-weight: 500;
|
||||
font-size: 22rpx;
|
||||
color: #666666;
|
||||
margin-top: 13rpx;
|
||||
margin-bottom: 24rpx;
|
||||
line-height: 30rpx;
|
||||
.num_medium_text {
|
||||
font-size: 24rpx;
|
||||
line-height: 31rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.shop-item {
|
||||
width: 710rpx;
|
||||
background-color: #ffffff;
|
||||
margin-bottom: 24rpx;
|
||||
padding: 16rpx 24rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.shop-header {
|
||||
width: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.shop-title {
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
|
||||
&__left {
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.head-photo {
|
||||
flex-shrink: 0;
|
||||
width: 176rpx;
|
||||
height: 174rpx;
|
||||
background: #d8d8d8;
|
||||
border-radius: 20rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.title-text {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
max-width: 400rpx;
|
||||
font-weight: 500;
|
||||
margin-right: 8rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
/* 显示的行数 */
|
||||
lines: 1;
|
||||
}
|
||||
|
||||
.verified-icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.shop-info {
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.shop-info-left {
|
||||
width: 480rpx;
|
||||
.shop-info-left-list{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
gap: 14rpx;
|
||||
padding-right: 20rpx;
|
||||
.shop-tags {
|
||||
white-space: nowrap;
|
||||
border-radius: 16rpx;
|
||||
padding: 2rpx 14rpx;
|
||||
background-color: #f3f3f3;
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #666666;
|
||||
line-height: 28rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.rating {
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.rating-score {
|
||||
color: #ff94b4;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.rating-stars {
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.star-icon {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
|
||||
.divider {
|
||||
color: #eeeeee;
|
||||
margin: 0 16rpx;
|
||||
}
|
||||
|
||||
.shop-distance {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
font-size: 22rpx;
|
||||
color: #666666;
|
||||
font-family: DINPro, DINPro;
|
||||
font-weight: 500;
|
||||
|
||||
&__left {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
&__right {
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
line-height: 37rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.service-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 券后价包装器 */
|
||||
.coupon-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4rpx;
|
||||
}
|
||||
|
||||
/* 券后标签 */
|
||||
.coupon-label {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #e8101e;
|
||||
// background: #ffe9e9;
|
||||
// padding: 2rpx 8rpx;
|
||||
// border-radius: 20rpx;
|
||||
// margin-right: 4rpx;
|
||||
line-height: 37rpx;
|
||||
}
|
||||
|
||||
/* 券后价格 */
|
||||
.coupon-price {
|
||||
|
||||
}
|
||||
|
||||
.service-item {
|
||||
position: relative;
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
.service-price {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
width: 176rpx;
|
||||
.price {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
color: #e8101e;
|
||||
.price-symbol {
|
||||
font-family: DINPro, DINPro;
|
||||
font-weight: 500;
|
||||
font-size: 20rpx;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.price-value {
|
||||
font-family: DINPro, DINPro;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.service-info {
|
||||
flex: 1;
|
||||
padding-top: 12rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.service-title {
|
||||
margin-bottom: 16rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
line-height: 28rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
|
||||
/* 关键:使用flex布局让子元素同行显示 */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.service-title-type {
|
||||
width: 77rpx;
|
||||
/* 图片与文字之间的间距 */
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.service-title-text {
|
||||
/* 关键:移除固定宽度,使用flex自动分配剩余空间 */
|
||||
flex: 1;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
.discount {
|
||||
font-family: DINPro, DINPro;
|
||||
font-weight: 400;
|
||||
font-size: 22rpx;
|
||||
height: 28rpx;
|
||||
color: #e8101e;
|
||||
padding: 0 4rpx;
|
||||
border-radius: 4rpx;
|
||||
border: 1rpx solid rgba(216, 185, 191, 0.6);
|
||||
margin-right: 8rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.discounts {
|
||||
font-size: 22rpx;
|
||||
color: #e8101e;
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
background: #ffecf0;
|
||||
border-radius: 6rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.title {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
.num {
|
||||
margin-left: 21rpx;
|
||||
font-size: 22rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.price-text {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #E8101E;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
/* H5适配 */
|
||||
/* #ifdef H5 */
|
||||
.nearby-page {
|
||||
/* padding-top: 88rpx; */
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
|
||||
/* APP适配 */
|
||||
/* #ifdef APP-PLUS */
|
||||
.shop-item {
|
||||
transform: translateZ(0);
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
|
||||
/* 小程序适配 */
|
||||
/* #ifdef MP-WEIXIN */
|
||||
/* .nearby-page {
|
||||
padding-top: calc(88rpx + constant(safe-area-inset-top));
|
||||
padding-top: calc(88rpx + env(safe-area-inset-top));
|
||||
} */
|
||||
/* #endif */
|
||||
</style>
|
||||
|
|
@ -1,165 +0,0 @@
|
|||
<template>
|
||||
<view class="syr_card">
|
||||
<view :style="{ visibility: item.visible }" class="syr_item" v-for="(item, index) in showSyrList" :key="index"
|
||||
@click="onsyrClick(item)">
|
||||
<view class="imageBox">
|
||||
<image :src="item.head_photo" mode="aspectFill" class="syr_image"></image>
|
||||
<view class="distance">
|
||||
<image class="position"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/056d3548-9a6d-4ca7-8398-92078cfc47ab" />
|
||||
{{ item.distance.toFixed(2) }}km
|
||||
</view>
|
||||
</view>
|
||||
<view class="syr_info">
|
||||
<view class="syr_title_info">
|
||||
<view class="syr_title text-overflow-1">{{ item.name }}</view>
|
||||
<view class="time_info" v-if="item.earliest_reserve_time">
|
||||
<view class="time_tag">最早可约</view>
|
||||
<view class="time">{{
|
||||
item.earliest_reserve_time.slice(10, 16)
|
||||
}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="belong text-overflow-1">所属门店:{{ item.for_shop }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "syrCard",
|
||||
props: {
|
||||
syrList: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
showSyrList() {
|
||||
const len = this.syrList.length % 2;
|
||||
return len == 1 && len ?
|
||||
[...this.syrList, {
|
||||
...this.syrList[0],
|
||||
visible: "hidden"
|
||||
}] :
|
||||
this.syrList;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onsyrClick(syr) {
|
||||
this.$emit("syr-click", syr);
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.syr_card {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: 20rpx 18rpx;
|
||||
}
|
||||
|
||||
.syr_item {
|
||||
box-sizing: border-box;
|
||||
width: 346rpx;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.05);
|
||||
|
||||
.imageBox {
|
||||
width: 346rpx;
|
||||
height: 346rpx;
|
||||
position: relative;
|
||||
|
||||
.distance {
|
||||
position: absolute;
|
||||
font-family: DINPro, DINPro;
|
||||
font-weight: 500;
|
||||
font-size: 20rpx;
|
||||
color: #ffffff;
|
||||
bottom: 14rpx;
|
||||
left: 14rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6rpx;
|
||||
background-color: rgba(102, 102, 102, 0.6);
|
||||
padding: 4rpx 10rpx;
|
||||
border-radius: 100rpx;
|
||||
overflow: hidden;
|
||||
|
||||
.position {
|
||||
width: 12rpx;
|
||||
height: 15rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.syr_image {
|
||||
width: 346rpx;
|
||||
height: 346rpx;
|
||||
}
|
||||
|
||||
.syr_info {
|
||||
padding: 20rpx 10rpx;
|
||||
|
||||
.belong {
|
||||
font-size: 22rpx;
|
||||
color: #8d8d8d;
|
||||
width: 100%;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.syr_title_info {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
|
||||
.syr_title {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.time_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 18rpx;
|
||||
// overflow: hidden;
|
||||
|
||||
.time_tag {
|
||||
border-radius: 6rpx 0 0 6rpx;
|
||||
background-color: #e8101e;
|
||||
color: #fff;
|
||||
height: 31rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 4rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
color: #e8101e;
|
||||
border: 1rpx solid #e8101e;
|
||||
font-family: DINPro, DINPro;
|
||||
font-weight: 500;
|
||||
border-radius: 0 6rpx 6rpx 0;
|
||||
height: 29rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 8rpx 0 1rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,162 +0,0 @@
|
|||
<template>
|
||||
<view class="transferMoney">
|
||||
<button @click="goWxPage">测试</button>
|
||||
<button @click="getOpenId">获取code</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// #ifdef APP-PLUS
|
||||
import {
|
||||
requestMerchantTransfer
|
||||
} from "@/uni_modules/uni-requestMerchantTransfer";
|
||||
// #endif
|
||||
|
||||
import request from "@/utils/request";
|
||||
export default {
|
||||
name: "transferMoney",
|
||||
props: {
|
||||
lotteryId: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
|
||||
methods: {
|
||||
getOpenId() {
|
||||
console.log("调用登录接口获取openid");
|
||||
uni.login({
|
||||
provider: "weixin",
|
||||
onlyAuthorize: true,
|
||||
success: (loginRes) => {
|
||||
// console.log("loginRes:", loginRes);
|
||||
const code = loginRes.code;
|
||||
if (code) {
|
||||
request
|
||||
.post("/withdrawal/getopenid", {
|
||||
code
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("获取openid成功:", res.openid);
|
||||
|
||||
if (res.openid) {
|
||||
uni.setStorageSync("app_openid", res.openid);
|
||||
this.goWxPage();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
// console.error("获取openid失败:", err);
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: function(err) {
|
||||
console.error("登录接口调用失败:", err);
|
||||
},
|
||||
});
|
||||
},
|
||||
goWxPage() {
|
||||
const openid = uni.getStorageSync("app_openid");
|
||||
if (!openid) {
|
||||
this.getOpenId();
|
||||
return;
|
||||
}
|
||||
const lottery_id = this.lotteryId;
|
||||
console.log(
|
||||
"开始发起企业付款,openid:",
|
||||
openid,
|
||||
" lottery_id:",
|
||||
lottery_id
|
||||
);
|
||||
request
|
||||
.post("/withdrawal/transferother", {
|
||||
lottery_id,
|
||||
openid_app: openid
|
||||
})
|
||||
.then((wxPayRes) => {
|
||||
console.log("wxpay res:", wxPayRes);
|
||||
if (wxPayRes.code != 200) {
|
||||
uni.showToast({
|
||||
title: "领取失败,请稍后重试",
|
||||
icon: "none",
|
||||
});
|
||||
return;
|
||||
}
|
||||
requestMerchantTransfer({
|
||||
mchId: wxPayRes.data.mch_id,
|
||||
appId: wxPayRes.data.appid,
|
||||
package: wxPayRes.data.package_info,
|
||||
success: (res) => {
|
||||
console.log("requestMerchantTransfer ", res);
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res.errMsg, '失败');
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error("wxpay err:", err);
|
||||
});
|
||||
},
|
||||
checkSystemType() {
|
||||
try {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const {
|
||||
platform,
|
||||
system
|
||||
} = systemInfo;
|
||||
let systemType = "";
|
||||
|
||||
// 优先通过 system 字段判断鸿蒙(兼容模式下 platform 仍为 android,但 system 含 HarmonyOS)
|
||||
if (system.includes("HarmonyOS")) {
|
||||
systemType = "harmony"; // 鸿蒙系统(兼容/原生)
|
||||
// 进一步区分鸿蒙原生 vs 安卓兼容模式
|
||||
if (platform === "harmony") {
|
||||
systemType = "harmony_original"; // 纯鸿蒙原生模式
|
||||
} else if (platform === "android") {
|
||||
systemType = "harmony_android"; // 鸿蒙安卓兼容模式
|
||||
}
|
||||
} else if (platform === "android") {
|
||||
systemType = "android"; // 纯安卓系统(非鸿蒙)
|
||||
} else if (platform === "ios") {
|
||||
systemType = "ios"; // iOS 系统
|
||||
} else {
|
||||
systemType = "other"; // 小程序/PC/其他系统
|
||||
}
|
||||
|
||||
// const { isHarmony, systemType } = this.checkSystemType();
|
||||
// if (isHarmony) {
|
||||
// console.log("当前是鸿蒙系统");
|
||||
// if (systemType === "harmony_original") {
|
||||
// console.log("纯鸿蒙原生模式");
|
||||
// } else if (systemType === "harmony_android") {
|
||||
// console.log("鸿蒙安卓兼容模式");
|
||||
// }
|
||||
// } else if (systemType === "android") {
|
||||
// console.log("当前是纯安卓系统");
|
||||
// } else if (systemType === "ios") {
|
||||
// console.log("当前是iOS系统");
|
||||
// }
|
||||
|
||||
return {
|
||||
systemType, // 系统类型:harmony/harmony_original/harmony_android/android/ios/other
|
||||
systemInfo, // 完整系统信息(含版本、设备型号等)
|
||||
isHarmony: system.includes("HarmonyOS"), // 是否为鸿蒙系统(布尔值)
|
||||
};
|
||||
} catch (err) {
|
||||
console.error("检测系统类型失败", err);
|
||||
return {
|
||||
systemType: "unknown",
|
||||
isHarmony: false
|
||||
};
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.transferMoney {}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,343 @@
|
|||
<template>
|
||||
<view class="order-card" @click="goDetail">
|
||||
<!-- 订单编号 -->
|
||||
<view class="orderNumBox">
|
||||
<view class="order-id white-space-nowrap">订单编号:{{ dataItem.number }}</view>
|
||||
<view class="stateText" :class="{
|
||||
stateText2: dataItem.state > 4 && dataItem.state !== 7, // 排除已取消
|
||||
stateText3: dataItem.state === 7 // 已取消状态单独处理
|
||||
}" v-if="showState">
|
||||
{{ stateText }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 服务信息区域 -->
|
||||
<view class="service-container" @click="$emit('goOrderDetail', dataItem)">
|
||||
<image class="service-img" :src="photo[0]" mode="aspectFill"></image>
|
||||
<view class="service-info">
|
||||
<view class="topInfo">
|
||||
<view class="price_title">
|
||||
<view class="service-type white-space-nowrap">{{
|
||||
dataItem.title
|
||||
}}</view>
|
||||
|
||||
</view>
|
||||
<view class="service-address">下单时间:{{ dataItem.add_time }}</view>
|
||||
</view>
|
||||
<view class="service-price"><text style="font-size: 24rpx;">¥</text>{{ Number(dataItem.order_money) }}
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 时间信息 -->
|
||||
<view class="time-info"><text style="color:#999999 ;">服务时段:</text>{{ useTime }}</view>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<view class="button-group" v-if="dataItem.state > 1 && dataItem.state < 5">
|
||||
<view class="btn cancel-btn" v-if="dataItem.state == 2 || dataItem.state == 3" @click.stop="emitCancel">取消订单
|
||||
</view>
|
||||
<view class="btn accept-btn" @click.stop="emitAccept" v-if="dataItem.state == 2">接单</view>
|
||||
<view class="btn accept-btn" @click.stop="emitStart" v-if="dataItem.state == 3">开始订单</view>
|
||||
<view class="btn accept-btn" @click.stop="emitDone" v-if="dataItem.state == 4">完成订单</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "OrderCard",
|
||||
props: {
|
||||
dataItem: {
|
||||
type: Object,
|
||||
},
|
||||
typeId: {
|
||||
type: Number,
|
||||
},
|
||||
showState: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
photo() {
|
||||
return this.dataItem.photo? JSON.parse(this.dataItem.photo):"";
|
||||
},
|
||||
useTime() {
|
||||
const start = this.dataItem.reserve_start_time;
|
||||
const endTime = this.dataItem.reserve_end_time;
|
||||
|
||||
function formatTimeRange(startTimeStr, endTimeStr) {
|
||||
if (!startTimeStr || !endTimeStr) return "未设置";
|
||||
|
||||
// 解析开始时间为Date对象
|
||||
const startTime = new Date(startTimeStr.replace(/-/g, '/'));
|
||||
const endTime = new Date(endTimeStr.replace(/-/g, '/'));
|
||||
|
||||
if (isNaN(startTime.getTime()) || isNaN(endTime.getTime())) {
|
||||
console.error("无效的时间格式");
|
||||
return "时间格式错误";
|
||||
}
|
||||
|
||||
// 格式化年份:YYYY年
|
||||
const formatYear = (date) => {
|
||||
return date.getFullYear() + '年';
|
||||
};
|
||||
|
||||
// 格式化月份和日期:MM月DD
|
||||
const formatMonthDay = (date) => {
|
||||
const month = String(date.getMonth() + 1).padStart(2, "0");
|
||||
const day = String(date.getDate()).padStart(2, "0");
|
||||
return `${month}月${day}`;
|
||||
};
|
||||
|
||||
// 格式化时间部分:HH:MM
|
||||
const formatTimePart = (date) => {
|
||||
const hours = String(date.getHours()).padStart(2, "0");
|
||||
const minutes = String(date.getMinutes()).padStart(2, "0");
|
||||
return `${hours}:${minutes}`;
|
||||
};
|
||||
|
||||
// 判断是否同一天
|
||||
const isSameDay = startTime.getFullYear() === endTime.getFullYear() &&
|
||||
startTime.getMonth() === endTime.getMonth() &&
|
||||
startTime.getDate() === endTime.getDate();
|
||||
|
||||
if (isSameDay) {
|
||||
// 同一天:2025年05月29 12:30-13:30
|
||||
return `${formatYear(startTime)}${formatMonthDay(startTime)} ${formatTimePart(startTime)}-${formatTimePart(endTime)}`;
|
||||
} else {
|
||||
// 跨天:2025年05月29 12:30-2025年05月30 13:30
|
||||
return `${formatYear(startTime)}${formatMonthDay(startTime)} ${formatTimePart(startTime)}-${formatYear(endTime)}${formatMonthDay(endTime)} ${formatTimePart(endTime)}`;
|
||||
}
|
||||
}
|
||||
return formatTimeRange(start, endTime);
|
||||
},
|
||||
stateText() {
|
||||
const textList = [
|
||||
"",
|
||||
"待支付",
|
||||
"待接单",
|
||||
"待开始",
|
||||
"进行中",
|
||||
"已完成",
|
||||
"已评价",
|
||||
"已取消",
|
||||
];
|
||||
return textList[this.dataItem.state];
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 触发取消事件
|
||||
emitCancel() {
|
||||
this.$emit("cancel", this.dataItem);
|
||||
},
|
||||
// 触发接单事件
|
||||
emitAccept() {
|
||||
this.$emit("accept", this.dataItem);
|
||||
},
|
||||
emitStart() {
|
||||
this.$emit("start", this.dataItem);
|
||||
},
|
||||
emitDone() {
|
||||
this.$emit("done", this.dataItem);
|
||||
},
|
||||
goDetail() {
|
||||
this.$emit("goDetail", this.dataItem);
|
||||
},
|
||||
emitGoPay() {
|
||||
this.$emit("goPay", this.dataItem);
|
||||
},
|
||||
emitRefund() {
|
||||
this.$emit("goRefund", this.dataItem);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.order-card {
|
||||
position: relative; // 必须加,确保父容器有定位
|
||||
padding: 24rpx 20rpx 0rpx;
|
||||
margin: 0rpx 30rpx 20rpx 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 12px;
|
||||
/* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); */
|
||||
}
|
||||
|
||||
.orderNumBox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 40rpx;
|
||||
|
||||
.stateText {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #E8101E;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
background-image: url("/static/images/icons/tabBj.png");
|
||||
background-size: 100% auto;
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
width: 128rpx;
|
||||
height: 49rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.stateText2 {
|
||||
background-image: url("/static/images/icons/tabBj2.png");
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.stateText3 {
|
||||
background-image: url("/static/images/icons/tabBj2.png");
|
||||
color: #999999 !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* 订单编号 */
|
||||
.order-id {
|
||||
width: 530rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
/* 服务信息容器 */
|
||||
.service-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-bottom: 24rpx;
|
||||
border-bottom: 1px solid #f6f5f5;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 服务图片 */
|
||||
.service-img {
|
||||
width: 172rpx;
|
||||
height: 168rpx;
|
||||
border-radius: 24rpx;
|
||||
margin-right: 30rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 服务信息 */
|
||||
.service-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
height: 168rpx;
|
||||
|
||||
.topInfo {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.price_title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.service-type {
|
||||
font-weight: 500;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
line-height: 34rpx;
|
||||
max-width: 300rpx;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.service-price {
|
||||
font-family: DINPro, DINPro;
|
||||
font-weight: 500;
|
||||
font-size: 36rpx;
|
||||
color: #E8101E;
|
||||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.service_subTitle {
|
||||
font-size: 26rpx;
|
||||
line-height: 26rpx;
|
||||
color: #666666;
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.service-address {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
/* 时间信息 */
|
||||
.time-info {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
padding-bottom: 20rpx;
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
|
||||
/* 按钮组 */
|
||||
.button-group {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 30rpx;
|
||||
padding-bottom: 30rpx;
|
||||
}
|
||||
|
||||
/* 通用按钮样式 */
|
||||
.btn {
|
||||
white-space: nowrap;
|
||||
width: 100rpx;
|
||||
height: 32rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 10px 20px;
|
||||
border-radius: 64rpx;
|
||||
// box-sizing: border-box;
|
||||
//height: 64rpx;
|
||||
//border-radius: 32rpx;
|
||||
border: 2rpx solid #979797;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
line-height: 64rpx;
|
||||
// padding: 0 28rpx;
|
||||
|
||||
}
|
||||
|
||||
/* 取消按钮 */
|
||||
.cancel-btn {
|
||||
border: 2rpx solid #979797;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
/* 接单按钮 */
|
||||
.accept-btn {
|
||||
border: 2rpx solid #E8101E;
|
||||
color: #E8101E;
|
||||
}
|
||||
</style>
|
||||
1965
pages/home/home.vue
1965
pages/home/home.vue
File diff suppressed because it is too large
Load Diff
|
|
@ -1,165 +0,0 @@
|
|||
<template>
|
||||
<view class="transferMoney">
|
||||
<button @click="goWxPage">测试</button>
|
||||
<button @click="getOpenId">获取code</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// #ifdef APP-PLUS
|
||||
import {
|
||||
requestMerchantTransfer
|
||||
} from "@/uni_modules/uni-requestMerchantTransfer";
|
||||
// #endif
|
||||
|
||||
import request from "@/utils/request";
|
||||
export default {
|
||||
name: "transferMoney",
|
||||
props: {
|
||||
lotteryId: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
|
||||
methods: {
|
||||
getOpenId() {
|
||||
console.log("调用登录接口获取openid");
|
||||
uni.login({
|
||||
provider: "weixin",
|
||||
onlyAuthorize: true,
|
||||
success: (loginRes) => {
|
||||
console.log("loginRes:", loginRes);
|
||||
const code = loginRes.code;
|
||||
if (code) {
|
||||
|
||||
request
|
||||
.post("/user/user/getOpenidApp", {
|
||||
code
|
||||
})
|
||||
.then((res) => {
|
||||
if(res.code==200){
|
||||
console.log("获取openid成功:", res);
|
||||
|
||||
if (res.data.openid) {
|
||||
uni.setStorageSync("app_openid", res.data.openid);
|
||||
this.goWxPage();
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error("获取openid失败:", err);
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: function(err) {
|
||||
console.error("登录接口调用失败:", err);
|
||||
},
|
||||
});
|
||||
},
|
||||
goWxPage() {
|
||||
const openid = uni.getStorageSync("app_openid");
|
||||
if (!openid) {
|
||||
this.getOpenId();
|
||||
return;
|
||||
}
|
||||
const id = this.lotteryId;
|
||||
console.log(
|
||||
"开始发起企业付款,openid:",
|
||||
openid,
|
||||
" id:",
|
||||
id
|
||||
);
|
||||
request
|
||||
.post("/user/lottery/claimRedPacket", {
|
||||
id,
|
||||
openid: openid
|
||||
})
|
||||
.then((wxPayRes) => {
|
||||
console.log("wxpay res:", wxPayRes);
|
||||
if (wxPayRes.code != 200) {
|
||||
uni.showToast({
|
||||
title: "领取失败,请稍后重试",
|
||||
icon: "none",
|
||||
});
|
||||
return;
|
||||
}
|
||||
requestMerchantTransfer({
|
||||
mchId: wxPayRes.data.mch_id,
|
||||
appId: wxPayRes.data.appid,
|
||||
package: wxPayRes.data.package_info,
|
||||
success: (res) => {
|
||||
console.log("requestMerchantTransfer ", res);
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res.errMsg, '失败');
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error("wxpay err:", err);
|
||||
});
|
||||
},
|
||||
checkSystemType() {
|
||||
try {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const {
|
||||
platform,
|
||||
system
|
||||
} = systemInfo;
|
||||
let systemType = "";
|
||||
|
||||
// 优先通过 system 字段判断鸿蒙(兼容模式下 platform 仍为 android,但 system 含 HarmonyOS)
|
||||
if (system.includes("HarmonyOS")) {
|
||||
systemType = "harmony"; // 鸿蒙系统(兼容/原生)
|
||||
// 进一步区分鸿蒙原生 vs 安卓兼容模式
|
||||
if (platform === "harmony") {
|
||||
systemType = "harmony_original"; // 纯鸿蒙原生模式
|
||||
} else if (platform === "android") {
|
||||
systemType = "harmony_android"; // 鸿蒙安卓兼容模式
|
||||
}
|
||||
} else if (platform === "android") {
|
||||
systemType = "android"; // 纯安卓系统(非鸿蒙)
|
||||
} else if (platform === "ios") {
|
||||
systemType = "ios"; // iOS 系统
|
||||
} else {
|
||||
systemType = "other"; // 小程序/PC/其他系统
|
||||
}
|
||||
|
||||
// const { isHarmony, systemType } = this.checkSystemType();
|
||||
// if (isHarmony) {
|
||||
// console.log("当前是鸿蒙系统");
|
||||
// if (systemType === "harmony_original") {
|
||||
// console.log("纯鸿蒙原生模式");
|
||||
// } else if (systemType === "harmony_android") {
|
||||
// console.log("鸿蒙安卓兼容模式");
|
||||
// }
|
||||
// } else if (systemType === "android") {
|
||||
// console.log("当前是纯安卓系统");
|
||||
// } else if (systemType === "ios") {
|
||||
// console.log("当前是iOS系统");
|
||||
// }
|
||||
|
||||
return {
|
||||
systemType, // 系统类型:harmony/harmony_original/harmony_android/android/ios/other
|
||||
systemInfo, // 完整系统信息(含版本、设备型号等)
|
||||
isHarmony: system.includes("HarmonyOS"), // 是否为鸿蒙系统(布尔值)
|
||||
};
|
||||
} catch (err) {
|
||||
console.error("检测系统类型失败", err);
|
||||
return {
|
||||
systemType: "unknown",
|
||||
isHarmony: false
|
||||
};
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.transferMoney {}
|
||||
</style>
|
||||
|
|
@ -1,656 +0,0 @@
|
|||
<template>
|
||||
<view class="lottery-page">
|
||||
<custom-navbar title="活动页面" :showUser="true" backgroundColor="#fff" borderBottom="none"></custom-navbar>
|
||||
<view class="content" :style="{backgroundImage: `url(${activityDetails.back_img})` }">
|
||||
<image class="lottery-rule" src="/static/images/icons/lottery-rule.png" @click="openRule"></image>
|
||||
<view class="lottery">
|
||||
<image :src="activityDetails.lottery_img" class="lottery-bj"></image>
|
||||
<view class="lottery-card">
|
||||
<dengbo-lotteryGrid ref="lottery" @lottery-end="onLotteryEnd" :prizes="prizes" v-if="prizes.length">
|
||||
<template slot="centerButton">
|
||||
<view class="lottery-card-center">
|
||||
<view class="lottery-card-center-text" style="padding-top: 40rpx;">
|
||||
剩余{{ activityDetails.user_num }}次</view>
|
||||
<view class="lottery-card-center-text">抽奖机会</view>
|
||||
</view>
|
||||
</template>
|
||||
</dengbo-lotteryGrid>
|
||||
</view>
|
||||
<view class="lottery-button" @click="startLottery"></view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="lottery-method" v-if="activityMethod && activityMethod.length">
|
||||
<view class="lottery-method-header">
|
||||
<image class="lottery-method-header" src="/static/images/background/lotteryBj13.png"
|
||||
mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="lottery-method-content">
|
||||
<view class="lottery-method-content-item" v-for="(item,index) in activityMethod" :key="index">
|
||||
{{ item.text }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="award-winning">
|
||||
<view class="winning-heard">
|
||||
<image class="winning-heard" src="/static/images/background/lotteryBj3.png"></image>
|
||||
</view>
|
||||
<view class="winning-content" v-if="recordList && recordList.length">
|
||||
|
||||
<view class="winning-item flex-row-center-between" v-for="(item,index) in recordList" :key="index">
|
||||
<view class="flex-row-center">
|
||||
<view class="winning-item-left">
|
||||
<image class="winning-item-left-img" :src="item.prize_img " mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="winning-item-center">
|
||||
<view class="winning-item-center-text1">{{ item.prize_name }}</view>
|
||||
<view class="winning-item-center-text2">{{ item.lottery_time }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="winning-item-right flex-row-center-center" @click="goDetail(item.id)">去查看</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="winning-content flex-row-center-center" v-else>
|
||||
<view class="winning-item-no ">
|
||||
<image src="/static/images/shop/noPrize.png" class="winning-item-no-img"></image>
|
||||
<view class="winning-item-no-text">暂无中奖记录哟~</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="winning-footer">
|
||||
<image class="winning-footer" src="/static/images/background/lotteryBj3-footer.png"></image>
|
||||
<image class="winning-more" v-if="recordList && recordList.length" @click="goList"
|
||||
src="/static/images/background/lottery-more.png">
|
||||
</image>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<uv-popup ref="popup1" bgColor="transparent">
|
||||
<view class="popup1-close" @click="closeRule">
|
||||
<image class="popup1-close-img" src="/static/images/icons/lottery-close.png"></image>
|
||||
</view>
|
||||
<view class="popup1-content">
|
||||
<scroll-view scroll-y class="popup1-content-scroll">
|
||||
<uv-parse :content="activityDetails.rule_text"></uv-parse>
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
</uv-popup>
|
||||
|
||||
<uv-popup ref="popup2" bgColor="transparent">
|
||||
<view class="popup2-noWin" :class="{popup2NoWin2:activityDetails.user_num==0}" v-if="drawResule.type==1">
|
||||
<view class="popup2-noWin-btn" @click="noWinClick"></view>
|
||||
</view>
|
||||
<view class="popup2-content" v-else>
|
||||
<view class="popup2-content-title">恭喜你获得</view>
|
||||
<view class="popup2-content-card">
|
||||
<image class="popup2-content-card-img" :src="drawResule.simple_img"></image>
|
||||
<view class="popup2-content-card-texts">
|
||||
<view class="popup2-content-card-text1">{{ drawResule.show_text }}</view>
|
||||
<view class="popup2-content-card-text2">兑换方式:{{ drawResule.type==2?"线上 ":"邮寄"}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="popup2-content-time">请在{{ drawResule.claim_deadline }}前兑换</view>
|
||||
<view class="popup2-content-btn flex-row-center-center" v-if="activityDetails.user_num==0"
|
||||
@click="goDetail(drawResule.record_id)">去领奖</view>
|
||||
<view class="popup2-content-btn flex-row-center-center" v-else @click="continueDraw">继续抽奖</view>
|
||||
<view class="popup2-content-go flex-row-center-center" @click="goList">
|
||||
<text>查看礼品</text>
|
||||
<image class="popup2-content-go-cion" src="/static/images/icons/lottery-right.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="popup2-close" @click="close">
|
||||
<image class="popup2-close-img" src="/static/images/icons/lottery-close.png"></image>
|
||||
</view>
|
||||
</uv-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from "@/utils/request";
|
||||
import transferMoney from "./components/transferMoney.vue";
|
||||
import dengboLotteryGrid from "@/components/dengbo-lotteryGrid/components/dengbo-lotteryGrid/dengbo-lotteryGrid.vue";
|
||||
export default {
|
||||
components: {
|
||||
transferMoney,
|
||||
dengboLotteryGrid
|
||||
},
|
||||
name: "LotteryIndex",
|
||||
data() {
|
||||
return {
|
||||
isSubmit: false,
|
||||
activity_id: 1, //活动id
|
||||
recordList: [], //中奖列表
|
||||
activityDetails: {},
|
||||
prizeItemStyle: {
|
||||
borderRadius: '10rpx',
|
||||
fontWeight: '500',
|
||||
fontSize: '23rpx',
|
||||
color: '#E26E30',
|
||||
},
|
||||
prizes: [],
|
||||
drawResule: {},
|
||||
activityMethod: []
|
||||
}
|
||||
},
|
||||
async onLoad(options) {
|
||||
if (options.activity_id) {
|
||||
this.activity_id = options.activity_id
|
||||
}
|
||||
this.getActivityDetails()
|
||||
this.getActivityMethod()
|
||||
this.record()
|
||||
},
|
||||
methods: {
|
||||
goDetail(id) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/lottery/winDetail?id=${id}`
|
||||
});
|
||||
this.close()
|
||||
},
|
||||
goList() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/lottery/list?activity_id=${this.activity_id}`
|
||||
});
|
||||
this.close()
|
||||
},
|
||||
close() {
|
||||
this.$refs.popup2.close();
|
||||
},
|
||||
open() {
|
||||
this.$refs.popup2.open('center');
|
||||
},
|
||||
closeRule() {
|
||||
this.$refs.popup1.close();
|
||||
},
|
||||
openRule() {
|
||||
this.$refs.popup1.open('bottom');
|
||||
},
|
||||
async getActivityDetails() {
|
||||
await request.post("/user/lottery/getActivityDetails", {
|
||||
id: this.activity_id
|
||||
}).then(async (res) => {
|
||||
if (res.code == 200) {
|
||||
this.activityDetails = res.data
|
||||
this.prizes = res.data.prize_list
|
||||
this.activityDetails.back_img = await this.getImagePath(res.data.back_img)
|
||||
this.activityDetails.lottery_img = await this.getImagePath(res.data.lottery_img)
|
||||
await this.activityDetails.prize_list.forEach(async (item)=>{
|
||||
item.simple_img = await this.getImagePath(item.simple_img)
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
async getActivityMethod() {
|
||||
await request.post("/user/lottery/getActivityMethod", {
|
||||
activity_id: this.activity_id
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.activityMethod = res.data.list
|
||||
}
|
||||
});
|
||||
},
|
||||
async record() {
|
||||
await request.post("/user/lottery/record", {
|
||||
activity_id: this.activity_id,
|
||||
page: 1,
|
||||
limit: 5,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.recordList = res.data.list
|
||||
}
|
||||
});
|
||||
},
|
||||
noWinClick() {
|
||||
if (this.activityDetails.user_num > 0) {
|
||||
this.continueDraw()
|
||||
} else {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}
|
||||
},
|
||||
//继续抽奖
|
||||
continueDraw() {
|
||||
this.close()
|
||||
this.startLottery()
|
||||
},
|
||||
startLottery() {
|
||||
if (this.isSubmit && this.prizes.length > 0) {
|
||||
return
|
||||
}
|
||||
console.log("开始抽奖")
|
||||
this.isSubmit = true
|
||||
request.post("/user/lottery/draw", {
|
||||
id: this.activity_id,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
if (res.data?.id) {
|
||||
// // 开始抽奖
|
||||
// this.isLotteryRunning = true;
|
||||
this.drawResule = res.data
|
||||
this.$refs.lottery.startLottery(res.data.id);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "抽奖错误",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
});
|
||||
this.isSubmit = false
|
||||
}
|
||||
}).catch((err) => {
|
||||
this.isSubmit = false
|
||||
})
|
||||
|
||||
},
|
||||
onLotteryEnd(prize) {
|
||||
setTimeout(() => {
|
||||
this.isSubmit = false
|
||||
}, 100)
|
||||
|
||||
if (this.activityDetails.user_num >= 1) {
|
||||
this.activityDetails.user_num = this.activityDetails.user_num - 1
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.open()
|
||||
this.record()
|
||||
this.$refs.lottery.clearLotteryState();
|
||||
}, 300)
|
||||
|
||||
|
||||
console.log(prize)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.lottery-page {
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background-size: 100% auto;
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
padding-bottom: 58rpx;
|
||||
position: relative;
|
||||
|
||||
.lottery-rule {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 218rpx;
|
||||
width: 133rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
.lottery {
|
||||
margin-top: 264rpx;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 703rpx;
|
||||
height: 780rpx;
|
||||
|
||||
.lottery-bj {
|
||||
width: 703rpx;
|
||||
height: 780rpx;
|
||||
}
|
||||
|
||||
.lottery-card {
|
||||
width: 450rpx;
|
||||
height: 450rpx;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-52%, -51%);
|
||||
|
||||
.lottery-card-center {
|
||||
width: 142rpx;
|
||||
height: 142rpx;
|
||||
background-image: url("/static/images/background/lotteryBj5.png");
|
||||
background-size: cover;
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
.lottery-card-center-text {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #FAE1D2;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.lottery-button {
|
||||
width: 310rpx;
|
||||
height: 135rpx;
|
||||
position: absolute;
|
||||
bottom: 14rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
.lottery-method {
|
||||
width: 689rpx;
|
||||
margin: 0 auto;
|
||||
margin-top: 64rpx;
|
||||
|
||||
.lottery-method-header {
|
||||
width: 689rpx;
|
||||
height: 99rpx;
|
||||
}
|
||||
|
||||
.lottery-method-content {
|
||||
border-radius: 0 0 30rpx 30rpx;
|
||||
background: #FCF0E2;
|
||||
|
||||
.lottery-method-content-item {
|
||||
padding: 30rpx 0rpx;
|
||||
margin: 0rpx 24rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #343433;
|
||||
line-height: 40rpx;
|
||||
border-bottom: 1rpx solid #E5D9CA;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.award-winning {
|
||||
width: 689rpx;
|
||||
margin-top: 40rpx;
|
||||
|
||||
.winning-heard {
|
||||
width: 689rpx;
|
||||
height: 125rpx;
|
||||
}
|
||||
|
||||
.winning-footer {
|
||||
width: 689rpx;
|
||||
height: 109rpx;
|
||||
position: relative;
|
||||
|
||||
.winning-more {
|
||||
position: absolute;
|
||||
width: 160rpx;
|
||||
height: 48rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
bottom: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.winning-content {
|
||||
background: #fcf0e2;
|
||||
width: 689rpx;
|
||||
min-height: 100rpx;
|
||||
padding: 0 22rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
gap: 21rpx;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.winning-item-no {
|
||||
.winning-item-no-img {
|
||||
width: 290rpx;
|
||||
height: 192rpx;
|
||||
}
|
||||
|
||||
.winning-item-no-text {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #908981;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.winning-item {
|
||||
width: 634rpx;
|
||||
padding: 26rpx 20rpx;
|
||||
box-sizing: border-box;
|
||||
background: #FEE9CE;
|
||||
border-radius: 20rpx;
|
||||
border: 1px solid #FEDEBE;
|
||||
|
||||
.winning-item-left {
|
||||
width: 89rpx;
|
||||
height: 89rpx;
|
||||
background: #FCF0E2;
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
|
||||
.winning-item-left-img {
|
||||
width: 68rpx;
|
||||
height: 72rpx;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.winning-item-center {
|
||||
margin-left: 19rpx;
|
||||
max-width: 320rpx;
|
||||
.winning-item-center-text1 {
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #76200A;
|
||||
}
|
||||
|
||||
.winning-item-center-text2 {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #A86A4A;
|
||||
}
|
||||
}
|
||||
|
||||
.winning-item-right {
|
||||
width: 140rpx;
|
||||
height: 58rpx;
|
||||
background-image: url("/static/images/background/lotteryBj6.png");
|
||||
background-size: cover;
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.popup1-close {
|
||||
height: 67rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
.popup1-close-img {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.popup1-content {
|
||||
background-image: url("/static/images/background/lotteryBj7.png");
|
||||
background-size: 100% auto;
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
width: 750rpx;
|
||||
height: 1250rpx;
|
||||
max-height: 80vh;
|
||||
|
||||
.popup1-content-scroll {
|
||||
padding: 263rpx 40rpx 0 40rpx;
|
||||
box-sizing: border-box;
|
||||
height: 1250rpx;
|
||||
max-height: 80vh;
|
||||
}
|
||||
}
|
||||
|
||||
.popup2-close {
|
||||
height: 61rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 58rpx;
|
||||
|
||||
.popup2-close-img {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.popup2-noWin {
|
||||
background-image: url("/static/images/background/lotteryBj12.png");
|
||||
background-size: 100% auto;
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
width: 644rpx;
|
||||
height: 845rpx;
|
||||
position: relative;
|
||||
|
||||
.popup2-noWin-btn {
|
||||
width: 322rpx;
|
||||
height: 107rpx;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
bottom: 46rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.popup2NoWin2 {
|
||||
background-image: url("/static/images/background/lotteryBj11.png");
|
||||
}
|
||||
|
||||
.popup2-content {
|
||||
background-image: url("/static/images/background/lotteryBj8.png");
|
||||
background-size: 100% auto;
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
width: 644rpx;
|
||||
height: 907rpx;
|
||||
|
||||
.popup2-content-title {
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #831903;
|
||||
line-height: 42rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
padding-top: 373rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.popup2-content-card {
|
||||
background-image: url("/static/images/background/lotteryBj9.png");
|
||||
background-size: cover;
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
width: 562rpx;
|
||||
height: 152rpx;
|
||||
margin: 14rpx 41rpx 0 41rpx;
|
||||
position: relative;
|
||||
|
||||
.popup2-content-card-img {
|
||||
width: 107rpx;
|
||||
height: 107rpx;
|
||||
position: absolute;
|
||||
left: 28rpx;
|
||||
top: 28rpx;
|
||||
border-radius: 10rpx;
|
||||
// background: red;
|
||||
}
|
||||
|
||||
.popup2-content-card-texts {
|
||||
position: absolute;
|
||||
left: 268rpx;
|
||||
top: 32rpx;
|
||||
|
||||
.popup2-content-card-text1 {
|
||||
font-weight: 500;
|
||||
font-size: 36rpx;
|
||||
color: #FFFFFF;
|
||||
line-height: 50rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-left: 15rpx;
|
||||
}
|
||||
|
||||
.popup2-content-card-text2 {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #FDF1F1;
|
||||
line-height: 37rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.popup2-content-time {
|
||||
margin-top: 20rpx;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #B37760;
|
||||
line-height: 37rpx;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
|
||||
.popup2-content-btn {
|
||||
margin: 0 auto;
|
||||
background-image: url("/static/images/background/lotteryBj10.png");
|
||||
background-size: cover;
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
width: 322rpx;
|
||||
height: 107rpx;
|
||||
font-weight: 500;
|
||||
font-size: 42rpx;
|
||||
color: #FFFFFF;
|
||||
text-shadow: 0px 2px 7px rgba(0, 0, 0, 0.25);
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.popup2-content-go {
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #814B2D;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
|
||||
.popup2-content-go-cion {
|
||||
width: 10rpx;
|
||||
height: 20rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,283 +0,0 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<custom-navbar title="我的礼品" :show-back="true" title-color="#000" background-color="#FFFFFF"></custom-navbar>
|
||||
<!-- Tab 内容区域 -->
|
||||
<view class="tab-nav">
|
||||
<view v-for="tab in tabs" :key="tab.id" class="tab-item" :class="{ active: queryData.issue === tab.id }"
|
||||
@click="switchTab(tab.id)">
|
||||
{{ tab.name }}
|
||||
</view>
|
||||
</view>
|
||||
<CommonList ref="groupRef" apiUrl="/user/lottery/record"
|
||||
:listScrollHeight="`calc(100vh - ${statusBarHeight + 220}rpx)`">
|
||||
<template #listData="{ list }">
|
||||
<view class="scoll-lists">
|
||||
<view class="scoll-lists-item" v-for="(item, index) in list" :key="index" @click="goDetail(item)">
|
||||
<view class="flex-row-start">
|
||||
<!-- 左侧行李箱图片 -->
|
||||
<image class="prize-img" :src="item.prize_img"></image>
|
||||
|
||||
<!-- 右侧信息区域 -->
|
||||
<view class="prize-info">
|
||||
<!-- 奖品名称 -->
|
||||
<view class="prize-title">{{ item.prize_name }}</view>
|
||||
<!-- 邀请时间 -->
|
||||
<view class="invite-time">中奖时间:{{ item.lottery_time }}</view>
|
||||
<!-- 兑奖方式标签 -->
|
||||
<view class="award-type">兑奖方式:{{ item.type==2?"线上发放":"邮寄"}}</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部:截止时间 + 地址按钮 -->
|
||||
<view class="bottom-bar">
|
||||
<view class="expire-time">{{ item.claim_deadline }}前兑换</view>
|
||||
<view class="address-btn flex-row-center-center" v-if="item.type==3 && item.issue !=3 ">
|
||||
<image class="address-btn-img" src="/static/images/icons/lottery-address.png" v-if="!item.claim_address || !item.claim_address.length"></image>
|
||||
<text>{{ (item.claim_address && item.claim_address.length) || item.issue!=1?"看兑奖地址":"填写发货地址" }}</text>
|
||||
</view>
|
||||
<view class="address-btn flex-row-center-center" v-if="item.type==2 && item.issue==1">
|
||||
<text>去领取</text>
|
||||
</view>
|
||||
<view class="address-btn flex-row-center-center" v-if="item.type==2 && item.issue==2">
|
||||
<text>已发放</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<!-- 空数据状态 -->
|
||||
<template #empty>
|
||||
<noData></noData>
|
||||
</template>
|
||||
</CommonList>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CommonList from "@/components/common/CommonList.vue";
|
||||
import request from "@/utils/request";
|
||||
export default {
|
||||
components: {
|
||||
CommonList,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
queryData: {
|
||||
issue: 1,
|
||||
},
|
||||
tabs: [{
|
||||
id: 1,
|
||||
name: "待发放",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "已发放",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "已失效",
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
async onLoad(options) {
|
||||
if (options.activity_id) {
|
||||
this.queryData.activity_id = options.activity_id
|
||||
}
|
||||
this.statusBarHeight = this.getRpxStatusBarHeight();
|
||||
this.$nextTick(() => {
|
||||
this.search();
|
||||
});
|
||||
},
|
||||
onShow() {
|
||||
if(this.queryData.activity_id){
|
||||
this.search();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
saveSuccess(){
|
||||
setTimeout(()=>{
|
||||
uni.showToast({
|
||||
title: "提交成功",
|
||||
icon: "none",
|
||||
});
|
||||
|
||||
},1000)
|
||||
},
|
||||
// 切换 Tab 的方法
|
||||
switchTab(tabId) {
|
||||
this.queryData.issue = tabId;
|
||||
this.search();
|
||||
},
|
||||
search() {
|
||||
this.$refs.groupRef.manualRefresh(this.queryData);
|
||||
},
|
||||
goDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/lottery/winDetail?id=${item.id}`
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.container {
|
||||
.tab-nav {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 80rpx;
|
||||
background: #fff;
|
||||
|
||||
.tab-item {
|
||||
padding: 30rpx 0rpx 40rpx 0rpx;
|
||||
cursor: pointer;
|
||||
font-weight: 500;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
line-height: 42rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
/* 预先设置透明边框,防止切换时布局跳动 */
|
||||
|
||||
&.active {
|
||||
color: #e8101e;
|
||||
font-weight: 500;
|
||||
position: relative;
|
||||
|
||||
&:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 27rpx; // 定位在底部边框的下方
|
||||
left: 50%;
|
||||
transform: translateX(-50%); // 水平居中
|
||||
|
||||
/* 激活时显示红色边框 */
|
||||
width: 34rpx;
|
||||
height: 6rpx;
|
||||
background: linear-gradient(306deg, #e8101e 0%, #fc563b 100%);
|
||||
border-radius: 3rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.scoll-lists {
|
||||
.scoll-lists-item {
|
||||
padding: 20rpx 20rpx 12rpx 20rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
// 左侧图片
|
||||
.prize-img {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 20rpx;
|
||||
aspect-ratio: 1/1; // 保持图片比例
|
||||
object-fit: contain;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
|
||||
// 右侧信息区域
|
||||
.prize-info {
|
||||
flex: 1;
|
||||
|
||||
// 奖品名称
|
||||
.prize-title {
|
||||
margin-bottom: 10rpx;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
line-height: 40rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
max-width: 500rpx;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
// 邀请时间
|
||||
.invite-time {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-bottom: 28rpx;
|
||||
}
|
||||
|
||||
// 兑奖方式标签
|
||||
.award-type {
|
||||
padding: 0 8rpx;
|
||||
height: 37rpx;
|
||||
border-radius: 10rpx;
|
||||
border: 1rpx solid rgba(210, 87, 85, 0.5);
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #DB2B28;
|
||||
line-height: 37rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
width: fit-content;
|
||||
transform: translateY(-12rpx);
|
||||
}
|
||||
}
|
||||
|
||||
// 底部栏(截止时间 + 按钮)
|
||||
.bottom-bar {
|
||||
padding-top: 22rpx;
|
||||
border-top: 1rpx solid #F1F1F1;
|
||||
margin-top: 22rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
// 截止时间
|
||||
.expire-time {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
// 填写地址按钮
|
||||
.address-btn {
|
||||
height: 47rpx;
|
||||
padding: 0 20rpx;
|
||||
background: #F43642;
|
||||
border-radius: 24rpx;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
.address-btn-img{
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.common-list {
|
||||
background: #f5f5f5!important;
|
||||
padding-bottom: 0rpx!important;
|
||||
|
||||
::v-deep .list-container {
|
||||
padding: 0 20rpx!important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,668 +0,0 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<custom-navbar title="中奖详情" :show-back="true" title-color="#000" background-color="#FFFFFF"></custom-navbar>
|
||||
<view class="activity-page">
|
||||
<!-- 活动信息模块 -->
|
||||
<view class="section">
|
||||
<view class="section-title">活动信息</view>
|
||||
<view class="info-row mb-30">
|
||||
<view class="label">活动名称</view>
|
||||
<view class="value">{{ recordDetails.activity_name }}</view>
|
||||
|
||||
</view>
|
||||
<view class="info-row mb-30">
|
||||
<view class="label">活动编号</view>
|
||||
<view class="value">{{ recordDetails.activity_id }}</view>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<view class="label">中奖编号</view>
|
||||
<view class="value">{{ recordDetails.lottery_num }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 中奖信息模块 -->
|
||||
<view class="section">
|
||||
<view class="section-title">
|
||||
中奖信息
|
||||
</view>
|
||||
<view class="prize-card">
|
||||
<image class="prize-img" :src="recordDetails.prize_img" mode="aspectFill"></image>
|
||||
<view class="prize-desc">
|
||||
<view class="prize-name flex-row-center">
|
||||
{{ recordDetails.prize_name }}
|
||||
<view class="prize-name-price flex-row-center" v-if="recordDetails.type==3">
|
||||
<view class="prize-name-price-text">价值¥ {{ formatPriceNumber(recordDetails.price) }}</view>
|
||||
|
||||
<image class="prize-name-price-img" src="/static/images/background/lotteryBj14.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="prize-time">中奖时间: {{ recordDetails.lottery_time }}</view>
|
||||
<view class="prize-way flex-row-center-center">兑奖方式: {{ recordDetails.type==2?"线上发放":"邮寄"}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom-bar">
|
||||
<view class="expire-time">{{ recordDetails.claim_deadline }}前兑换</view>
|
||||
<view class="address-btn flex-row-center-center">
|
||||
<text>{{ getType }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 收货地址模块 -->
|
||||
<view class="section" v-if="recordDetails.type==3">
|
||||
<view class="section-title">收货地址信息</view>
|
||||
<view class="address-row">
|
||||
<view class="address-label">收货地址</view>
|
||||
<view class="address-tip flex-row-center" @click="goToAddress">
|
||||
<text
|
||||
:class="{addressText:recordDetails.claim_address || address.server_address}">{{ recordDetails.claim_address || address.server_address || "请填写收货地址"}}</text>
|
||||
<image class="address-tip-icon" src="/static/images/icons/right_gray5.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="section" v-if="recordDetails.type==3 && recordDetails.send_time ">
|
||||
<view class="section-title">发货物流信息</view>
|
||||
<view class="section-text1 mb-30">发放时间:{{ recordDetails.send_time }}</view>
|
||||
<view class="flex-row-center-center mb-30" @click="imgPreview(recordDetails.send_img)">
|
||||
<image class="section-img" :src="recordDetails.send_img" mode="aspectFill"></image>
|
||||
</view>
|
||||
|
||||
<view class="section-text2">备注:<text style="color: #E8101E;">{{ recordDetails.send_remark }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 金额 -->
|
||||
<view class="section" v-if="recordDetails.type==2">
|
||||
<view class="section-title">领取金额</view>
|
||||
<view class="price-row">
|
||||
<view class="price-label">红包金额</view>
|
||||
<view class="price-tip" @click="goToAddress">
|
||||
<text>{{ recordDetails.price}}元</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="container-footer">
|
||||
<view class="container-footer-btn flex-row-center-center" :class="{nobtn:!address.server_address}"
|
||||
v-if="recordDetails.type==3 && recordDetails.issue==1 && !recordDetails.claim_address"
|
||||
@click="claimPhysical">确认地址</view>
|
||||
<view class="container-footer-btn flex-row-center-center" v-if="recordDetails.type==2" @click="goWxPage">
|
||||
{{ recordDetails.issue==1?"领取":"返回礼品页" }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// #ifdef APP-PLUS
|
||||
import {
|
||||
requestMerchantTransfer
|
||||
} from "@/uni_modules/uni-requestMerchantTransfer";
|
||||
// #endif
|
||||
import request from "@/utils/request";
|
||||
export default {
|
||||
name: 'ActivityPage',
|
||||
data() {
|
||||
return {
|
||||
isSubmit: false,
|
||||
address: {},
|
||||
id: null,
|
||||
recordDetails: {},
|
||||
openid: null,
|
||||
}
|
||||
},
|
||||
async onLoad(options) {
|
||||
await this.getyhopenid()
|
||||
if (options.id) {
|
||||
this.id = options.id
|
||||
this.getRecordDetails()
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
getType() {
|
||||
let list = [{
|
||||
id: 0,
|
||||
text: "未中奖",
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
text: "未发放",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
text: "已发放",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
text: "已失效",
|
||||
},
|
||||
];
|
||||
let name = list.find((it) => it.id == this.recordDetails.issue)?.text;
|
||||
return name;
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
console.log("show")
|
||||
if (this.id) {
|
||||
this.getRecordDetails()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getyhopenid() {
|
||||
await request.post("/withdrawal/getyhopenid").then((res) => {
|
||||
if (res.code == 200) {
|
||||
if (res.data) {
|
||||
this.openid = res.data
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
getOpenId() {
|
||||
console.log("调用登录接口获取openid");
|
||||
uni.login({
|
||||
provider: "weixin",
|
||||
onlyAuthorize: true,
|
||||
success: (loginRes) => {
|
||||
console.log("loginRes:", loginRes);
|
||||
const code = loginRes.code;
|
||||
if (code) {
|
||||
|
||||
request
|
||||
.post("/user/user/getOpenidApp", {
|
||||
code
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
console.log("获取openid成功:", res);
|
||||
|
||||
if (res.data.openid) {
|
||||
this.openid = res.data.openid
|
||||
this.goWxPage();
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error("获取openid失败:", err);
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: function(err) {
|
||||
console.error("登录接口调用失败:", err);
|
||||
},
|
||||
});
|
||||
},
|
||||
goWxPage() {
|
||||
if (this.isSubmit) {
|
||||
return
|
||||
}
|
||||
if (this.recordDetails.issue != 1) {
|
||||
const pages = getCurrentPages()
|
||||
const prevPage = pages[pages.length - 2]
|
||||
if (prevPage) {
|
||||
uni.navigateBack()
|
||||
}
|
||||
return
|
||||
}
|
||||
const openid = this.openid;
|
||||
if (!openid) {
|
||||
this.getOpenId();
|
||||
return;
|
||||
}
|
||||
const id = this.id;
|
||||
console.log(
|
||||
"开始发起企业付款,openid:",
|
||||
openid,
|
||||
" id:",
|
||||
id
|
||||
);
|
||||
this.isSubmit = true
|
||||
request
|
||||
.post("/user/lottery/claimRedPacket", {
|
||||
id,
|
||||
openid: openid
|
||||
})
|
||||
.then((wxPayRes) => {
|
||||
console.log("wxpay res:", wxPayRes);
|
||||
if (wxPayRes.code != 200) {
|
||||
uni.showToast({
|
||||
title: "领取失败,请稍后重试",
|
||||
icon: "none",
|
||||
});
|
||||
this.isSubmit = false
|
||||
return;
|
||||
}
|
||||
requestMerchantTransfer({
|
||||
mchId: wxPayRes.data.mch_id,
|
||||
appId: wxPayRes.data.appid,
|
||||
package: wxPayRes.data.package_info,
|
||||
success: (res) => {
|
||||
console.log("requestMerchantTransfer ", res);
|
||||
this.isSubmit = false
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res.errMsg, '失败');
|
||||
this.isSubmit = false
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isSubmit = false
|
||||
console.error("wxpay err:", err);
|
||||
});
|
||||
},
|
||||
checkSystemType() {
|
||||
try {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const {
|
||||
platform,
|
||||
system
|
||||
} = systemInfo;
|
||||
let systemType = "";
|
||||
|
||||
// 优先通过 system 字段判断鸿蒙(兼容模式下 platform 仍为 android,但 system 含 HarmonyOS)
|
||||
if (system.includes("HarmonyOS")) {
|
||||
systemType = "harmony"; // 鸿蒙系统(兼容/原生)
|
||||
// 进一步区分鸿蒙原生 vs 安卓兼容模式
|
||||
if (platform === "harmony") {
|
||||
systemType = "harmony_original"; // 纯鸿蒙原生模式
|
||||
} else if (platform === "android") {
|
||||
systemType = "harmony_android"; // 鸿蒙安卓兼容模式
|
||||
}
|
||||
} else if (platform === "android") {
|
||||
systemType = "android"; // 纯安卓系统(非鸿蒙)
|
||||
} else if (platform === "ios") {
|
||||
systemType = "ios"; // iOS 系统
|
||||
} else {
|
||||
systemType = "other"; // 小程序/PC/其他系统
|
||||
}
|
||||
|
||||
// const { isHarmony, systemType } = this.checkSystemType();
|
||||
// if (isHarmony) {
|
||||
// console.log("当前是鸿蒙系统");
|
||||
// if (systemType === "harmony_original") {
|
||||
// console.log("纯鸿蒙原生模式");
|
||||
// } else if (systemType === "harmony_android") {
|
||||
// console.log("鸿蒙安卓兼容模式");
|
||||
// }
|
||||
// } else if (systemType === "android") {
|
||||
// console.log("当前是纯安卓系统");
|
||||
// } else if (systemType === "ios") {
|
||||
// console.log("当前是iOS系统");
|
||||
// }
|
||||
|
||||
return {
|
||||
systemType, // 系统类型:harmony/harmony_original/harmony_android/android/ios/other
|
||||
systemInfo, // 完整系统信息(含版本、设备型号等)
|
||||
isHarmony: system.includes("HarmonyOS"), // 是否为鸿蒙系统(布尔值)
|
||||
};
|
||||
} catch (err) {
|
||||
console.error("检测系统类型失败", err);
|
||||
return {
|
||||
systemType: "unknown",
|
||||
isHarmony: false
|
||||
};
|
||||
}
|
||||
},
|
||||
imgPreview(url) {
|
||||
uni.previewImage({
|
||||
urls: [url]
|
||||
})
|
||||
},
|
||||
getRecordDetails() {
|
||||
request.post("/user/lottery/recordDetails", {
|
||||
id: this.id
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.recordDetails = res.data
|
||||
}
|
||||
});
|
||||
},
|
||||
// 选择地址
|
||||
goToAddress() {
|
||||
if (this.recordDetails.claim_address) {
|
||||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: "/pages/address/list"
|
||||
});
|
||||
},
|
||||
addReservation(item) {
|
||||
this.address = item
|
||||
console.log(1111, this.address)
|
||||
},
|
||||
claimPhysical() {
|
||||
if (!this.address.server_address) {
|
||||
uni.showToast({
|
||||
title: "请选择地址",
|
||||
icon: "none",
|
||||
});
|
||||
return
|
||||
}
|
||||
request.post("/user/lottery/claimPhysical", {
|
||||
id: this.id,
|
||||
claim_name: this.address.name,
|
||||
claim_phone: this.address.call_phone,
|
||||
claim_address: this.address.server_address
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
const pages = getCurrentPages()
|
||||
const prevPage = pages[pages.length - 2]
|
||||
if (prevPage) {
|
||||
if (prevPage.$vm && typeof prevPage.$vm.saveSuccess === "function") {
|
||||
prevPage.$vm.saveSuccess(); // 存在则调用
|
||||
}
|
||||
uni.navigateBack()
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.msg,
|
||||
icon: "none",
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/* 页面整体样式 */
|
||||
.activity-page {
|
||||
padding: 20rpx;
|
||||
padding-bottom: 170rpx;
|
||||
}
|
||||
|
||||
/* 模块通用样式 */
|
||||
.section {
|
||||
padding: 30rpx 20rpx;
|
||||
background: #FFFFFF;
|
||||
margin-bottom: 20rpx;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.section-title {
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #3D3D3D;
|
||||
line-height: 39rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-bottom: 40rpx;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.section-text1 {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.section-text2 {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.section-img {
|
||||
width: 400rpx;
|
||||
height: 400rpx;
|
||||
}
|
||||
}
|
||||
|
||||
/* 信息行通用样式 */
|
||||
.info-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
|
||||
.label {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.value {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
line-height: 34rpx;
|
||||
text-align: right;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* 中奖信息卡片 */
|
||||
.prize-card {
|
||||
display: flex;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
.prize-img {
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-right: 26rpx;
|
||||
}
|
||||
|
||||
.prize-desc {
|
||||
flex: 1;
|
||||
|
||||
.prize-name {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
line-height: 40rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-bottom: 26rpx;
|
||||
|
||||
.prize-name-price {
|
||||
|
||||
margin-left: 6rpx;
|
||||
height: 36rpx;
|
||||
.prize-name-price-text{
|
||||
box-sizing: border-box;
|
||||
padding: 0 0rpx 0 10rpx;
|
||||
font-weight: 500;
|
||||
font-size: 20rpx;
|
||||
color: #BC7105;
|
||||
line-height: 36rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
border: 1px solid rgba(250, 193, 107, 0.36);
|
||||
border-right: none;
|
||||
border-radius: 6rpx 0rpx 0 6rpx;
|
||||
background: linear-gradient(
|
||||
to bottom right,
|
||||
rgba(254, 228, 182, 0.36),
|
||||
rgba(255, 242, 215, 0.36),
|
||||
rgba(254, 228, 182, 0.36),
|
||||
rgba(255, 242, 215, 0.36)
|
||||
);
|
||||
}
|
||||
.prize-name-price-img{
|
||||
height: 36rpx;
|
||||
width: 14rpx;
|
||||
// position: absolute;
|
||||
// right: 0;
|
||||
// top: 0;
|
||||
}
|
||||
// background-image: url('/static/images/background/lotteryBj14.png');
|
||||
// background-size: cover;
|
||||
// /* 关键修改2:同时设置x和y轴的位置,确保图片垂直居中且右对齐 */
|
||||
// background-position: right center;
|
||||
// background-repeat: no-repeat;
|
||||
}
|
||||
}
|
||||
|
||||
.prize-time {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-bottom: 14rpx;
|
||||
}
|
||||
|
||||
.prize-way {
|
||||
height: 37rpx;
|
||||
padding: 0 8rpx;
|
||||
border-radius: 10rpx;
|
||||
border: 1rpx solid rgba(210, 87, 85, 0.5);
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #DB2B28;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
width: fit-content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 有效期+状态行 */
|
||||
// 底部栏(截止时间 + 按钮)
|
||||
.bottom-bar {
|
||||
padding-top: 22rpx;
|
||||
border-top: 1rpx solid #F1F1F1;
|
||||
margin-top: 22rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
// 截止时间
|
||||
.expire-time {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
// 填写地址按钮
|
||||
.address-btn {
|
||||
height: 47rpx;
|
||||
padding: 0 20rpx;
|
||||
background: #F43642;
|
||||
border-radius: 24rpx;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
|
||||
.address-btn-img {
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 收货地址行 */
|
||||
.address-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.address-label {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.address-tip {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #CCCCCC;
|
||||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
max-width: 500rpx;
|
||||
|
||||
.addressText {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.address-tip-icon {
|
||||
width: 11rpx;
|
||||
height: 20rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.price-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.price-label {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.price-tip {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #E8101E;
|
||||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.container-footer {
|
||||
padding: 40rpx;
|
||||
background: #FFFFFF;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
|
||||
.container-footer-btn {
|
||||
width: 670rpx;
|
||||
height: 86rpx;
|
||||
border-radius: 100rpx;
|
||||
background: #E8101E;
|
||||
font-weight: 400;
|
||||
font-size: 34rpx;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.nobtn {
|
||||
background: rgba(232, 16, 30, 0.4);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,352 +0,0 @@
|
|||
<template>
|
||||
<view class="settings-page">
|
||||
<custom-navbar title="活动消息设置" :showBack="true"></custom-navbar>
|
||||
<!-- 通知设置标题区域,带小图标 -->
|
||||
<view class="settings-title">
|
||||
<text>通知设置</text>
|
||||
<image class="settings-title-tip"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/e65794a6-bda3-44da-b8ce-1bf3ee6c1832.png"
|
||||
@click="showGuideDialog = true">
|
||||
</image>
|
||||
</view>
|
||||
<view class="settings-cards">
|
||||
<view class="settings-card card-line flex-row-center-between">
|
||||
<view>
|
||||
<view class="card-heard flex-row-center-between">
|
||||
<view class="card-heard-left flex-row-center">
|
||||
<text class="card-heard-left-text">允许手机接收</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<uv-switch v-model="mainSwitch.switch" activeColor="#E8101E" @change="handleSwitchChange('total',mainSwitch, $event)"></uv-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view class="settings-title" v-if="kindList.length">
|
||||
细分消息类型
|
||||
</view>
|
||||
<view class="settings-cards">
|
||||
<view class="settings-card card-line flex-row-center-between" v-for="(item,index) in kindList" :key="index">
|
||||
<view>
|
||||
<view class="card-heard flex-row-center-between">
|
||||
<view class="card-heard-left flex-row-center">
|
||||
<text class="card-heard-left-text">{{ item.second_kind }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-tip">{{ item.text }}</view>
|
||||
</view>
|
||||
<uv-switch v-model="item.switch" activeColor="#E8101E" @change="handleSwitchChange('branch',item, $event)"></uv-switch>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 通知设置弹窗 -->
|
||||
<transition name="fade-scale">
|
||||
<view v-if="showGuideDialog" class="dialog-mask" @click="showGuideDialog = false" @touchmove.prevent>
|
||||
<view class="dialog-container" @click.stop>
|
||||
<view class="dialog-title">通知设置</view>
|
||||
<view class="dialog-desc">
|
||||
开启后,将以手机锁屏\通知中心\横幅的系统通知方式,为你推送指定类型的消息。
|
||||
</view>
|
||||
<!-- 中间的图片区域 -->
|
||||
<image class="dialog-illustration"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/94b5bb62-e90b-4e14-a89f-a44ea1504dd9.png"
|
||||
mode="widthFix">
|
||||
</image>
|
||||
<view class="dialog-btn" @click="showGuideDialog = false">
|
||||
<text class="dialog-btn-text">我知道了</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</transition>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import $http from '@/utils/request.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showGuideDialog: false, // 控制弹窗显示
|
||||
kindList:[],
|
||||
mainSwitch:{},
|
||||
isInitializing: true // 防止初始化时触发保存
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.fetchSettings();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取设置
|
||||
async fetchSettings() {
|
||||
try {
|
||||
const stateRes = await $http.post('/user/push/getReceiveState', {message_type_id:2});
|
||||
console.log('用户状态', stateRes);
|
||||
if(stateRes.code == 200){
|
||||
this.mainSwitch = stateRes.data.list[0] || {};
|
||||
this.$set(this.mainSwitch,"switch",this.mainSwitch.state ==1?true:false)
|
||||
this.kindList = stateRes.data.list[0].kind_list || [];
|
||||
this.kindList.forEach(item=>{
|
||||
if(this.mainSwitch.switch){
|
||||
this.$set(item,"switch",item.state ==1?true:false)
|
||||
}else{
|
||||
this.$set(item,"switch",false)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.isInitializing = false;
|
||||
} catch (err) {
|
||||
console.error('获取设置失败', err);
|
||||
this.isInitializing = false;
|
||||
}
|
||||
},
|
||||
|
||||
// 处理开关变化
|
||||
handleSwitchChange(type,obj, value) {
|
||||
console.log(11111,type,obj,value)
|
||||
if (this.isInitializing) return;
|
||||
|
||||
let message_type_id, message_kind_id, state = value ? 1 : 2;
|
||||
|
||||
if (type == 'total' && value == false) {
|
||||
this.kindList.forEach(item=>{
|
||||
this.$set(item,"switch",false)
|
||||
})
|
||||
}
|
||||
if (type == 'total' && value == true) {
|
||||
this.kindList.forEach(item=>{
|
||||
this.$set(item,"switch",item.state ==1?true:false)
|
||||
})
|
||||
}
|
||||
if (type == 'branch' && this.mainSwitch.switch == true) {
|
||||
this.$set(obj,"state",value?1:2)
|
||||
}
|
||||
//如果总开关关闭调用批量修改接口
|
||||
if (type == 'branch' && this.mainSwitch.switch == false) {
|
||||
let data = []
|
||||
this.kindList.forEach(item=>{
|
||||
let dataObj = {
|
||||
message_type_id:item.message_type_id,
|
||||
message_kind_id:item.message_kind_id,
|
||||
state:item.message_kind_id == obj.message_kind_id ? value?1:2:2
|
||||
}
|
||||
data.push(dataObj)
|
||||
})
|
||||
let dataObj = {
|
||||
message_type_id:this.mainSwitch.message_type_id,
|
||||
message_kind_id:this.mainSwitch.message_kind_id,
|
||||
state:1
|
||||
}
|
||||
data.push(dataObj)
|
||||
this.setReceiveStateBatch(data);
|
||||
this.$set(this.mainSwitch,"switch",true)
|
||||
this.$set(this.mainSwitch,"state",1)
|
||||
return
|
||||
}
|
||||
|
||||
this.setSetting(obj.message_type_id,obj.message_kind_id, value);
|
||||
},
|
||||
|
||||
setReceiveStateBatch(data){
|
||||
$http.post('/user/push/setReceiveStateBatch', {
|
||||
data:data
|
||||
}).then(res => {
|
||||
// uni.showToast({ title: '设置成功', icon: 'none' });
|
||||
}).catch(err => {
|
||||
uni.showToast({ title: '设置失败', icon: 'none' });
|
||||
// 失败后重新拉取最新状态,保证界面与后端一致
|
||||
this.isInitializing = true;
|
||||
this.fetchSettings();
|
||||
});
|
||||
},
|
||||
|
||||
// 设置推送接收状态
|
||||
setSetting(message_type_id, message_kind_id, state) {
|
||||
$http.post('/user/push/setReceiveState', {
|
||||
message_type_id,
|
||||
message_kind_id,
|
||||
state
|
||||
}).then(res => {
|
||||
// uni.showToast({ title: '设置成功', icon: 'none' });
|
||||
}).catch(err => {
|
||||
uni.showToast({ title: '设置失败', icon: 'none' });
|
||||
// 失败后重新拉取最新状态,保证界面与后端一致
|
||||
this.isInitializing = true;
|
||||
this.fetchSettings();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.settings-page {
|
||||
padding: 20rpx;
|
||||
|
||||
.settings-title {
|
||||
font-weight: 500;
|
||||
font-size: 22rpx;
|
||||
color: #979797;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-bottom: 20rpx;
|
||||
gap: 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.settings-title-tip{
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-cards {
|
||||
box-sizing: border-box;
|
||||
width: 710rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 40rpx;
|
||||
|
||||
.settings-card {
|
||||
padding: 30rpx 0rpx 36rpx 0rpx;
|
||||
|
||||
.card-heard {
|
||||
.card-heard-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
.card-heard-left-icon{
|
||||
height: 32rpx;
|
||||
}
|
||||
.card-heard-left-text {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.card-heard-right {
|
||||
gap: 10rpx;
|
||||
|
||||
.card-heard-right-text {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.arrow-right {
|
||||
width: 8rpx;
|
||||
height: 16rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.card-tip {
|
||||
margin-top: 20rpx;
|
||||
font-weight: 400;
|
||||
font-size: 22rpx;
|
||||
color: #979797;
|
||||
line-height: 30rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.card-line {
|
||||
border-bottom: 1rpx solid #F5F5F5;
|
||||
}
|
||||
}
|
||||
|
||||
.color-red {
|
||||
color: #E8101E !important;
|
||||
}
|
||||
|
||||
/* 弹窗样式 */
|
||||
.dialog-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.dialog-container {
|
||||
width: 556rpx;
|
||||
height: 711rpx;
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 24rpx;
|
||||
padding: 40rpx 37rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.dialog-title {
|
||||
font-weight: 500;
|
||||
font-size: 40rpx;
|
||||
color: #333333;
|
||||
line-height: 56rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-bottom: 36rpx;
|
||||
}
|
||||
|
||||
.dialog-desc {
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
line-height: 1.5;
|
||||
text-align: left;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.dialog-illustration {
|
||||
width: 377rpx;
|
||||
height: 241rpx;
|
||||
height: auto;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.dialog-btn {
|
||||
width: 476rpx;
|
||||
height: 86rpx;
|
||||
background: #E8101E;
|
||||
border-radius: 44rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: opacity 0.1s;
|
||||
}
|
||||
.dialog-btn-text {
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
/* 平滑淡入缩放动画 */
|
||||
.fade-scale-enter-active,
|
||||
.fade-scale-leave-active {
|
||||
transition: all 0.25s ease;
|
||||
}
|
||||
.fade-scale-enter,
|
||||
.fade-scale-leave-to {
|
||||
opacity: 0;
|
||||
transform: scale(0.9);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,138 +0,0 @@
|
|||
<template>
|
||||
<view class="coupon-notice-page">
|
||||
<!-- 顶部导航栏 -->
|
||||
<custom-navbar
|
||||
:title="title"
|
||||
:show-back="true"
|
||||
title-color="#000"
|
||||
background-color="#FFFFFF"
|
||||
:showHeadle="true"
|
||||
headleSrc="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/0b137ffb-6165-465c-9497-b5c9375bac74.png"
|
||||
@onHeadleClick="handleHeadleClick"
|
||||
></custom-navbar>
|
||||
<!-- 优惠通知卡片列表 -->
|
||||
<view class="message-list">
|
||||
<noData></noData>
|
||||
<!-- <view class="message-item">
|
||||
<view class="item-content">
|
||||
<view class="item-header">
|
||||
<view class="item-title-group">
|
||||
<image class="item-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/202a8ef8-55a3-4a33-ab92-fd0d7567cf90.png" mode="aspectFit"></image>
|
||||
<text class="item-title">您有一张新卡券</text>
|
||||
</view>
|
||||
<text class="item-time">1月02日 11:00</text>
|
||||
</view>
|
||||
<view class="item-body">
|
||||
<view class="item-info">
|
||||
<text class="item-line">恭喜您获得【新人现金券】,点击查看卡券详情</text>
|
||||
</view>
|
||||
<image class="item-product-img" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cca9c23f-2052-4335-8e50-27d5d2861eeb.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: '活动通知',
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.coupon-notice-page {
|
||||
background-color: #f8f8f8;
|
||||
min-height: 100vh;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
|
||||
.message-list {
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.coupon-notice-page ::v-deep .right-area,
|
||||
.coupon-notice-page ::v-deep .icon-headle {
|
||||
width: 38rpx !important;
|
||||
height: 37rpx !important;
|
||||
}
|
||||
|
||||
.message-item {
|
||||
background-color: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.02);
|
||||
}
|
||||
|
||||
.item-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.item-title-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.item-icon {
|
||||
width: 57rpx;
|
||||
height: 49rpx;
|
||||
margin-right: 10rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.item-title {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.item-time {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #A5A5A5;
|
||||
line-height: 33rpx;
|
||||
flex-shrink: 0;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.item-body {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 39rpx;
|
||||
}
|
||||
|
||||
.item-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
line-height: 37rpx;
|
||||
}
|
||||
|
||||
.item-line {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.item-product-img {
|
||||
width: 128rpx;
|
||||
height: 78rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,361 +0,0 @@
|
|||
<template>
|
||||
<view class="message-page" :style="{paddingTop:`${statusBarHeight}rpx`}">
|
||||
<view class="message-header flex-row-center-between">
|
||||
<image
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/8f59f3a0-cb23-4625-9c32-a9842e794489.png"
|
||||
class="message-header-left"></image>
|
||||
<view class="message-header-right">
|
||||
<image class="icon-broom" @tap="messageReadAll" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/0b137ffb-6165-465c-9497-b5c9375bac74.png" mode="aspectFit"></image>
|
||||
<view class="icon-dots" @click="goMessageSetting">
|
||||
<view class="dot"></view>
|
||||
<view class="dot"></view>
|
||||
<view class="dot"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="message-state flex-row-center-between">
|
||||
<view class="message-state-card">
|
||||
<image class="state-card-img"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/ad0ef855-416f-4178-a7a8-c6b114c1e10d.png">
|
||||
</image>
|
||||
<text class="state-card-text">订单服务</text>
|
||||
<view class="state-card-num" v-show="nums[0]">{{ nums[0] }}</view>
|
||||
</view>
|
||||
<view class="message-state-card" @click="goToCouponNotice">
|
||||
<image class="state-card-img"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/b1e1c9ab-7ca3-4f70-8e00-4bb1982a6e2d.png">
|
||||
</image>
|
||||
<text class="state-card-text">优惠通知</text>
|
||||
<view class="state-card-num" v-show="nums[0]">{{ nums[1] }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<CommonList
|
||||
ref="groupRef"
|
||||
apiUrl="/user/push/messageList"
|
||||
:listScrollHeight="`calc(100vh - ${statusBarHeight + 400}rpx)`"
|
||||
>
|
||||
<template #listData="{ list }">
|
||||
<!-- 订单超时卡片 -->
|
||||
<view class="message-list">
|
||||
<view class="message-item" v-for="(item,index) in list" :key="index" @click="goOrder(item)">
|
||||
<view class="item-content">
|
||||
<view class="item-header">
|
||||
<view class="item-title-group">
|
||||
<image class="item-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/e233f727-e358-4eb2-8e0f-e55f95728dc2.png" mode="aspectFit"></image>
|
||||
|
||||
<text class="item-title">{{ item.title }}</text>
|
||||
</view>
|
||||
<view class="flex-row-center"><text class="item-time">{{ item.send_time }}</text><view v-if="item.is_read==2" class="item-dot"></view></view>
|
||||
|
||||
</view>
|
||||
<view class="item-body">
|
||||
<view class="item-info">
|
||||
<text class="item-order">您的订单【M2025062717393551016829】</text>
|
||||
<text class="item-desc">{{ item.desc }}</text>
|
||||
</view>
|
||||
<image class="item-product-img" :src="item.ext.order_photo" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<!-- 空数据状态 -->
|
||||
<template #empty>
|
||||
<noData></noData>
|
||||
</template>
|
||||
</CommonList>
|
||||
|
||||
<TabBar :selected="2"></TabBar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from "@/utils/request";
|
||||
import TabBar from "@/components/tabbar/tabbar.vue";
|
||||
import CommonList from "@/components/common/CommonList.vue";
|
||||
export default {
|
||||
components: {
|
||||
TabBar,
|
||||
CommonList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
nums:[0,0],//[订单通知数量,优惠通知数量]
|
||||
statusBarHeight:0,
|
||||
queryData: {
|
||||
message_type_id: 1,
|
||||
},
|
||||
};
|
||||
},
|
||||
async onShow() {
|
||||
if (uni.getStorageSync('accessToken')) {
|
||||
this.$nextTick(() => {
|
||||
this.search();
|
||||
});
|
||||
let OrderNum = await this.messageUnreadNum(1)
|
||||
this.$set(this.nums,0,OrderNum)
|
||||
let discountNum = await this.messageUnreadNum(2)
|
||||
this.$set(this.nums,1,discountNum)
|
||||
}
|
||||
|
||||
},
|
||||
async onLoad() {
|
||||
this.statusBarHeight = this.getRpxStatusBarHeight();
|
||||
},
|
||||
methods: {
|
||||
goMessageSetting(){
|
||||
uni.navigateTo({
|
||||
url: `/pages/message/settings`
|
||||
})
|
||||
},
|
||||
async messageUnreadNum(id){
|
||||
try{
|
||||
let typeRes = await request.post('/user/push/messageUnreadNum', {message_type_id:id});
|
||||
console.log('消息数量', typeRes);
|
||||
if(typeRes.code==200){
|
||||
return typeRes.data.count<=99?typeRes.data.count:"99+"
|
||||
}else{
|
||||
return 0
|
||||
}
|
||||
|
||||
}catch (err) {
|
||||
console.error('获取数量失败', err);
|
||||
}
|
||||
},
|
||||
messageReadAll(){
|
||||
request.post('/user/push/messageReadAll').then(async res=>{
|
||||
if(res.code==200){
|
||||
this.search()
|
||||
let OrderNum = await this.messageUnreadNum(1)
|
||||
this.$set(this.nums,0,OrderNum)
|
||||
let discountNum = await this.messageUnreadNum(2)
|
||||
this.$set(this.nums,1,discountNum)
|
||||
this.messageUpudateNum()
|
||||
uni.showToast({ title: '清除成功', icon: 'none' })
|
||||
}else{
|
||||
uni.showToast({ title: res.msg, icon: 'none' })
|
||||
}
|
||||
});
|
||||
},
|
||||
goToCouponNotice() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/message/coupon_notice'
|
||||
});
|
||||
},
|
||||
search() {
|
||||
this.$refs.groupRef.manualRefresh(this.queryData);
|
||||
},
|
||||
goOrder(order){
|
||||
console.log('order', order)
|
||||
if (order.ext.data?.order_type == 6) {
|
||||
//如果是自营订单
|
||||
uni.navigateTo({
|
||||
url: `/pages/order/userorder-detail?order_id=${order.ext.data?.order_id}&order_type=6&messageId=${order.data?.id}`
|
||||
})
|
||||
} else{
|
||||
//如果是普通订单
|
||||
uni.navigateTo({
|
||||
url: `/pages/order/userorder-detail?order_id=${order.ext.data?.order_id}&messageId=${order.data?.id}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.message-page {
|
||||
background-position: 0 0;
|
||||
background-size: 100%;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url("https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/22cf01ee-4a27-4a65-a032-9ceb6265ac2c.png");
|
||||
|
||||
.message-header {
|
||||
padding: 25rpx 30rpx 0rpx 25rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.message-header-left {
|
||||
width: 191rpx;
|
||||
height: 69rpx;
|
||||
}
|
||||
|
||||
.message-header-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 30rpx;
|
||||
|
||||
.icon-broom {
|
||||
width: 38rpx;
|
||||
height: 37rpx;
|
||||
}
|
||||
|
||||
.icon-dots {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6rpx;
|
||||
|
||||
.dot {
|
||||
width: 6rpx;
|
||||
height: 6rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.message-state {
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx 110rpx;
|
||||
margin-top: 33rpx;
|
||||
width: 100%;
|
||||
height: 212rpx;
|
||||
background-size: 100%;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url("https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/110df663-bb15-4b63-a46e-571b65c30955.png");
|
||||
|
||||
.message-state-card {
|
||||
width: 148rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
|
||||
.state-card-num {
|
||||
position: absolute;
|
||||
left: 112rpx;
|
||||
top: -13rpx;
|
||||
padding: 3rpx 12rpx;
|
||||
border-radius: 19rpx;
|
||||
background: #ED5B36;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.state-card-img {
|
||||
width: 148rpx;
|
||||
height: 94rpx;
|
||||
}
|
||||
|
||||
.state-card-text {
|
||||
margin-top: 18rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #1F0508;
|
||||
line-height: 40rpx;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 订单卡片列表 */
|
||||
.message-list {
|
||||
padding: 0rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.message-item {
|
||||
background-color: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.02);
|
||||
}
|
||||
|
||||
/* 头部:标题和时间两端对齐 */
|
||||
.item-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.item-title-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.item-icon {
|
||||
width: 57rpx;
|
||||
height: 49rpx;
|
||||
margin-right: 10rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.item-title {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
line-height: 40rpx;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.item-dot{
|
||||
width: 16rpx;
|
||||
height: 16rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #E8101E;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
|
||||
.item-time {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #A5A5A5;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
flex-shrink: 0;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
/* 主体:左右结构 */
|
||||
.item-body {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 59rpx;
|
||||
}
|
||||
|
||||
.item-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5rpx;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
line-height: 37rpx;
|
||||
}
|
||||
|
||||
.item-order {
|
||||
word-break: break-all;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.item-desc {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.item-product-img {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 10rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.common-list{
|
||||
background: #f5f5f5!important;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,352 +0,0 @@
|
|||
<template>
|
||||
<view class="settings-page">
|
||||
<custom-navbar title="订单消息设置" :showBack="true"></custom-navbar>
|
||||
<!-- 通知设置标题区域,带小图标 -->
|
||||
<view class="settings-title">
|
||||
<text>通知设置</text>
|
||||
<image class="settings-title-tip"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/e65794a6-bda3-44da-b8ce-1bf3ee6c1832.png"
|
||||
@click="showGuideDialog = true">
|
||||
</image>
|
||||
</view>
|
||||
<view class="settings-cards">
|
||||
<view class="settings-card card-line flex-row-center-between">
|
||||
<view>
|
||||
<view class="card-heard flex-row-center-between">
|
||||
<view class="card-heard-left flex-row-center">
|
||||
<text class="card-heard-left-text">允许手机接收</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<uv-switch v-model="mainSwitch.switch" activeColor="#E8101E" @change="handleSwitchChange('total',mainSwitch, $event)"></uv-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view class="settings-title">
|
||||
细分消息类型
|
||||
</view>
|
||||
<view class="settings-cards">
|
||||
<view class="settings-card card-line flex-row-center-between" v-for="(item,index) in kindList" :key="index">
|
||||
<view>
|
||||
<view class="card-heard flex-row-center-between">
|
||||
<view class="card-heard-left flex-row-center">
|
||||
<text class="card-heard-left-text">{{ item.second_kind }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-tip">{{ item.text }}</view>
|
||||
</view>
|
||||
<uv-switch v-model="item.switch" activeColor="#E8101E" @change="handleSwitchChange('branch',item, $event)"></uv-switch>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 通知设置弹窗 -->
|
||||
<transition name="fade-scale">
|
||||
<view v-if="showGuideDialog" class="dialog-mask" @click="showGuideDialog = false" @touchmove.prevent>
|
||||
<view class="dialog-container" @click.stop>
|
||||
<view class="dialog-title">通知设置</view>
|
||||
<view class="dialog-desc">
|
||||
开启后,将以手机锁屏\通知中心\横幅的系统通知方式,为你推送指定类型的消息。
|
||||
</view>
|
||||
<!-- 中间的图片区域 -->
|
||||
<image class="dialog-illustration"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/94b5bb62-e90b-4e14-a89f-a44ea1504dd9.png"
|
||||
mode="widthFix">
|
||||
</image>
|
||||
<view class="dialog-btn" @click="showGuideDialog = false">
|
||||
<text class="dialog-btn-text">我知道了</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</transition>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import $http from '@/utils/request.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showGuideDialog: false, // 控制弹窗显示
|
||||
kindList:[],
|
||||
mainSwitch:{},
|
||||
isInitializing: true // 防止初始化时触发保存
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.fetchSettings();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取设置
|
||||
async fetchSettings() {
|
||||
try {
|
||||
const stateRes = await $http.post('/user/push/getReceiveState', {message_type_id:1});
|
||||
console.log('用户状态', stateRes);
|
||||
if(stateRes.code == 200){
|
||||
this.mainSwitch = stateRes.data.list[0] || {};
|
||||
this.$set(this.mainSwitch,"switch",this.mainSwitch.state ==1?true:false)
|
||||
this.kindList = stateRes.data.list[0].kind_list || [];
|
||||
this.kindList.forEach(item=>{
|
||||
if(this.mainSwitch.switch){
|
||||
this.$set(item,"switch",item.state ==1?true:false)
|
||||
}else{
|
||||
this.$set(item,"switch",false)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.isInitializing = false;
|
||||
} catch (err) {
|
||||
console.error('获取设置失败', err);
|
||||
this.isInitializing = false;
|
||||
}
|
||||
},
|
||||
|
||||
// 处理开关变化
|
||||
handleSwitchChange(type,obj, value) {
|
||||
console.log(11111,type,obj,value)
|
||||
if (this.isInitializing) return;
|
||||
|
||||
let message_type_id, message_kind_id, state = value ? 1 : 2;
|
||||
|
||||
if (type == 'total' && value == false) {
|
||||
this.kindList.forEach(item=>{
|
||||
this.$set(item,"switch",false)
|
||||
})
|
||||
}
|
||||
if (type == 'total' && value == true) {
|
||||
this.kindList.forEach(item=>{
|
||||
this.$set(item,"switch",item.state ==1?true:false)
|
||||
})
|
||||
}
|
||||
if (type == 'branch' && this.mainSwitch.switch == true) {
|
||||
this.$set(obj,"state",value?1:2)
|
||||
}
|
||||
//如果总开关关闭调用批量修改接口
|
||||
if (type == 'branch' && this.mainSwitch.switch == false) {
|
||||
let data = []
|
||||
this.kindList.forEach(item=>{
|
||||
let dataObj = {
|
||||
message_type_id:item.message_type_id,
|
||||
message_kind_id:item.message_kind_id,
|
||||
state:item.message_kind_id == obj.message_kind_id ? value?1:2:2
|
||||
}
|
||||
data.push(dataObj)
|
||||
})
|
||||
let dataObj = {
|
||||
message_type_id:this.mainSwitch.message_type_id,
|
||||
message_kind_id:this.mainSwitch.message_kind_id,
|
||||
state:1
|
||||
}
|
||||
data.push(dataObj)
|
||||
this.setReceiveStateBatch(data);
|
||||
this.$set(this.mainSwitch,"switch",true)
|
||||
this.$set(this.mainSwitch,"state",1)
|
||||
return
|
||||
}
|
||||
|
||||
this.setSetting(obj.message_type_id,obj.message_kind_id, value);
|
||||
},
|
||||
|
||||
setReceiveStateBatch(data){
|
||||
$http.post('/user/push/setReceiveStateBatch', {
|
||||
data:data
|
||||
}).then(res => {
|
||||
// uni.showToast({ title: '设置成功', icon: 'none' });
|
||||
}).catch(err => {
|
||||
uni.showToast({ title: '设置失败', icon: 'none' });
|
||||
// 失败后重新拉取最新状态,保证界面与后端一致
|
||||
this.isInitializing = true;
|
||||
this.fetchSettings();
|
||||
});
|
||||
},
|
||||
|
||||
// 设置推送接收状态
|
||||
setSetting(message_type_id, message_kind_id, state) {
|
||||
$http.post('/user/push/setReceiveState', {
|
||||
message_type_id,
|
||||
message_kind_id,
|
||||
state
|
||||
}).then(res => {
|
||||
// uni.showToast({ title: '设置成功', icon: 'none' });
|
||||
}).catch(err => {
|
||||
uni.showToast({ title: '设置失败', icon: 'none' });
|
||||
// 失败后重新拉取最新状态,保证界面与后端一致
|
||||
this.isInitializing = true;
|
||||
this.fetchSettings();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.settings-page {
|
||||
padding: 20rpx;
|
||||
|
||||
.settings-title {
|
||||
font-weight: 500;
|
||||
font-size: 22rpx;
|
||||
color: #979797;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-bottom: 20rpx;
|
||||
gap: 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.settings-title-tip{
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-cards {
|
||||
box-sizing: border-box;
|
||||
width: 710rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 40rpx;
|
||||
|
||||
.settings-card {
|
||||
padding: 30rpx 0rpx 36rpx 0rpx;
|
||||
|
||||
.card-heard {
|
||||
.card-heard-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
.card-heard-left-icon{
|
||||
height: 32rpx;
|
||||
}
|
||||
.card-heard-left-text {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.card-heard-right {
|
||||
gap: 10rpx;
|
||||
|
||||
.card-heard-right-text {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.arrow-right {
|
||||
width: 8rpx;
|
||||
height: 16rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.card-tip {
|
||||
margin-top: 20rpx;
|
||||
font-weight: 400;
|
||||
font-size: 22rpx;
|
||||
color: #979797;
|
||||
line-height: 30rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.card-line {
|
||||
border-bottom: 1rpx solid #F5F5F5;
|
||||
}
|
||||
}
|
||||
|
||||
.color-red {
|
||||
color: #E8101E !important;
|
||||
}
|
||||
|
||||
/* 弹窗样式 */
|
||||
.dialog-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.dialog-container {
|
||||
width: 556rpx;
|
||||
height: 711rpx;
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 24rpx;
|
||||
padding: 40rpx 37rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.dialog-title {
|
||||
font-weight: 500;
|
||||
font-size: 40rpx;
|
||||
color: #333333;
|
||||
line-height: 56rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-bottom: 36rpx;
|
||||
}
|
||||
|
||||
.dialog-desc {
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
line-height: 1.5;
|
||||
text-align: left;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.dialog-illustration {
|
||||
width: 377rpx;
|
||||
height: 241rpx;
|
||||
height: auto;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.dialog-btn {
|
||||
width: 476rpx;
|
||||
height: 86rpx;
|
||||
background: #E8101E;
|
||||
border-radius: 44rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: opacity 0.1s;
|
||||
}
|
||||
.dialog-btn-text {
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
/* 平滑淡入缩放动画 */
|
||||
.fade-scale-enter-active,
|
||||
.fade-scale-leave-active {
|
||||
transition: all 0.25s ease;
|
||||
}
|
||||
.fade-scale-enter,
|
||||
.fade-scale-leave-to {
|
||||
opacity: 0;
|
||||
transform: scale(0.9);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,365 +0,0 @@
|
|||
<template>
|
||||
<view class="settings-page">
|
||||
<custom-navbar title="消息设置" :showBack="true"></custom-navbar>
|
||||
<view class="settings-title">
|
||||
APP关闭时
|
||||
</view>
|
||||
<view class="settings-cards">
|
||||
<view class="settings-card card-line">
|
||||
<view class="card-heard flex-row-center-between">
|
||||
<view class="card-heard-left flex-row-center">
|
||||
<text class="card-heard-left-text">新消息系统通知</text>
|
||||
</view>
|
||||
<view class="card-heard-right flex-row-center" @click="goPermissions">
|
||||
<text class="card-heard-right-text color-red">{{isEnabledValue}}</text>
|
||||
<image
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/01aff5d8-de48-4c53-9425-53a9b4da3dbc.png"
|
||||
class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="card-tip"> 在系统中开启,可以收到订单、聊天等消息通</view>
|
||||
</view>
|
||||
<view class="settings-card card-line flex-row-center-between">
|
||||
<view>
|
||||
<view class="card-heard flex-row-center-between">
|
||||
<view class="card-heard-left flex-row-center">
|
||||
<text class="card-heard-left-text">新消息系统通知</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-tip"> 开启语音提示避免落单</view>
|
||||
</view>
|
||||
<uv-switch v-model="value" @change="changeVoice" activeColor="#E8101E"></uv-switch>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="settings-title">
|
||||
按消息类型设置
|
||||
</view>
|
||||
|
||||
<view class="settings-cards">
|
||||
<view class="settings-card card-line" @click="navigateTo(`/pages/message/message_setting`)">
|
||||
<view class="card-heard flex-row-center-between">
|
||||
<view class="card-heard-left flex-row-center">
|
||||
<image class="card-heard-left-icon1" mode="heightFix"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/b37e9054-c368-4463-a058-5262148b44dd.png">
|
||||
</image>
|
||||
<text class="card-heard-left-text">订单消息</text>
|
||||
</view>
|
||||
<view class="card-heard-right flex-row-center">
|
||||
<image
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/51f48a77-82f6-4952-9983-5a52401123b5.png"
|
||||
class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="card-tip"> 订单动态、履约信息等内容</view>
|
||||
</view>
|
||||
<view class="settings-card card-line" @click="navigateTo(`/pages/message/active_setting`)">
|
||||
<view class="card-heard flex-row-center-between">
|
||||
<view class="card-heard-left flex-row-center">
|
||||
<image class="card-heard-left-icon2" mode="heightFix"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/468b55e0-6ef2-4abf-9c0c-f015557061ec.png">
|
||||
</image>
|
||||
<text class="card-heard-left-text">活动优惠</text>
|
||||
</view>
|
||||
<view class="card-heard-right flex-row-center">
|
||||
<image
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/51f48a77-82f6-4952-9983-5a52401123b5.png"
|
||||
class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="card-tip"> 福利促销、互动玩法等热门活动咨询</view>
|
||||
</view>
|
||||
<!-- 点击触发弹窗 -->
|
||||
<!-- <view class="settings-card card-line" @click="showTestDialog = true">
|
||||
<view class="card-heard flex-row-center-between">
|
||||
<view class="card-heard-left flex-row-center">
|
||||
|
||||
<text class="card-heard-left-text">收不到推送消息?</text>
|
||||
</view>
|
||||
<view class="card-heard-right flex-row-center">
|
||||
<text class="card-heard-right-text">立即测试</text>
|
||||
<image
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/51f48a77-82f6-4952-9983-5a52401123b5.png"
|
||||
class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- 弹窗组件 -->
|
||||
<transition name="fade-scale">
|
||||
<view v-if="showTestDialog" class="dialog-mask" @click="showTestDialog = false" @touchmove.prevent>
|
||||
<view class="dialog-container" :style="{ backgroundImage: `url(${dialogBgImage})` }" @click.stop>
|
||||
<view class="dialog-title">温馨提示</view>
|
||||
<view class="dialog-content">
|
||||
测试已提交,若5分钟后仍未收到推送消息,请联系官方客服进行处理。
|
||||
</view>
|
||||
<view class="dialog-btn" @click.stop="showTestDialog = false">
|
||||
<text class="dialog-btn-text">好的</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</transition>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {
|
||||
isNotificationsEnabled,
|
||||
permissions
|
||||
} from '@/utils/AS-NotifyTheAuthority.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showTestDialog:false,
|
||||
value: true,
|
||||
isEnabled:true,
|
||||
stateList:[],
|
||||
dialogBgImage:"https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/dc1ad615-54be-4274-9fd8-e13a9b15b8db.png"
|
||||
}
|
||||
},
|
||||
async onShow(){
|
||||
await this.getReceiveState()
|
||||
this.isEnabled = isNotificationsEnabled()
|
||||
this.showChangeState()
|
||||
// #ifdef APP-PLUS
|
||||
|
||||
// #endif
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
computed:{
|
||||
isEnabledValue(){
|
||||
return this.isEnabled?"已开启":"前往开启"
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async getReceiveState(){
|
||||
await request.post('/user/push/getReceiveState').then(result => {
|
||||
this.stateList = result.data.list
|
||||
this.value = this.stateList[1].state ==1 ? true:false
|
||||
})
|
||||
},
|
||||
showChangeState(){
|
||||
//如果系统通知状态和后台通知状态不一致
|
||||
let isSatae = this.isEnabled ? 1 : 2
|
||||
console.log("state", this.stateList[0].state,isSatae)
|
||||
if(this.stateList[0].state != isSatae){
|
||||
request.post('/user/push/setReceiveState', {
|
||||
message_type_id: -1,
|
||||
message_kind_id: 0,
|
||||
state: isSatae
|
||||
}).then(result => {
|
||||
console.log("setReceiveState", result)
|
||||
})
|
||||
}
|
||||
},
|
||||
changeVoice(e){
|
||||
let isSatae = e ? 1 : 2
|
||||
request.post('/user/push/setReceiveState', {
|
||||
message_type_id: -2,
|
||||
message_kind_id: 0,
|
||||
state: isSatae
|
||||
}).then(result => {
|
||||
console.log("setReceiveState", result)
|
||||
})
|
||||
},
|
||||
// 页面导航
|
||||
navigateTo(url) {
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
},
|
||||
//去app通知页
|
||||
goPermissions(){
|
||||
if(!this.isEnabled){
|
||||
permissions(true)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.settings-page {
|
||||
padding: 20rpx;
|
||||
|
||||
.settings-title {
|
||||
font-weight: 500;
|
||||
font-size: 22rpx;
|
||||
color: #979797;
|
||||
line-height: 30rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.settings-cards {
|
||||
box-sizing: border-box;
|
||||
width: 710rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 40rpx;
|
||||
|
||||
.settings-card {
|
||||
padding: 30rpx 0rpx 36rpx 0rpx;
|
||||
|
||||
.card-heard {
|
||||
.card-heard-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
|
||||
.card-heard-left-icon {
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.card-heard-left-icon1 {
|
||||
width: 32rpx;
|
||||
height: 34rpx;
|
||||
}
|
||||
|
||||
.card-heard-left-icon2 {
|
||||
width: 32rpx;
|
||||
height: 29rpx;
|
||||
}
|
||||
|
||||
.card-heard-left-text {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.card-heard-right {
|
||||
gap: 10rpx;
|
||||
|
||||
.card-heard-right-text {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.arrow-right {
|
||||
width: 8rpx;
|
||||
height: 16rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.card-tip {
|
||||
margin-top: 20rpx;
|
||||
font-weight: 400;
|
||||
font-size: 22rpx;
|
||||
color: #979797;
|
||||
line-height: 30rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.card-line {
|
||||
border-bottom: 1rpx solid #F5F5F5;
|
||||
}
|
||||
}
|
||||
|
||||
.color-red {
|
||||
color: #E8101E !important;
|
||||
}
|
||||
|
||||
// 弹窗遮罩
|
||||
.dialog-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
// 弹窗容器
|
||||
.dialog-container {
|
||||
height: 526rpx;
|
||||
width: 582rpx;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
background-position: center;
|
||||
padding: 80rpx 40rpx 60rpx 40rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
min-height: 400rpx;
|
||||
}
|
||||
|
||||
.dialog-title {
|
||||
font-weight: 500;
|
||||
font-size: 38rpx;
|
||||
color: #333333;
|
||||
line-height: 53rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.dialog-content {
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
line-height: 50rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-top: 50rpx;
|
||||
margin-bottom: 70rpx;
|
||||
}
|
||||
|
||||
.dialog-btn {
|
||||
width: 400rpx;
|
||||
height: 88rpx;
|
||||
background: #E8101E;
|
||||
border-radius: 44rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: opacity 0.1s;
|
||||
}
|
||||
.dialog-btn-text {
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
// 平滑过渡动画
|
||||
.fade-scale-enter-active,
|
||||
.fade-scale-leave-active {
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.fade-scale-enter{
|
||||
opacity: 0;
|
||||
transform: scale(0.9);
|
||||
}
|
||||
.fade-scale-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
2155
pages/my/my.vue
2155
pages/my/my.vue
File diff suppressed because it is too large
Load Diff
|
|
@ -32,26 +32,26 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
orderId: '',
|
||||
order_type:1,//订单类型,1普通,6自营
|
||||
serviceType:1,//订单类型,1普通,2自营
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.orderId) {
|
||||
this.orderId = options.orderId
|
||||
}
|
||||
if(options.order_type){
|
||||
this.order_type = options.order_type
|
||||
if(options.serviceType){
|
||||
this.serviceType = options.serviceType
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goToOrder() {
|
||||
if(this.serviceType==1){
|
||||
uni.redirectTo({
|
||||
url:`/pages/order/userorder-detail?order_id=${this.orderId}`
|
||||
url:`/pages/order/userorder-detail?id=${this.orderId}`
|
||||
})
|
||||
}else{
|
||||
uni.redirectTo({
|
||||
url: `/pages/order/userorder-detail?order_id=${this.orderId}&order_type=6`
|
||||
url: `/pages/order/userorder-detail?id=${this.orderId}&serviceType=2`
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@
|
|||
if(this.table_source == "order_self"){
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url:`/pages/order/pay-success?orderId=${this.orderInfo.id}&order_type=6`
|
||||
url:`/pages/order/pay-success?orderId=${this.orderInfo.id}&serviceType=2`
|
||||
})
|
||||
}, 50)
|
||||
}else{
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
</view>
|
||||
<view class="invite-text" v-if="orderInfo.team_buy_order_state == 2">参团成功,已拼团成功!</view>
|
||||
|
||||
<view class="invite-time" v-if="orderInfo.team_buy_order_state == 1">
|
||||
<view class="invite-time" v-if="orderInfo.team_buy_order_state == 1">
|
||||
<span class="invite-time-line1"></span>剩余
|
||||
<uv-count-down :time="orderInfo.team_buy.remain_time*1000" format="HH:mm:ss" autoStart millisecond
|
||||
@change="onChange" @finish="onFinish">
|
||||
|
|
@ -150,24 +150,18 @@
|
|||
<view class="service-name">{{ orderInfo.server_title }}
|
||||
<view class="service-name-num">×1</view>
|
||||
</view>
|
||||
|
||||
<view v-if="orderInfo.team_buy_id" class="group-price">
|
||||
<text class="service-price"><text
|
||||
style="font-size: 20rpx;">¥</text>{{ orderInfo.order_money }}</text>
|
||||
<text class="service-price2">原价{{ orderInfo.line_money }}</text>
|
||||
<image class="service-tuanGou" src="/static/images/icons/tuanGou.png"></image>
|
||||
</view>
|
||||
|
||||
<view class="group-price" v-else>
|
||||
<text class="service-price"><text
|
||||
style="font-size: 20rpx;">¥</text>{{ orderInfo.order_money }}</text>
|
||||
<text class="service-price2">原价{{ orderInfo.line_money }}</text>
|
||||
<view class="service-price">原价¥{{ orderInfo.cost_money }}</view>
|
||||
<view class="service-price2">团购价:¥<text style="font-size: 36rpx">{{
|
||||
orderInfo.order_money
|
||||
}}</text></view>
|
||||
</view>
|
||||
<text class="service-price2" style="color: #333" v-else>¥
|
||||
<text style="font-size: 36rpx">{{ orderInfo.order_money }}</text>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="service-real">
|
||||
<text class="coupon-text">共优惠</text>
|
||||
<text class="coupon-price">¥{{ orderInfo.pay_money || 0 }}</text>
|
||||
<text class="real-lable">实付金额:</text>
|
||||
<text class="real-price">¥{{ orderInfo.pay_money || 0 }}</text>
|
||||
</view>
|
||||
|
|
@ -314,15 +308,15 @@
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
order_type: 1, //订单类型,1普通,6自营
|
||||
urls: {
|
||||
1: {
|
||||
cancelorder: "/user/cancelorder",
|
||||
deleteorder: "/user/deleteorder"
|
||||
serviceType:1,//订单类型,1普通,2自营
|
||||
urls:{
|
||||
1:{
|
||||
cancelorder:"/user/cancelorder",
|
||||
deleteorder:"/user/deleteorder"
|
||||
},
|
||||
2: {
|
||||
cancelorder: "/user/orderSelf/cancel",
|
||||
deleteorder: "/user/orderSelf/del"
|
||||
2:{
|
||||
cancelorder:"/user/orderSelf/cancel",
|
||||
deleteorder:"/user/orderSelf/del"
|
||||
}
|
||||
},
|
||||
path: '',
|
||||
|
|
@ -343,16 +337,12 @@
|
|||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.id = options.order_id;
|
||||
if (options.order_type) {
|
||||
this.order_type = options.order_type
|
||||
}
|
||||
this.id = options.id;
|
||||
if(options.serviceType){
|
||||
this.serviceType = options.serviceType
|
||||
}
|
||||
// 请求订单详情
|
||||
this.getOrderDetail();
|
||||
//信息读取
|
||||
if (options.messageId) {
|
||||
this.messageRead(options.messageId)
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop;
|
||||
|
|
@ -424,13 +414,6 @@
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
//消息列表跳转阅读
|
||||
messageRead(id){
|
||||
request.post("/user/push/messageRead",{id:id}).then(res=>{
|
||||
console.log("messageRead:",res)
|
||||
this.messageUpudateNum()
|
||||
})
|
||||
},
|
||||
async goInvite() {
|
||||
let groupText = ""
|
||||
if (this.orderInfo?.team_buy_order_state == 1) {
|
||||
|
|
@ -518,7 +501,7 @@
|
|||
|
||||
getOrderDetail() {
|
||||
let url = "/user/orderdetail"
|
||||
if (this.serviceType == 2) {
|
||||
if(this.serviceType==2){
|
||||
url = "/user/orderSelf/details"
|
||||
}
|
||||
request
|
||||
|
|
@ -783,18 +766,18 @@
|
|||
|
||||
// 支付订单
|
||||
payOrder() {
|
||||
if (this.orderInfo.table_source == "order_self") {
|
||||
if(this.orderInfo.table_source == "order_self"){
|
||||
// TODO: 实现支付功能
|
||||
uni.navigateTo({
|
||||
url: `/pages/order/pay?id=${this.orderInfo.id}&money=${this.orderInfo.order_money}&title=${this.orderInfo.server_title}&number=${this.orderInfo.number}&table_source=order_self`,
|
||||
});
|
||||
} else {
|
||||
}else{
|
||||
// TODO: 实现支付功能
|
||||
uni.navigateTo({
|
||||
url: `/pages/order/pay?id=${this.orderInfo.id}&money=${this.orderInfo.order_money}&title=${this.orderInfo.server_title}&number=${this.orderInfo.number}`,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
// 评价订单
|
||||
|
|
@ -1253,36 +1236,25 @@
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
.group-price {
|
||||
position: relative;
|
||||
|
||||
.service-tuanGou {
|
||||
position: absolute;
|
||||
width: 70rpx;
|
||||
height: 32rpx;
|
||||
left: 0;
|
||||
top: -34rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.service-price {
|
||||
font-family: DINPro, DINPro;
|
||||
font-weight: 500;
|
||||
font-size: 42rpx;
|
||||
color: #E8101E;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #bbbbbb;
|
||||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-bottom: 7rpx;
|
||||
}
|
||||
|
||||
.service-price2 {
|
||||
font-weight: 400;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
color: #E8101E;
|
||||
line-height: 34rpx;
|
||||
margin-left: 4rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
|
||||
.service-count {
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
|
|
@ -1297,24 +1269,6 @@
|
|||
border-top: 1rpx solid rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.coupon-text {
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
line-height: 42rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
.coupon-price {
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #E8101E;
|
||||
line-height: 42rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-right: 220rpx;
|
||||
}
|
||||
|
||||
.real-lable {
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
|
|
|
|||
|
|
@ -316,12 +316,12 @@
|
|||
if (order.table_source == "order") {
|
||||
//如果是普通订单
|
||||
uni.navigateTo({
|
||||
url: `/pages/order/userorder-detail?order_id=${order.id}`
|
||||
url: `/pages/order/userorder-detail?id=${order.id}`
|
||||
})
|
||||
} else if (order.table_source == "order_self") {
|
||||
//如果是自营订单
|
||||
uni.navigateTo({
|
||||
url: `/pages/order/userorder-detail?order_id=${order.id}&order_type=6`
|
||||
url: `/pages/order/userorder-detail?id=${order.id}&serviceType=2`
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -481,10 +481,6 @@
|
|||
this.formData.page = 1;
|
||||
this.orderList = [];
|
||||
this.loadOrders();
|
||||
// setTimeout(()=>{
|
||||
|
||||
// },2000)
|
||||
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
|
|
@ -526,8 +522,7 @@
|
|||
console.log('申请退款订单返回结果', res)
|
||||
uni.showToast({
|
||||
title: '申请退款成功!',
|
||||
icon: 'none',
|
||||
|
||||
icon: 'none'
|
||||
})
|
||||
this.formData.page = 1;
|
||||
this.orderList = [];
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@
|
|||
1:"/syr/serversPromotion/promotionEffect"
|
||||
},
|
||||
},
|
||||
identityIndex: getApp().globalData.artisanType,
|
||||
identityIndex: 2,
|
||||
orders: [{
|
||||
orderNo: 'M233448656770000123456',
|
||||
imgUrl: 'https://p3-flow-imagex-sign.byteimg.com/tos-cn-i-a9rns2rl98/d1e9d7f08119492eb09a3d5c4c57501e.png~tplv-a9rns2rl98-24:720:720.jpeg?rcl=20251107141120721CF58B043A61780C8D&rk3s=8e244e95&rrcfp=d52e923b&x-expires=1763100680&x-signature=mZIqELwlIogxW0rc95Q0YbPqmvQ%3D',
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@
|
|||
<view class="promotion-add-text">添加推广服务</view>
|
||||
<image src="/static/images/recruit/guide.png" class="promotion-add-img2" @click="goToGuide"></image>
|
||||
</view>
|
||||
<uv-search placeholder="服务名称" v-model="listQuery.title" height="70rpx" :showAction="false" class="uv-search" @search="search">
|
||||
<uv-search placeholder="服务名称" v-model="listQuery.title" height="70rpx" :showAction="false" class="uv-search"
|
||||
@search="search">
|
||||
<template v-slot:prefix>
|
||||
<image src="/static/images/recruit/search_icon.png" class="search_icon"></image>
|
||||
</template>
|
||||
|
|
@ -28,7 +29,8 @@
|
|||
<view class="promotion-list">
|
||||
|
||||
<view class="promotion-item" v-for="(item,index) in list" :key="index">
|
||||
<image src="/static/images/recruit/Effect.png" class="promotion-item-Effect" @click="goEffect(item)"></image>
|
||||
<image src="/static/images/recruit/Effect.png" class="promotion-item-Effect"
|
||||
@click="goEffect(item)"></image>
|
||||
<view class="promotion-item-heard">
|
||||
<image :src="item.photo[0]" mode="aspectFill" class="promotion-item-heard-photo">
|
||||
</image>
|
||||
|
|
@ -39,9 +41,10 @@
|
|||
<view class="promotion-item-heard-right-text3">预估金额:{{item.estimate_commission}}元
|
||||
</view>
|
||||
<view class="promotion-item-heard-right-text4"><text
|
||||
style="font-size: 24rpx;">¥</text>{{item.server_price}}</view>
|
||||
style="font-size: 24rpx;font-weight: 500;">¥</text>{{item.server_price}}</view>
|
||||
</view>
|
||||
<view class="promotion-item-tip" v-if="item.server_price==0">温馨提示:最终佣金少于1分钱,将不再推广渠道展示
|
||||
</view>
|
||||
<view class="promotion-item-tip" v-if="item.server_price==0">温馨提示:最终佣金少于1分钱,将不再推广渠道展示</view>
|
||||
|
||||
</view>
|
||||
<view class="promotion-item-bottom">
|
||||
|
|
@ -90,16 +93,16 @@
|
|||
return {
|
||||
selectItem: {},
|
||||
apiObj: {
|
||||
list:{
|
||||
2:"/sj/serversPromotion/list",
|
||||
1:"/syr/serversPromotion/list"
|
||||
list: {
|
||||
2: "/sj/serversPromotion/list",
|
||||
1: "/syr/serversPromotion/list"
|
||||
},
|
||||
switch:{
|
||||
2:"/sj/serversPromotion/switch",
|
||||
1:"/syr/serversPromotion/switch"
|
||||
switch: {
|
||||
2: "/sj/serversPromotion/switch",
|
||||
1: "/syr/serversPromotion/switch"
|
||||
}
|
||||
},
|
||||
identityIndex: getApp().globalData.artisanType,
|
||||
identityIndex: 2,
|
||||
tabsList: [{
|
||||
name: "推广中",
|
||||
},
|
||||
|
|
@ -108,11 +111,11 @@
|
|||
},
|
||||
|
||||
],
|
||||
tabsIndex: 0,//根据身份确定index值
|
||||
tabsIndex: 0, //根据身份确定index值
|
||||
keyword: '',
|
||||
listQuery: {
|
||||
state: 1,
|
||||
title:"",
|
||||
title: "",
|
||||
},
|
||||
}
|
||||
},
|
||||
|
|
@ -122,11 +125,9 @@
|
|||
async onLoad() {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
this.statusBarHeight = systemInfo.statusBarHeight;
|
||||
if(this.identityIndex){
|
||||
this.$nextTick(() => {
|
||||
this.search();
|
||||
})
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.search();
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
goEffect(item) {
|
||||
|
|
@ -221,7 +222,6 @@
|
|||
</script>
|
||||
|
||||
<style lang="less">
|
||||
|
||||
.promotion {
|
||||
.promotion-search {
|
||||
background: linear-gradient(134deg, #f52540 0%, #e8101e 100%);
|
||||
|
|
@ -320,8 +320,8 @@
|
|||
border-radius: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
position: relative;
|
||||
|
||||
.promotion-item-tip{
|
||||
|
||||
.promotion-item-tip {
|
||||
width: 100%;
|
||||
font-weight: 400;
|
||||
font-size: 22rpx;
|
||||
|
|
@ -361,28 +361,30 @@
|
|||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-bottom: 10rpx;
|
||||
margin-top: -6rpx;
|
||||
|
||||
width: 300rpx;
|
||||
}
|
||||
|
||||
.promotion-item-heard-right-text2 {
|
||||
margin-bottom: 11rpx;
|
||||
padding: 2rpx 8rpx;
|
||||
border-radius: 6rpx;
|
||||
width: fit-content;
|
||||
border: 1rpx solid rgba(232,16,30,0.2);
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #E8101E;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
padding: 2rpx 8rpx;
|
||||
border-radius: 6rpx;
|
||||
width: fit-content;
|
||||
border: 1rpx solid rgba(232, 16, 30, 0.2);
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #E8101E;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.promotion-item-heard-right-text3 {
|
||||
padding: 3rpx 8rpx;
|
||||
border-radius: 6rpx;
|
||||
width: fit-content;
|
||||
border: 1rpx solid rgba(182,115,43,0.2);
|
||||
border: 1rpx solid rgba(182, 115, 43, 0.2);
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #B6732B;
|
||||
|
|
@ -400,6 +402,7 @@ font-style: normal;
|
|||
line-height: 46rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-top: -6rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -442,7 +445,7 @@ font-style: normal;
|
|||
|
||||
|
||||
.modal-buttons {
|
||||
|
||||
|
||||
padding: 0 54rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
@ -482,7 +485,7 @@ font-style: normal;
|
|||
padding-top: 50rpx;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333!important;
|
||||
color: #333333 !important;
|
||||
line-height: 45rpx;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
1: "/syr/serversPromotion/edit"
|
||||
}
|
||||
},
|
||||
identityIndex: getApp().globalData.artisanType,
|
||||
identityIndex: 2,
|
||||
type: 1. //1为编辑。2为修改3为添加
|
||||
};
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,416 +0,0 @@
|
|||
<template>
|
||||
<view class="login-page">
|
||||
<!-- 顶部导航栏 -->
|
||||
<custom-navbar
|
||||
:title="title"
|
||||
:show-back="true"
|
||||
title-color="#000"
|
||||
background-color="transparent"
|
||||
></custom-navbar>
|
||||
<view class="login-cont">
|
||||
<view class="logo">
|
||||
<image src="/static/logo.png" mode="aspectFill" class="logo-icon"></image>
|
||||
美融融
|
||||
</view>
|
||||
<view class="welcome">欢迎登录进行使用!</view>
|
||||
<view class="inp-phpne">
|
||||
<input type="number" class="inp" placeholder="请输入账号" maxlength="11" :value="phone" @input="inputPhone" />
|
||||
</view>
|
||||
<view class="inp-code">
|
||||
<input type="number" class="inp" placeholder="请输入验证码" maxlength="4" :value="code" @input="inputCode" />
|
||||
<view class="code-btn" :class="{ disabled: countdown > 0 }" @click.stop="getCode">
|
||||
{{ countdown > 0 ? `${countdown}s` : '获取验证码' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="inp-psd">
|
||||
<input type="text" class="inp" placeholder="请输入密码(6~12位字母+数字)" maxlength="12" :value="password" @input="inputPassword" :password="!showPassword" />
|
||||
<image src="/static/images/dislook_psd.png"
|
||||
mode="aspectFill"
|
||||
class="look-icon"
|
||||
v-if="!showPassword"
|
||||
@click.stop="showPassword = true"></image>
|
||||
<image src="/static/images/look_psd.png"
|
||||
mode="aspectFill"
|
||||
class="look-icon"
|
||||
@click.stop="showPassword = false"
|
||||
v-else></image>
|
||||
</view>
|
||||
<view class="inp-psd">
|
||||
<input type="text" class="inp" placeholder="再次输入密码(6~12位字母+数字)" maxlength="12" :value="twopassword" @input="inputTwopassword" :password="!showAgainPassword" />
|
||||
<image src="/static/images/dislook_psd.png"
|
||||
mode="aspectFill"
|
||||
class="look-icon"
|
||||
v-if="!showAgainPassword"
|
||||
@click.stop="showAgainPassword = true"></image>
|
||||
<image src="/static/images/look_psd.png"
|
||||
mode="aspectFill"
|
||||
class="look-icon"
|
||||
@click.stop="showAgainPassword = false"
|
||||
v-else></image>
|
||||
</view>
|
||||
<view class="login" @click="tapLogin">{{handel == 'register' ? '注册' : handel == 'forget' ? '修改密码' : ''}}</view>
|
||||
<view class="other">{{handel == 'register' ? '已有账号,前去' : ''}}<text class="texta" @click="goLogin">{{handel == 'register' ? '登录' : handel == 'forget' ? '返回登录' : ''}}</text></view>
|
||||
|
||||
<view class="agree">
|
||||
<agree-radio :isAgree="isAgree"
|
||||
@change-agree="changeAgree"
|
||||
class="agree-btn"></agree-radio>
|
||||
<text class="agree-text">已阅读并同意</text>
|
||||
<text class="agreement" @click="goAgreement(3)">《用户注册协议》</text>
|
||||
<text class="agree-text">和</text>
|
||||
<text class="agreement" @click="goAgreement(4)">《隐私政策》</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '../../utils/request';
|
||||
import AgreeRadio from '@/components/agree-radio/agree-radio.vue'
|
||||
export default {
|
||||
components: {
|
||||
AgreeRadio
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
phone: '', // 手机号
|
||||
code: '', // 验证码
|
||||
password: '', // 密码
|
||||
twopassword: '',
|
||||
codeTips: '获取验证码',
|
||||
handel: null,
|
||||
inviteCodeOther: null,
|
||||
isAgree: false,
|
||||
countdown: 0,
|
||||
timer: null,
|
||||
showPassword: false,
|
||||
showAgainPassword: false
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
let that = this;
|
||||
that.handel = !options.handel ? 'register' : options.handel;
|
||||
that.title = options.handel == 'register' ? '注册账号' : '忘记密码';
|
||||
that.inviteCodeOther = options.inviteCodeOther;
|
||||
},
|
||||
methods: {
|
||||
// 密码格式校验
|
||||
validatePassword(password) {
|
||||
const reg = /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,12}$/;
|
||||
return reg.test(password);
|
||||
},
|
||||
inputPhone(e) {
|
||||
let that = this;
|
||||
that.phone = e.detail.value;
|
||||
},
|
||||
inputCode(e) {
|
||||
let that = this;
|
||||
that.code = e.detail.value;
|
||||
},
|
||||
inputPassword(e) {
|
||||
let that = this;
|
||||
that.password = e.detail.value;
|
||||
},
|
||||
inputTwopassword(e) {
|
||||
let that = this;
|
||||
that.twopassword = e.detail.value;
|
||||
},
|
||||
// 获取验证码
|
||||
async getCode() {
|
||||
if (this.countdown > 0) return
|
||||
let that = this;
|
||||
let type = that.handel == 'register' ? 1 : 3
|
||||
// App阻止冒泡
|
||||
// #ifdef APP-NVUE
|
||||
e.stopPropagation()
|
||||
// #endif
|
||||
if (!/^1[3456789]\d{9}$/.test(that.phone)) {
|
||||
uni.showToast({
|
||||
title: '请输入正确的手机号',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if(this.handel == 'forget') {
|
||||
const isaccount = await request.post('/user/isaccount',{account: that.phone});
|
||||
if(isaccount.state == 2) {
|
||||
uni.showToast({
|
||||
title: '该账户未注册!',
|
||||
icon: 'none'
|
||||
})
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 开始倒计时
|
||||
this.countdown = 60
|
||||
this.timer = setInterval(() => {
|
||||
if (this.countdown > 0) {
|
||||
this.countdown--
|
||||
} else {
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
}, 1000)
|
||||
|
||||
// 请求获取验证码接口
|
||||
request.post('/user/sendcode',{account: that.phone,type}).then(result=>{
|
||||
if(result.state == 1) {
|
||||
uni.showToast({
|
||||
title: result.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}else {
|
||||
uni.showToast({
|
||||
title: result.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 是否同意修改
|
||||
changeAgree(value) {
|
||||
this.isAgree = value;
|
||||
},
|
||||
// 注册或者修改
|
||||
tapLogin() {
|
||||
let that = this;
|
||||
let wayId = that.wayId;
|
||||
let regOne = that.validatePassword(that.password);
|
||||
let regTwo = that.validatePassword(that.twopassword);
|
||||
if (!/^1[3456789]\d{9}$/.test(that.phone)) {
|
||||
uni.showToast({
|
||||
title: '请输入正确的手机号',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}else if(!that.code) {
|
||||
uni.showToast({
|
||||
title: '请输入验证码',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}else if(!that.password && !that.twopassword) {
|
||||
uni.showToast({
|
||||
title: '请输入密码',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}else if(!regOne && !regTwo) {
|
||||
uni.showToast({
|
||||
title: '请输入正确的密码',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}else if(that.password != that.twopassword) {
|
||||
uni.showToast({
|
||||
title: '两次密码输入不一致',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}else if(!that.isAgree){
|
||||
uni.showToast({
|
||||
title: '请先阅读并同意《用户注册协议》与《隐私政策》',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if(that.handel == 'register') {
|
||||
let data = {
|
||||
account: that.phone,
|
||||
code: that.code,
|
||||
password: that.password,
|
||||
invite_code_other: that.inviteCodeOther
|
||||
}
|
||||
// 请求登录注册接口
|
||||
request.post('/user/useryhadd',data).then(result=>{
|
||||
if(result.state == 1) {
|
||||
uni.navigateBack({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}else {
|
||||
uni.showToast({
|
||||
title: result.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
}else if(that.handel == 'forget') {
|
||||
// 请求修改密码接口
|
||||
let data = {
|
||||
account: that.phone,
|
||||
code: that.code,
|
||||
password: that.password
|
||||
}
|
||||
// 请求修改密码接口
|
||||
request.post('/user/passwordchangebycode',data).then(result=>{
|
||||
if(result.state == 1) {
|
||||
uni.showToast({
|
||||
title: result.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
uni.navigateBack({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}else {
|
||||
uni.showToast({
|
||||
title: result.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
// 前去登录页面
|
||||
goLogin() {
|
||||
uni.navigateBack({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
},
|
||||
goAgreement(type) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/agreement/agreement?type="+type
|
||||
})
|
||||
}
|
||||
},
|
||||
// 页面销毁时清除定时器
|
||||
onUnload() {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
.login-page {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.login-page::before {
|
||||
content: '';
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 1200rpx !important;
|
||||
background-image: url('/static/images/bg.png');
|
||||
background-size: cover;
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
z-index: 1;
|
||||
}
|
||||
.login-cont {
|
||||
width: 750rpx;
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
padding: 140rpx 72rpx 16rpx 48rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.logo {
|
||||
width: 750rpx;
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-self: flex-start;
|
||||
align-items: center;
|
||||
font-size: 64rpx;
|
||||
color: #1F2329;
|
||||
}
|
||||
.logo-icon {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
.welcome {
|
||||
font-size: 40rpx;
|
||||
color: #646A73;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
.inp-phpne {
|
||||
margin-top: 108rpx;
|
||||
}
|
||||
.inp-psd,.inp-code {
|
||||
position: relative;
|
||||
}
|
||||
.inp {
|
||||
width: 630rpx;
|
||||
height: 96rpx;
|
||||
border: 2rpx solid #D0D3D5;
|
||||
padding: 0 48rpx;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 32rpx;
|
||||
}
|
||||
.look-icon {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 32rpx;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
.code-btn {
|
||||
width: 208rpx;
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
color: #332F30;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 0;
|
||||
transform: translateY(-50%);
|
||||
border-left: 2rpx solid #D0D3D5;
|
||||
}
|
||||
.login {
|
||||
width: 630rpx;
|
||||
height: 96rpx;
|
||||
background-color: #FD4778;
|
||||
color: #fff;
|
||||
font-size: 40rpx;
|
||||
line-height: 96rpx;
|
||||
text-align: center;
|
||||
border-radius: 40rpx;
|
||||
margin-top: 34rpx;
|
||||
margin-bottom: 32rpx;
|
||||
}
|
||||
.other {
|
||||
font-size: 32rpx;
|
||||
color: #8F959E;
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.xian {
|
||||
margin: 0 32rpx;
|
||||
}
|
||||
.agree {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 48rpx;
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.agreement {
|
||||
display: inline-block;
|
||||
color: #1456F0;
|
||||
padding: 0 4rpx;
|
||||
}
|
||||
.agree-text {
|
||||
font-size: 24rpx;
|
||||
color: #8F959E;
|
||||
}
|
||||
.agree-btn {
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.texta {
|
||||
color: #1456F0;
|
||||
padding: 0 4rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -623,7 +623,7 @@
|
|||
});
|
||||
let type = that.identity == 1 ? 2 : that.identity == 2 ? 3 : '';
|
||||
if (result.data.apply_state == 3) {
|
||||
request.post('/user/getuser', {
|
||||
request.post('/sj/user/getuser', {
|
||||
type
|
||||
}).then(res => {
|
||||
that.formData = res.data;
|
||||
|
|
@ -687,7 +687,7 @@
|
|||
// },
|
||||
|
||||
getUserInfo() {
|
||||
request.post('/user/getuser', {
|
||||
request.post('/sj/user/getuser', {
|
||||
type: 1
|
||||
}).then(result => {
|
||||
this.formData.account = result.data.account;
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@
|
|||
<text class="label required">资质照片</text>
|
||||
<view class="upload-tip">请保证图片上的文字清晰、无遮挡、证件边角可见</view>
|
||||
<view class="upload-container">
|
||||
<view class="upload-box" @click="chooseImage('business_license')">
|
||||
<view class="upload-box" @click="chooseImage('uscc_photo')">
|
||||
<view class="upload-camera license-upload">
|
||||
<image v-if="formData.business_license" :src="formData.business_license" mode="aspectFill" class="preview-image"></image>
|
||||
<image v-if="formData.uscc_photo" :src="formData.uscc_photo" mode="aspectFill" class="preview-image"></image>
|
||||
<image v-else src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/92bd4268-b4d7-4725-8664-9e44f828c7d9" mode="aspectFit" class="camera-icon"></image>
|
||||
<!-- 识别状态遮罩 -->
|
||||
<!-- <view v-if="isRecognizing && recognizeType === 'business_license'" class="recognize-overlay">
|
||||
<!-- <view v-if="isRecognizing && recognizeType === 'uscc_photo'" class="recognize-overlay">
|
||||
<view class="recognize-loading"></view>
|
||||
<text class="recognize-text">识别中...</text>
|
||||
</view> -->
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
<view class="label-wrapper">
|
||||
<text class="label required">商户类型</text>
|
||||
</view>
|
||||
<input type="text" v-model="formData.merchant_type" placeholder="请输入商户类型"
|
||||
<input type="text" v-model="formData.uscc_type" placeholder="请输入商户类型"
|
||||
placeholder-class="placeholder" class="input"
|
||||
@input="saveFormDataToLocalDebounce" />
|
||||
</view>
|
||||
|
|
@ -41,9 +41,9 @@
|
|||
<view class="form-item-one box-cont">
|
||||
<view class="label-wrapper">
|
||||
<text class="label required">证件号码</text>
|
||||
<image class="label-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108" mode="aspectFit" @click="showTipPopup('license_number')"></image>
|
||||
<image class="label-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108" mode="aspectFit" @click="showTipPopup('uscc_num')"></image>
|
||||
</view>
|
||||
<input type="text" v-model="formData.license_number" placeholder="请输入营业执照的证件号码"
|
||||
<input type="text" v-model="formData.uscc_num" placeholder="请输入营业执照的证件号码"
|
||||
placeholder-class="placeholder" class="input"
|
||||
@input="saveFormDataToLocalDebounce" />
|
||||
</view>
|
||||
|
|
@ -51,9 +51,9 @@
|
|||
<view class="form-item-one box-cont">
|
||||
<view class="label-wrapper">
|
||||
<text class="label required">企业名称</text>
|
||||
<image class="label-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108" mode="aspectFit" @click="showTipPopup('company_name')"></image>
|
||||
<image class="label-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108" mode="aspectFit" @click="showTipPopup('uscc_name')"></image>
|
||||
</view>
|
||||
<input type="text" v-model="formData.company_name" placeholder="请输入营业执照的企业名称"
|
||||
<input type="text" v-model="formData.uscc_name" placeholder="请输入营业执照的企业名称"
|
||||
placeholder-class="placeholder" class="input"
|
||||
@input="saveFormDataToLocalDebounce" />
|
||||
</view>
|
||||
|
|
@ -76,12 +76,12 @@
|
|||
<view class="idcard-upload-vertical-container">
|
||||
<!-- 身份证正面 -->
|
||||
<view class="idcard-upload-vertical-item">
|
||||
<view class="upload-box" @click="chooseImage('idcard_front')">
|
||||
<view class="upload-box" @click="chooseImage('legal_idcard_positive')">
|
||||
<view class="upload-camera idcard-front">
|
||||
<image v-if="formData.idcard_front" :src="formData.idcard_front" mode="aspectFill" class="preview-image"></image>
|
||||
<image v-if="formData.legal_idcard_positive" :src="formData.legal_idcard_positive" mode="aspectFill" class="preview-image"></image>
|
||||
<image v-else src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/043b0c97-79c1-4f95-810f-c33e3d5269a3" mode="aspectFit" class="camera-icon"></image>
|
||||
<!-- 识别状态遮罩 -->
|
||||
<!-- <view v-if="isRecognizing && recognizeType === 'idcard_front'" class="recognize-overlay">
|
||||
<!-- <view v-if="isRecognizing && recognizeType === 'legal_idcard_positive'" class="recognize-overlay">
|
||||
<view class="recognize-loading"></view>
|
||||
<text class="recognize-text">识别中...</text>
|
||||
</view> -->
|
||||
|
|
@ -92,12 +92,12 @@
|
|||
|
||||
<!-- 身份证反面 -->
|
||||
<view class="idcard-upload-vertical-item">
|
||||
<view class="upload-box" @click="chooseImage('idcard_back')">
|
||||
<view class="upload-box" @click="chooseImage('legal_idcard_negative')">
|
||||
<view class="upload-camera idcard-back">
|
||||
<image v-if="formData.idcard_back" :src="formData.idcard_back" mode="aspectFill" class="preview-image"></image>
|
||||
<image v-if="formData.legal_idcard_negative" :src="formData.legal_idcard_negative" mode="aspectFill" class="preview-image"></image>
|
||||
<image v-else src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/203cfdf4-2501-44e6-8565-ad251c6bf0fa" mode="aspectFit" class="camera-icon"></image>
|
||||
<!-- 识别状态遮罩 -->
|
||||
<!-- <view v-if="isRecognizing && recognizeType === 'idcard_back'" class="recognize-overlay">
|
||||
<!-- <view v-if="isRecognizing && recognizeType === 'legal_idcard_negative'" class="recognize-overlay">
|
||||
<view class="recognize-loading"></view>
|
||||
<text class="recognize-text">识别中...</text>
|
||||
</view> -->
|
||||
|
|
@ -113,9 +113,9 @@
|
|||
<view class="form-item-one box-cont">
|
||||
<view class="label-wrapper">
|
||||
<text class="label required">法人代表</text>
|
||||
<image class="label-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108" mode="aspectFit" @click="showTipPopup('legal_person')"></image>
|
||||
<image class="label-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108" mode="aspectFit" @click="showTipPopup('legal_name')"></image>
|
||||
</view>
|
||||
<input type="text" v-model="formData.legal_person" placeholder="请输入营业执照的法人代表"
|
||||
<input type="text" v-model="formData.legal_name" placeholder="请输入营业执照的法人代表"
|
||||
placeholder-class="placeholder" class="input"
|
||||
@input="saveFormDataToLocalDebounce" />
|
||||
</view>
|
||||
|
|
@ -129,7 +129,7 @@
|
|||
|
||||
<view class="form-item-one box-cont">
|
||||
<text class="label required">法人身份证号</text>
|
||||
<input type="idcard" v-model="formData.legal_idcard" placeholder="请输入法人身份证号"
|
||||
<input type="idcard" v-model="formData.legal_idcard_num" placeholder="请输入法人身份证号"
|
||||
placeholder-class="placeholder" class="input"
|
||||
@input="saveFormDataToLocalDebounce" />
|
||||
</view>
|
||||
|
|
@ -139,14 +139,14 @@
|
|||
<text class="label required">身份证有效期至</text>
|
||||
<view class="radio-group">
|
||||
<view class="radio-item" @click="setIdcardValidType('permanent')">
|
||||
<view class="radio" :class="{ checked: formData.idcard_valid_type === 'permanent' }">
|
||||
<image v-if="formData.idcard_valid_type === 'permanent'" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cb185ec8-9d30-4e53-b5dc-14b546013a60" class="radio-icon-image" mode="aspectFit"></image>
|
||||
<view class="radio" :class="{ checked: formData.legal_idcard_expiry_type === 'permanent' }">
|
||||
<image v-if="formData.legal_idcard_expiry_type === 'permanent'" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cb185ec8-9d30-4e53-b5dc-14b546013a60" class="radio-icon-image" mode="aspectFit"></image>
|
||||
</view>
|
||||
<text class="radio-label">长久有效</text>
|
||||
</view>
|
||||
<view class="radio-item" @click="setIdcardValidType('date')">
|
||||
<view class="radio" :class="{ checked: formData.idcard_valid_type === 'date' }">
|
||||
<image v-if="formData.idcard_valid_type === 'date'" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cb185ec8-9d30-4e53-b5dc-14b546013a60" class="radio-icon-image" mode="aspectFit"></image>
|
||||
<view class="radio" :class="{ checked: formData.legal_idcard_expiry_type === 'date' }">
|
||||
<image v-if="formData.legal_idcard_expiry_type === 'date'" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cb185ec8-9d30-4e53-b5dc-14b546013a60" class="radio-icon-image" mode="aspectFit"></image>
|
||||
</view>
|
||||
<text class="radio-label">指定日期有效</text>
|
||||
</view>
|
||||
|
|
@ -168,13 +168,13 @@
|
|||
</view>
|
||||
<view class="date-item">
|
||||
<text class="date-label">结束日期</text>
|
||||
<view class="date-picker-box" :class="{ disabled: formData.idcard_valid_type === 'permanent' }"
|
||||
@click="formData.idcard_valid_type !== 'permanent' && openDatePicker('idcard_end_date')">
|
||||
<view class="date-picker-box" :class="{ disabled: formData.legal_idcard_expiry_type === 'permanent' }"
|
||||
@click="formData.legal_idcard_expiry_type !== 'permanent' && openDatePicker('idcard_end_date')">
|
||||
<text :class="formData.idcard_end_date ? 'date-value' : 'placeholder'">
|
||||
{{formatDateForDisplay(formData.idcard_end_date) || '请选择日期'}}
|
||||
</text>
|
||||
<view class="date-divider"></view>
|
||||
<image :src="formData.idcard_valid_type === 'permanent' ?
|
||||
<image :src="formData.legal_idcard_expiry_type === 'permanent' ?
|
||||
'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/bb9a757f-a36c-46bb-a59f-2caddac5365b' :
|
||||
'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/ce52b49f-2261-49ca-96ed-e9ad47049649'"
|
||||
class="date-arrow" mode="aspectFit"></image>
|
||||
|
|
@ -184,32 +184,6 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商户类型选择器 -->
|
||||
<view class="popup" :class="{ show: showMerchantTypePickerFlag }">
|
||||
<view class="popup-mask" @click="hideMerchantTypePicker"></view>
|
||||
<view class="popup-content">
|
||||
<view class="popup-header">
|
||||
<text class="popup-title">选择商户类型</text>
|
||||
<text class="popup-close" @click="hideMerchantTypePicker">×</text>
|
||||
</view>
|
||||
<view class="popup-body">
|
||||
<view class="radio-list">
|
||||
<view class="radio-item" v-for="(item, index) in merchantTypeList" :key="index"
|
||||
@click="selectMerchantType(item)">
|
||||
<view class="radio" :class="{ checked: formData.merchant_type === item.value }">
|
||||
<image v-if="formData.merchant_type === item.value" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cb185ec8-9d30-4e53-b5dc-14b546013a60" class="radio-icon-image" mode="aspectFit"></image>
|
||||
</view>
|
||||
<text class="radio-label">{{item.label}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup-footer">
|
||||
<view class="popup-btn confirm" @click="confirmMerchantType">
|
||||
<text class="btn-text">确定</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 日期选择器 -->
|
||||
<view class="popup" :class="{ show: showDatePickerFlag }">
|
||||
|
|
@ -289,30 +263,25 @@ export default {
|
|||
userId: null,
|
||||
// 使用本地存储初始化数据
|
||||
formData: loadedData || {
|
||||
merchant_type: '',
|
||||
business_license: '',
|
||||
license_number: '',
|
||||
company_name: '',
|
||||
uscc_type: '',
|
||||
uscc_photo: '',
|
||||
uscc_num: '',
|
||||
uscc_name: '',
|
||||
license_valid_type: '',
|
||||
license_start_date: '',
|
||||
license_end_date: '',
|
||||
legal_person: '',
|
||||
legal_name: '',
|
||||
legal_phone: '',
|
||||
legal_idcard: '',
|
||||
idcard_valid_type: '',
|
||||
legal_idcard_num: '',
|
||||
legal_idcard_expiry_type: '',
|
||||
idcard_start_date: '',
|
||||
idcard_end_date: '',
|
||||
idcard_front: '',
|
||||
idcard_back: ''
|
||||
legal_idcard_positive: '',
|
||||
legal_idcard_negative: ''
|
||||
},
|
||||
showMerchantTypePickerFlag: false,
|
||||
showDatePickerFlag: false,
|
||||
showTipPopupFlag: false, // 提示弹窗显示状态
|
||||
currentDateField: '',
|
||||
merchantTypeList: [
|
||||
{ label: '个体工商户营业执照', value: 'individual' },
|
||||
{ label: '企业法人营业执照', value: 'corporate' },
|
||||
],
|
||||
years,
|
||||
months,
|
||||
days,
|
||||
|
|
@ -324,58 +293,46 @@ export default {
|
|||
|
||||
// 识别状态
|
||||
isRecognizing: false,
|
||||
recognizeType: '', // 'idcard_front', 'idcard_back', 'business_license'
|
||||
identity: null
|
||||
recognizeType: '', // 'legal_idcard_positive', 'legal_idcard_negative', 'uscc_photo'
|
||||
identity: 2
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
merchantTypeText() {
|
||||
const type = this.merchantTypeList.find(item => item.value === this.formData.merchant_type);
|
||||
return type ? type.label : '';
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// 添加 watch 监听表单数据变化
|
||||
watch: {
|
||||
'formData.license_number'(newVal) {
|
||||
'formData.uscc_num'(newVal) {
|
||||
this.saveFormDataToLocalDebounce();
|
||||
},
|
||||
'formData.company_name'(newVal) {
|
||||
'formData.uscc_name'(newVal) {
|
||||
this.saveFormDataToLocalDebounce();
|
||||
},
|
||||
'formData.legal_person'(newVal) {
|
||||
'formData.legal_name'(newVal) {
|
||||
this.saveFormDataToLocalDebounce();
|
||||
},
|
||||
'formData.legal_phone'(newVal) {
|
||||
this.saveFormDataToLocalDebounce();
|
||||
},
|
||||
'formData.legal_idcard'(newVal) {
|
||||
'formData.legal_idcard_num'(newVal) {
|
||||
this.saveFormDataToLocalDebounce();
|
||||
},
|
||||
'formData.business_license'(newVal) {
|
||||
'formData.uscc_photo'(newVal) {
|
||||
this.saveFormDataToLocalDebounce();
|
||||
},
|
||||
'formData.idcard_front'(newVal) {
|
||||
'formData.legal_idcard_positive'(newVal) {
|
||||
this.saveFormDataToLocalDebounce();
|
||||
},
|
||||
'formData.idcard_back'(newVal) {
|
||||
'formData.legal_idcard_negative'(newVal) {
|
||||
this.saveFormDataToLocalDebounce();
|
||||
}
|
||||
},
|
||||
|
||||
// 页面生命周期
|
||||
onLoad(options) {
|
||||
this.loadFormData();
|
||||
this.preloadImages();
|
||||
console.log(1111112222)
|
||||
|
||||
console.log('页面加载,检查全局状态:', {
|
||||
artisanType: getApp().globalData.artisanType,
|
||||
userInfo: getApp().globalData.userInfo
|
||||
});
|
||||
|
||||
// 获取身份类型
|
||||
this.identity = getApp().globalData.artisanType;
|
||||
console.log('身份类型:', this.identity);
|
||||
// 获取用户信息,用于图片上传
|
||||
this.getUserInfo();
|
||||
|
||||
|
|
@ -461,7 +418,7 @@ export default {
|
|||
// 获取用户信息
|
||||
getUserInfo() {
|
||||
return new Promise((resolve, reject) => {
|
||||
request.post('/user/getuser', { type: 1 }).then(result => {
|
||||
request.post('/sj/user/getuser').then(result => {
|
||||
if (result.state === 1) {
|
||||
this.userId = result.data.id;
|
||||
console.log('用户ID获取成功:', this.userId);
|
||||
|
|
@ -522,15 +479,15 @@ export default {
|
|||
showTipPopup(field) {
|
||||
// 根据字段设置对应的标题和图片
|
||||
const tipConfig = {
|
||||
'license_number': {
|
||||
'uscc_num': {
|
||||
title: '如何找到证件号码',
|
||||
image: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/72856aac-f0ac-49a1-a7f1-be3220ecb314'
|
||||
},
|
||||
'company_name': {
|
||||
'uscc_name': {
|
||||
title: '如何找到企业名称',
|
||||
image: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/4fb3e0a2-4c1a-4433-a181-b7a1dfefd030'
|
||||
},
|
||||
'legal_person': {
|
||||
'legal_name': {
|
||||
title: '如何找到法人代表',
|
||||
image: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/24859872-da37-4beb-8e33-7743813bb5a1'
|
||||
}
|
||||
|
|
@ -567,20 +524,6 @@ export default {
|
|||
this.showTipPopupFlag = false;
|
||||
},
|
||||
|
||||
// 预加载所有弹窗图片
|
||||
preloadImages() {
|
||||
const images = [
|
||||
'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/ab410a5d-5819-47f2-a0fc-3fd6b90d6770', // 弹窗背景
|
||||
'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/72856aac-f0ac-49a1-a7f1-be3220ecb314', // 证件号码
|
||||
'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/4fb3e0a2-4c1a-4433-a181-b7a1dfefd030', // 企业名称
|
||||
'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/24859872-da37-4beb-8e33-7743813bb5a1' // 法人代表
|
||||
];
|
||||
|
||||
images.forEach(src => {
|
||||
const img = new Image();
|
||||
img.src = src;
|
||||
});
|
||||
},
|
||||
|
||||
// 设置营业执照有效期类型
|
||||
setLicenseValidType(type) {
|
||||
|
|
@ -600,7 +543,7 @@ export default {
|
|||
|
||||
// 设置身份证有效期类型
|
||||
setIdcardValidType(type) {
|
||||
this.formData.idcard_valid_type = type;
|
||||
this.formData.legal_idcard_expiry_type = type;
|
||||
if (type === 'permanent') {
|
||||
// 选择长久有效时,设置结束日期为"长久有效"
|
||||
this.formData.idcard_end_date = '长久有效';
|
||||
|
|
@ -624,19 +567,10 @@ export default {
|
|||
this.saveFormDataToLocal();
|
||||
},
|
||||
|
||||
// 显示商户类型选择器
|
||||
showMerchantTypePicker() {
|
||||
this.showMerchantTypePickerFlag = true;
|
||||
},
|
||||
|
||||
// 隐藏商户类型选择器
|
||||
hideMerchantTypePicker() {
|
||||
this.showMerchantTypePickerFlag = false;
|
||||
},
|
||||
|
||||
// 选择商户类型
|
||||
selectMerchantType(item) {
|
||||
this.formData.merchant_type = item.value;
|
||||
this.formData.uscc_type = item.value;
|
||||
// 保存到本地存储
|
||||
this.saveFormDataToLocal();
|
||||
},
|
||||
|
|
@ -728,11 +662,11 @@ export default {
|
|||
// 如果是身份证开始日期,自动计算结束日期
|
||||
if (this.currentDateField === 'idcard_start_date') {
|
||||
// 如果是"长久有效"类型,不自动设置结束日期
|
||||
if (this.formData.idcard_valid_type === 'date') {
|
||||
if (this.formData.legal_idcard_expiry_type === 'date') {
|
||||
const endYear = year + 20;
|
||||
const endDateStr = `${endYear}年${month}月${day}日`;
|
||||
this.formData.idcard_end_date = endDateStr;
|
||||
} else if (this.formData.idcard_valid_type === 'permanent') {
|
||||
} else if (this.formData.legal_idcard_expiry_type === 'permanent') {
|
||||
// 如果是"长久有效"类型,保持结束日期为"长久有效"
|
||||
this.formData.idcard_end_date = '长久有效';
|
||||
}
|
||||
|
|
@ -870,11 +804,11 @@ export default {
|
|||
this.formData[type] = result;
|
||||
|
||||
// 上传成功后自动识别
|
||||
if (type === 'business_license') {
|
||||
if (type === 'uscc_photo') {
|
||||
await this.recognizeBusinessLicense(result);
|
||||
} else if (type === 'idcard_front') {
|
||||
} else if (type === 'legal_idcard_positive') {
|
||||
await this.recognizeIdCardFront(result);
|
||||
} else if (type === 'idcard_back') {
|
||||
} else if (type === 'legal_idcard_negative') {
|
||||
await this.recognizeIdCardBack(result);
|
||||
}
|
||||
|
||||
|
|
@ -953,7 +887,7 @@ export default {
|
|||
async recognizeBusinessLicense(imageUrl) {
|
||||
try {
|
||||
this.isRecognizing = true;
|
||||
this.recognizeType = 'business_license';
|
||||
this.recognizeType = 'uscc_photo';
|
||||
// uni.showLoading({
|
||||
// title: '正在识别营业执照...',
|
||||
// mask: true
|
||||
|
|
@ -979,26 +913,26 @@ export default {
|
|||
|
||||
// 企业名称:如果识别结果为"无",就设置为空字符串
|
||||
if (result.uscc_name && result.uscc_name.trim() && result.uscc_name !== '无') {
|
||||
this.formData.company_name = result.uscc_name;
|
||||
this.formData.uscc_name = result.uscc_name;
|
||||
recognizedFields++;
|
||||
} else {
|
||||
// 如果是"无"或空值,设置为空字符串
|
||||
this.formData.company_name = '';
|
||||
this.formData.uscc_name = '';
|
||||
}
|
||||
|
||||
if (result.uscc_num && result.uscc_num.trim()) {
|
||||
this.formData.license_number = result.uscc_num;
|
||||
this.formData.uscc_num = result.uscc_num;
|
||||
recognizedFields++;
|
||||
}
|
||||
|
||||
// 如果需要营业执照法人与法人代表关联则取消注释
|
||||
// if (result.legal_name && result.legal_name.trim()) {
|
||||
// this.formData.legal_person = result.legal_name;
|
||||
// this.formData.legal_name = result.legal_name;
|
||||
// recognizedFields++;
|
||||
// }
|
||||
|
||||
if (result.uscc_type && result.uscc_type.trim()) {
|
||||
this.formData.merchant_type = result.uscc_type;
|
||||
this.formData.uscc_type = result.uscc_type;
|
||||
recognizedFields++;
|
||||
}
|
||||
|
||||
|
|
@ -1045,7 +979,7 @@ export default {
|
|||
async recognizeIdCardFront(imageUrl) {
|
||||
try {
|
||||
this.isRecognizing = true;
|
||||
this.recognizeType = 'idcard_front';
|
||||
this.recognizeType = 'legal_idcard_positive';
|
||||
|
||||
uni.showLoading({
|
||||
title: '正在识别身份证正面...',
|
||||
|
|
@ -1071,11 +1005,11 @@ export default {
|
|||
|
||||
// 填充身份证正面信息
|
||||
if (result.name) {
|
||||
this.formData.legal_person = result.name;
|
||||
this.formData.legal_name = result.name;
|
||||
}
|
||||
|
||||
if (result.id_number) {
|
||||
this.formData.legal_idcard = result.id_number;
|
||||
this.formData.legal_idcard_num = result.id_number;
|
||||
}
|
||||
|
||||
uni.showToast({
|
||||
|
|
@ -1107,7 +1041,7 @@ export default {
|
|||
async recognizeIdCardBack(imageUrl) {
|
||||
try {
|
||||
this.isRecognizing = true;
|
||||
this.recognizeType = 'idcard_back';
|
||||
this.recognizeType = 'legal_idcard_negative';
|
||||
|
||||
uni.showLoading({
|
||||
title: '正在识别身份证反面...',
|
||||
|
|
@ -1140,10 +1074,10 @@ export default {
|
|||
}
|
||||
|
||||
if (validPeriod.isPermanent) {
|
||||
this.formData.idcard_valid_type = 'permanent';
|
||||
this.formData.legal_idcard_expiry_type = 'permanent';
|
||||
this.formData.idcard_end_date = '长久有效';
|
||||
} else if (validPeriod.endDate) {
|
||||
this.formData.idcard_valid_type = 'date';
|
||||
this.formData.legal_idcard_expiry_type = 'date';
|
||||
this.formData.idcard_end_date = validPeriod.endDate;
|
||||
}
|
||||
|
||||
|
|
@ -1182,17 +1116,17 @@ export default {
|
|||
validateForm() {
|
||||
// 按照表单从上到下的顺序定义验证规则
|
||||
const validationRules = [
|
||||
{ field: 'business_license', message: '请上传营业执照照片' },
|
||||
{ field: 'merchant_type', message: '请输入商户类型' },
|
||||
{ field: 'license_number', message: '请输入营业执照号码' },
|
||||
{ field: 'company_name', message: '请输入企业名称' },
|
||||
{ field: 'idcard_front', message: '请上传身份证正面照片' },
|
||||
{ field: 'idcard_back', message: '请上传身份证反面照片' },
|
||||
{ field: 'legal_person', message: '请输入法人代表' },
|
||||
{ field: 'uscc_photo', message: '请上传营业执照照片' },
|
||||
{ field: 'uscc_type', message: '请输入商户类型' },
|
||||
{ field: 'uscc_num', message: '请输入营业执照号码' },
|
||||
{ field: 'uscc_name', message: '请输入企业名称' },
|
||||
{ field: 'legal_idcard_positive', message: '请上传身份证正面照片' },
|
||||
{ field: 'legal_idcard_negative', message: '请上传身份证反面照片' },
|
||||
{ field: 'legal_name', message: '请输入法人代表' },
|
||||
{ field: 'legal_phone', message: '请输入法人联系方式' },
|
||||
{ field: 'legal_idcard', message: '请输入法人身份证号' },
|
||||
{ field: 'legal_idcard_num', message: '请输入法人身份证号' },
|
||||
{
|
||||
condition: () => !this.formData.idcard_valid_type,
|
||||
condition: () => !this.formData.legal_idcard_expiry_type,
|
||||
message: '请选择身份证有效期类型'
|
||||
},
|
||||
{
|
||||
|
|
@ -1201,7 +1135,7 @@ export default {
|
|||
},
|
||||
{
|
||||
condition: () => {
|
||||
if (this.formData.idcard_valid_type === 'data' && !this.formData.idcard_end_date) {
|
||||
if (this.formData.legal_idcard_expiry_type === 'data' && !this.formData.idcard_end_date) {
|
||||
return true;
|
||||
}
|
||||
// 如果选择长久有效,则不需要结束日期
|
||||
|
|
@ -1246,7 +1180,7 @@ export default {
|
|||
}
|
||||
|
||||
// 验证身份证格式
|
||||
if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(this.formData.legal_idcard)) {
|
||||
if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(this.formData.legal_idcard_num)) {
|
||||
uni.showToast({
|
||||
title: '请输入正确的身份证号码',
|
||||
icon: 'none'
|
||||
|
|
@ -1283,8 +1217,8 @@ export default {
|
|||
saveFormData() {
|
||||
console.log('开始验证表单数据');
|
||||
console.log('表单数据:', this.formData);
|
||||
console.log('法人姓名:', this.formData.legal_person);
|
||||
console.log('法人身份证号:', this.formData.legal_idcard);
|
||||
console.log('法人姓名:', this.formData.legal_name);
|
||||
console.log('法人身份证号:', this.formData.legal_idcard_num);
|
||||
|
||||
if (this.validateForm()) {
|
||||
console.log('表单验证通过,开始验证法人信息');
|
||||
|
|
@ -1309,8 +1243,8 @@ export default {
|
|||
try {
|
||||
console.log('开始调用身份验证接口');
|
||||
console.log('请求参数:', {
|
||||
name: this.formData.legal_person,
|
||||
idcard: this.formData.legal_idcard
|
||||
name: this.formData.legal_name,
|
||||
idcard: this.formData.legal_idcard_num
|
||||
});
|
||||
|
||||
uni.showLoading({
|
||||
|
|
@ -1319,8 +1253,8 @@ export default {
|
|||
|
||||
// 调用身份验证接口
|
||||
const checkRes = await request.post('/user/check', {
|
||||
name: this.formData.legal_person,
|
||||
idcard: this.formData.legal_idcard
|
||||
name: this.formData.legal_name,
|
||||
idcard: this.formData.legal_idcard_num
|
||||
});
|
||||
|
||||
uni.hideLoading();
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -16,14 +16,12 @@
|
|||
<!-- 步骤1: 根据身份显示不同内容 -->
|
||||
<view v-else-if="currentStep === 1">
|
||||
<!-- 手艺人显示个人信息,商家显示资质信息 -->
|
||||
<qualification-info ref="qualificationInfo" v-if="identity === 2"></qualification-info>
|
||||
<SyrInfo ref="personalInfo" v-else-if="identity === 1"></SyrInfo>
|
||||
<qualification-info ref="qualificationInfo"></qualification-info>
|
||||
</view>
|
||||
<!-- 步骤2: 根据身份显示不同内容 -->
|
||||
<view v-else-if="currentStep === 2">
|
||||
<!-- 手艺人显示资质信息,商家显示门店信息 -->
|
||||
<store-info ref="storeInfo" v-if="identity === 2"></store-info>
|
||||
<qualification-syr ref="qualificationSyr" v-else-if="identity === 1"></qualification-syr>
|
||||
<store-info ref="storeInfo"></store-info>
|
||||
</view>
|
||||
</view>
|
||||
<view class="kong"></view>
|
||||
|
|
@ -40,7 +38,7 @@
|
|||
<text class="agree-tip">我已阅读并同意以上协议</text>
|
||||
</view>
|
||||
<view class="next-btn" @click="goNext">
|
||||
<text class="next-text">{{ identity === 1 ? '下一步,填写个人信息' : '下一步,填写资质信息' }}</text>
|
||||
<text class="next-text">下一步,填写资质信息</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -51,7 +49,7 @@
|
|||
<text class="prev-text">上一步</text>
|
||||
</view>
|
||||
<view class="next-btn" @click="goNext">
|
||||
<text class="next-text">{{ identity === 1 ? '下一步,填写资质信息' : '下一步,填写门店信息' }}</text>
|
||||
<text class="next-text">下一步,填写门店信息</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -75,17 +73,13 @@
|
|||
import request from '../../utils/request';
|
||||
import StepTab from '@/components/step-tab/step-tab.vue';
|
||||
import QualificationInfo from './qualification_sj.vue';
|
||||
import QualificationSyr from './qualification_syr.vue';
|
||||
import StoreInfo from './sj-info.vue';
|
||||
import SyrInfo from './syr-info.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
StepTab,
|
||||
QualificationInfo,
|
||||
QualificationSyr,
|
||||
StoreInfo,
|
||||
SyrInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -106,34 +100,14 @@
|
|||
}
|
||||
},
|
||||
async onLoad(options) {
|
||||
this.identity = getApp().globalData.artisanType;
|
||||
this.identity = 2;
|
||||
await this.getUserInfoSync()
|
||||
// 确保子组件也能访问到 identity
|
||||
if (this.$refs.qualificationInfo) {
|
||||
this.$refs.qualificationInfo.identity = this.identity;
|
||||
}
|
||||
if (this.$refs.storeInfo) {
|
||||
this.$refs.storeInfo.identity = this.identity;
|
||||
}
|
||||
|
||||
// 根据身份设置导航栏标题
|
||||
if (this.identity === 1) {
|
||||
this.navTitle = '手艺人入驻';
|
||||
} else if (this.identity === 2) {
|
||||
this.navTitle = '商家入驻';
|
||||
}
|
||||
|
||||
if (this.identity) {
|
||||
const protocolType = this.identity === 1 ? 2 : 1;
|
||||
this.getXieyi(protocolType);
|
||||
}
|
||||
this.getXieyi(1);
|
||||
},
|
||||
|
||||
onShow() {
|
||||
console.log('入驻页面 onShow - 检查地址数据');
|
||||
// 检查手艺人地址数据
|
||||
this.checkAndPassAddressToSyr();
|
||||
|
||||
// 检查商家地址数据
|
||||
this.checkAndPassAddressToSj();
|
||||
},
|
||||
|
|
@ -141,24 +115,24 @@
|
|||
methods: {
|
||||
// 获取用户信息(复用不可服务时间页面的方法)
|
||||
async getUserInfoSync() {
|
||||
await request.post('/User/getUser', {
|
||||
type: getApp().globalData.artisanType==2?3:2
|
||||
await request.post('/sj/userSjAuth/details', {
|
||||
type: 1
|
||||
}).then(result => {
|
||||
if (result.state == 1 && result.data) {
|
||||
if (result.code == 200 && result.data) {
|
||||
let data = result.data
|
||||
if(getApp().globalData.artisanType==2){
|
||||
|
||||
if (getApp().globalData.artisanType == 2) {
|
||||
|
||||
//储存已有的商家入驻信息
|
||||
let qualification_form_data = {
|
||||
"license_number": data.uscc_num,
|
||||
"company_name": data.uscc_name,
|
||||
"legal_person": data.legal_name,
|
||||
"uscc_num": data.uscc_num,
|
||||
"uscc_name": data.uscc_name,
|
||||
"legal_name": data.legal_name,
|
||||
"legal_phone": data.legal_phone,
|
||||
"legal_idcard": data.legal_idcard_num,
|
||||
"business_license": data.uscc_photo,
|
||||
"idcard_front": data.legal_idcard_positive,
|
||||
"idcard_back": data.legal_idcard_negative,
|
||||
"merchant_type": data.uscc_type,
|
||||
"legal_idcard_num": data.legal_idcard_num,
|
||||
"uscc_photo": data.uscc_photo,
|
||||
"legal_idcard_positive": data.legal_idcard_positive,
|
||||
"legal_idcard_negative": data.legal_idcard_negative,
|
||||
"uscc_type": data.uscc_type,
|
||||
"license_valid_type": data.uscc_expiry_type,
|
||||
}
|
||||
if (data.uscc_expiry) {
|
||||
|
|
@ -170,13 +144,13 @@
|
|||
let expirys = data.legal_idcard_expiry.split(' —— ')
|
||||
qualification_form_data.idcard_start_date = expirys[0]
|
||||
if (expirys[1]) {
|
||||
qualification_form_data.idcard_valid_type = "date"
|
||||
qualification_form_data.legal_idcard_expiry_type = "date"
|
||||
qualification_form_data.idcard_end_date = expirys[1]
|
||||
} else {
|
||||
qualification_form_data.idcard_valid_type = "permanent"
|
||||
qualification_form_data.legal_idcard_expiry_type = "permanent"
|
||||
qualification_form_data.idcard_end_date = ""
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
uni.setStorageSync('qualification_form_data', qualification_form_data);
|
||||
let store_invite_state = {
|
||||
|
|
@ -184,97 +158,25 @@
|
|||
}
|
||||
uni.setStorageSync('store_invite_state', store_invite_state);
|
||||
let store_info_form_data = {
|
||||
"store_logo": data.head_photo,
|
||||
"store_name": data.name,
|
||||
"business_hours": data.business_time,
|
||||
"service_skills": data.servers_kill,
|
||||
"store_location": data.dependency,
|
||||
"store_address": data.address,
|
||||
"get_message_method": data.apply_state,
|
||||
"invite_code": data.invite_code_other,
|
||||
"professional_experience": data.major,
|
||||
"head_photo": data.head_photo,
|
||||
"name": data.name,
|
||||
"business_time": data.business_time,
|
||||
"servers_kill": data.servers_kill,
|
||||
"dependency": data.dependency,
|
||||
"address": data.address,
|
||||
"apply_state": data.apply_state,
|
||||
"invite_code_other": data.invite_code_other,
|
||||
"major": data.major,
|
||||
"dependency_code": data.dependency_code,
|
||||
"dependency_province": data.dependency_province,
|
||||
"dependency_city": data.dependency_city,
|
||||
"longitude": data.longitude,
|
||||
"latitude": data.latitude
|
||||
}
|
||||
console.log(111111111, store_info_form_data)
|
||||
uni.setStorageSync('store_info_form_data', store_info_form_data);
|
||||
}else{
|
||||
let artisan_qualification_form_data = {
|
||||
"health_card": data.health_card,
|
||||
"health_card_expiry_type": data.health_expiry_type,
|
||||
"qualifications": data.qualifications,
|
||||
"uscc_type": data.uscc_type,
|
||||
"uscc_photo": data.uscc_photo,
|
||||
"shop_photo": data.shop_photo,
|
||||
"uscc_num": data.uscc_num,
|
||||
"uscc_name": data.uscc_name,
|
||||
"for_shop": data.for_shop,
|
||||
"uscc_expiry_type": data.uscc_expiry_type,
|
||||
}
|
||||
if (data.uscc_expiry) {
|
||||
let expirys = data.uscc_expiry.split(' —— ')
|
||||
artisan_qualification_form_data.license_start_date = expirys[0]
|
||||
artisan_qualification_form_data.license_end_date = expirys[1]
|
||||
}
|
||||
if (data.health_expiry) {
|
||||
let expirys = data.health_expiry.split(' —— ')
|
||||
artisan_qualification_form_data.health_card_start_date = expirys[0]
|
||||
if (expirys[1]) {
|
||||
artisan_qualification_form_data.health_card_end_date = "长久有效"
|
||||
artisan_qualification_form_data.health_card_end_date = expirys[1]
|
||||
} else {
|
||||
artisan_qualification_form_data.health_card_end_date = ""
|
||||
}
|
||||
|
||||
}
|
||||
uni.setStorageSync('artisan_qualification_form_data',
|
||||
artisan_qualification_form_data);
|
||||
let personal_invite_state = {
|
||||
"currentValidatingCode": data.invite_code_other
|
||||
}
|
||||
uni.setStorageSync('personal_invite_state', personal_invite_state);
|
||||
let personal_info_form_data = {
|
||||
"head_photo": data.head_photo,
|
||||
"real_name": data.name,
|
||||
"phone": data.account,
|
||||
"backup_phone": data.second_phone,
|
||||
"id_card": data.idcard_num,
|
||||
"id_card_front": data.idcard_positive,
|
||||
"id_card_back": data.idcard_negative,
|
||||
"id_card_handheld": "",
|
||||
"detail_address": data.address,
|
||||
"introduction": data.detail,
|
||||
"region": data.dependency,
|
||||
"dependency_code": data.dependency_code,
|
||||
"dependency_province": data.dependency_province,
|
||||
"dependency_city": data.dependency_city,
|
||||
"longitude": data.longitude,
|
||||
"latitude": data.latitude,
|
||||
"service_skills": data.servers_kill,
|
||||
"service_area": data.servers_region,
|
||||
"service_time": data.default_times,
|
||||
"get_message_method": data.get_msg_method,
|
||||
"invite_code": data.invite_code_other,
|
||||
"professional_experience": data.major,
|
||||
"work_status": data.work_state,
|
||||
}
|
||||
if (data.idcard_expiry) {
|
||||
let expirys = this.parseIdCardExpiry(data.idcard_expiry)
|
||||
personal_info_form_data.id_card_start_date = expirys.id_card_start_date
|
||||
if (expirys.id_card_end_date) {
|
||||
personal_info_form_data.id_card_valid_type = "date"
|
||||
personal_info_form_data.id_card_end_date = expirys.id_card_end_date
|
||||
} else {
|
||||
personal_info_form_data.id_card_valid_type = "permanent"
|
||||
personal_info_form_data.id_card_end_date = ""
|
||||
}
|
||||
|
||||
}
|
||||
uni.setStorageSync('personal_info_form_data', personal_info_form_data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('获取用户信息接口错误:', error);
|
||||
|
|
@ -289,50 +191,50 @@
|
|||
// 初始化默认值
|
||||
let id_card_start_date = '';
|
||||
let id_card_end_date = '';
|
||||
|
||||
|
||||
try {
|
||||
// 1. 分割字符串:兼容多种分隔符(——、--、—、-),并去除前后空格
|
||||
const dateParts = expiryStr.split(/\s*[-—]{1,2}\s*/).map(str => str.trim());
|
||||
// 提取开始和结束日期部分(处理分割后长度不足的情况)
|
||||
const startStr = dateParts[0] || '';
|
||||
const endStr = dateParts[1] || '';
|
||||
|
||||
|
||||
// 2. 日期解析函数(核心:兼容低版本iOS)
|
||||
const formatDateToChinese = (dateStr) => {
|
||||
// 若为空,直接返回空
|
||||
if (!dateStr) return '';
|
||||
// 若为“长期”,直接返回“长期”
|
||||
if (dateStr === '长期') return '长期';
|
||||
|
||||
|
||||
// 关键:低版本iOS不支持“yyyy-mm-dd”,替换为“yyyy/mm/dd”
|
||||
const compatibleStr = dateStr.replace(/-/g, '/');
|
||||
const date = new Date(compatibleStr);
|
||||
|
||||
|
||||
// 检查日期是否有效
|
||||
if (isNaN(date.getTime())) {
|
||||
return ''; // 解析失败则返回空
|
||||
}
|
||||
|
||||
|
||||
// 获取年、月、日(去掉前导零)
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1;
|
||||
const day = date.getDate();
|
||||
|
||||
|
||||
return `${year}年${month}月${day}日`;
|
||||
};
|
||||
|
||||
|
||||
// 3. 解析开始日期(必须有值,否则置空)
|
||||
if (startStr) {
|
||||
id_card_start_date = formatDateToChinese(startStr);
|
||||
}
|
||||
|
||||
|
||||
// 4. 解析结束日期(支持空、长期、正常日期)
|
||||
id_card_end_date = formatDateToChinese(endStr);
|
||||
|
||||
|
||||
} catch (err) {
|
||||
console.error('解析身份证有效期失败:', err);
|
||||
}
|
||||
|
||||
|
||||
// 5. 返回结果
|
||||
return {
|
||||
id_card_start_date,
|
||||
|
|
@ -356,7 +258,7 @@
|
|||
this.$refs.storeInfo.handleAddressSelected(sjAddress);
|
||||
} else if (this.$refs.storeInfo.formData) {
|
||||
// 直接设置数据
|
||||
this.$refs.storeInfo.formData.store_address = sjAddress.address || sjAddress
|
||||
this.$refs.storeInfo.formData.address = sjAddress.address || sjAddress
|
||||
.name;
|
||||
this.$refs.storeInfo.formData.longitude = sjAddress.longitude;
|
||||
this.$refs.storeInfo.formData.latitude = sjAddress.latitude;
|
||||
|
|
@ -367,7 +269,7 @@
|
|||
if (sjAddress.pname) locationParts.push(sjAddress.pname);
|
||||
if (sjAddress.cityname) locationParts.push(sjAddress.cityname);
|
||||
if (sjAddress.adname) locationParts.push(sjAddress.adname);
|
||||
this.$refs.storeInfo.formData.store_location = locationParts.join('-');
|
||||
this.$refs.storeInfo.formData.dependency = locationParts.join('-');
|
||||
}
|
||||
|
||||
this.$refs.storeInfo.saveFormDataToLocal();
|
||||
|
|
@ -383,58 +285,6 @@
|
|||
console.error('处理商家地址失败:', e);
|
||||
}
|
||||
},
|
||||
// 检查并传递地址给手艺人组件
|
||||
checkAndPassAddressToSyr() {
|
||||
try {
|
||||
const syrAddress = uni.getStorageSync('syr_selected_address');
|
||||
if (syrAddress && syrAddress.source === 'syr_info') {
|
||||
console.log('找到手艺人地址数据,准备传递');
|
||||
|
||||
// 延迟执行,确保组件已渲染
|
||||
setTimeout(() => {
|
||||
if (this.$refs.personalInfo) {
|
||||
console.log('传递给手艺人组件');
|
||||
|
||||
// 准备地址数据格式
|
||||
const addressData = {
|
||||
name: syrAddress.name,
|
||||
address: syrAddress.address,
|
||||
location: syrAddress.location,
|
||||
longitude: syrAddress.longitude,
|
||||
latitude: syrAddress.latitude
|
||||
};
|
||||
|
||||
// 传递给组件
|
||||
if (typeof this.$refs.personalInfo.handleAddressSelected === 'function') {
|
||||
this.$refs.personalInfo.handleAddressSelected(addressData);
|
||||
} else if (this.$refs.personalInfo.formData) {
|
||||
// 直接设置数据
|
||||
this.$refs.personalInfo.formData.detail_address = addressData.address;
|
||||
this.$refs.personalInfo.formData.longitude = addressData.longitude;
|
||||
this.$refs.personalInfo.formData.latitude = addressData.latitude;
|
||||
this.$refs.personalInfo.saveFormDataToLocal();
|
||||
this.$refs.personalInfo.$forceUpdate();
|
||||
}
|
||||
|
||||
// 清理存储
|
||||
uni.removeStorageSync('syr_selected_address');
|
||||
}
|
||||
}, 300);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('处理手艺人地址失败:', e);
|
||||
}
|
||||
},
|
||||
|
||||
onStepChange() {
|
||||
// 当步骤切换时,重新检查地址数据
|
||||
if (this.currentStep === 1 && this.identity === 1) {
|
||||
// 手艺人个人信息步骤
|
||||
setTimeout(() => {
|
||||
this.checkAndPassAddressData();
|
||||
}, 300);
|
||||
}
|
||||
},
|
||||
|
||||
// 新增方法:检查并传递地址数据
|
||||
checkAndPassAddressData() {
|
||||
|
|
@ -468,8 +318,7 @@
|
|||
console.log('检查用户信息...');
|
||||
|
||||
// 从多种可能的存储位置检查用户信息
|
||||
const sources = [
|
||||
{
|
||||
const sources = [{
|
||||
name: '本地存储-userInfo',
|
||||
data: uni.getStorageSync('userInfo')
|
||||
},
|
||||
|
|
@ -501,7 +350,7 @@
|
|||
// 获取用户信息(复用不可服务时间页面的方法)
|
||||
getUserInfo() {
|
||||
return new Promise((resolve, reject) => {
|
||||
request.post('/user/getuser', {
|
||||
request.post('/sj/User/getUser', {
|
||||
type: 1
|
||||
}).then(result => {
|
||||
if (result.state == 1) {
|
||||
|
|
@ -569,25 +418,6 @@
|
|||
console.log('个人信息数据:', this.personalInfoData);
|
||||
|
||||
|
||||
// 重新获取最新数据,确保数据是最新的
|
||||
if (this.identity === 1) {
|
||||
// 手艺人:重新验证并获取两个步骤的数据
|
||||
this.personalInfoData = this.artisanDataCache.personalInfo;
|
||||
this.qualificationData = this.artisanDataCache.qualificationInfo;
|
||||
|
||||
console.log('手艺人个人信息数据:', this.personalInfoData);
|
||||
console.log('手艺人资质信息数据:', this.qualificationData);
|
||||
|
||||
if (!this.personalInfoData || !this.qualificationData) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '请完成所有步骤的填写',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
let apiUrl = '';
|
||||
let formData = {};
|
||||
|
||||
|
|
@ -595,7 +425,7 @@
|
|||
|
||||
if (this.identity === 2) {
|
||||
// 商家入驻
|
||||
apiUrl = '/user/usersjadd';
|
||||
apiUrl = '/sj/userSjAuth/apply';
|
||||
|
||||
// 确保重新获取最新数据
|
||||
if (this.$refs.storeInfo) {
|
||||
|
|
@ -608,8 +438,8 @@
|
|||
}
|
||||
|
||||
// 验证服务技能是否存在
|
||||
if (!this.storeInfoData || !this.storeInfoData.service_skills || this.storeInfoData
|
||||
.service_skills.length === 0) {
|
||||
if (!this.storeInfoData || !this.storeInfoData.servers_kill || this.storeInfoData
|
||||
.servers_kill.length === 0) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '请选择服务技能',
|
||||
|
|
@ -619,32 +449,20 @@
|
|||
}
|
||||
|
||||
formData = this.buildBusinessData(this.qualificationData, this.storeInfoData);
|
||||
} else if (this.identity === 1) {
|
||||
// 手艺人入驻
|
||||
apiUrl = '/user/usersyradd';
|
||||
formData = this.buildArtisanData(this.personalInfoData, this.qualificationData);
|
||||
|
||||
// 添加账号信息
|
||||
if (userInfo && userInfo.account) {
|
||||
formData.account = userInfo.account;
|
||||
}
|
||||
}
|
||||
|
||||
console.log('提交的数据:', formData);
|
||||
console.log('API URL:', apiUrl);
|
||||
|
||||
formData.type = 1
|
||||
formData.id_type = 1
|
||||
|
||||
const res = await request.post(apiUrl, formData);
|
||||
|
||||
uni.hideLoading();
|
||||
|
||||
if (res.state == 1) {
|
||||
if (res.state == 1 || res.code == 200) {
|
||||
// 提交成功后清除缓存数据
|
||||
if (this.identity === 1) {
|
||||
getApp().globalData.personalInfoData = null;
|
||||
getApp().globalData.qualificationData = null;
|
||||
this.artisanDataCache.personalInfo = null;
|
||||
this.artisanDataCache.qualificationInfo = null;
|
||||
}
|
||||
|
||||
uni.showToast({
|
||||
title: '提交成功',
|
||||
|
|
@ -698,11 +516,10 @@
|
|||
const formData = {};
|
||||
|
||||
// 服务技能处理 - 添加更严格的验证
|
||||
if (storeData && storeData.service_skills && storeData.service_skills.length > 0) {
|
||||
// 确保 service_skills 是数组
|
||||
formData.servers_kill = Array.isArray(storeData.service_skills) ?
|
||||
storeData.service_skills :
|
||||
[storeData.service_skills];
|
||||
if (storeData && storeData.servers_kill && storeData.servers_kill.length > 0) {
|
||||
// 确保 servers_kill 是数组
|
||||
formData.servers_kill = Array.isArray(storeData.servers_kill) ?
|
||||
storeData.servers_kill : [storeData.servers_kill];
|
||||
|
||||
console.log('服务技能数组:', formData.servers_kill);
|
||||
} else {
|
||||
|
|
@ -711,17 +528,17 @@
|
|||
}
|
||||
|
||||
// 营业执照信息
|
||||
if (qualificationData.merchant_type) {
|
||||
formData.uscc_type = qualificationData.merchant_type === 'individual' ? 1 : 2;
|
||||
if (qualificationData.uscc_type) {
|
||||
formData.uscc_type = qualificationData.uscc_type === 'individual' ? 1 : 2;
|
||||
}
|
||||
if (qualificationData.business_license) {
|
||||
formData.uscc_photo = qualificationData.business_license;
|
||||
if (qualificationData.uscc_photo) {
|
||||
formData.uscc_photo = qualificationData.uscc_photo;
|
||||
}
|
||||
if (qualificationData.license_number) {
|
||||
formData.uscc_num = qualificationData.license_number;
|
||||
if (qualificationData.uscc_num) {
|
||||
formData.uscc_num = qualificationData.uscc_num;
|
||||
}
|
||||
if (qualificationData.company_name) {
|
||||
formData.uscc_name = qualificationData.company_name;
|
||||
if (qualificationData.uscc_name) {
|
||||
formData.uscc_name = qualificationData.uscc_name;
|
||||
}
|
||||
if (qualificationData.license_valid_type) {
|
||||
formData.uscc_expiry_type = qualificationData.license_valid_type === 'permanent' ? 1 : 2;
|
||||
|
|
@ -742,24 +559,24 @@
|
|||
}
|
||||
|
||||
// 法人信息
|
||||
if (qualificationData.legal_person) {
|
||||
formData.legal_name = qualificationData.legal_person;
|
||||
if (qualificationData.legal_name) {
|
||||
formData.legal_name = qualificationData.legal_name;
|
||||
}
|
||||
if (qualificationData.legal_phone) {
|
||||
formData.legal_phone = qualificationData.legal_phone;
|
||||
}
|
||||
if (qualificationData.legal_idcard) {
|
||||
formData.legal_idcard_num = qualificationData.legal_idcard;
|
||||
if (qualificationData.legal_idcard_num) {
|
||||
formData.legal_idcard_num = qualificationData.legal_idcard_num;
|
||||
}
|
||||
if (qualificationData.idcard_valid_type) {
|
||||
formData.legal_idcard_expiry_type = qualificationData.idcard_valid_type === 'permanent' ? 1 : 2;
|
||||
if (qualificationData.legal_idcard_expiry_type) {
|
||||
formData.legal_idcard_expiry_type = qualificationData.legal_idcard_expiry_type === 'permanent' ? 1 : 2;
|
||||
}
|
||||
|
||||
// 格式化有效期
|
||||
if (qualificationData.idcard_start_date) {
|
||||
const idcardStartDate = this.formatDateForBackend(qualificationData.idcard_start_date);
|
||||
|
||||
if (qualificationData.idcard_valid_type === 'permanent') {
|
||||
if (qualificationData.legal_idcard_expiry_type === 'permanent') {
|
||||
formData.legal_idcard_expiry = `${idcardStartDate} —— `;
|
||||
} else if (qualificationData.idcard_end_date) {
|
||||
const idcardEndDate = this.formatDateForBackend(qualificationData.idcard_end_date);
|
||||
|
|
@ -767,26 +584,26 @@
|
|||
}
|
||||
}
|
||||
|
||||
if (qualificationData.idcard_front) {
|
||||
formData.legal_idcard_positive = qualificationData.idcard_front;
|
||||
if (qualificationData.legal_idcard_positive) {
|
||||
formData.legal_idcard_positive = qualificationData.legal_idcard_positive;
|
||||
}
|
||||
if (qualificationData.idcard_back) {
|
||||
formData.legal_idcard_negative = qualificationData.idcard_back;
|
||||
if (qualificationData.legal_idcard_negative) {
|
||||
formData.legal_idcard_negative = qualificationData.legal_idcard_negative;
|
||||
}
|
||||
|
||||
// 门店信息
|
||||
if (storeData.store_logo) {
|
||||
formData.head_photo = storeData.store_logo;
|
||||
if (storeData.head_photo) {
|
||||
formData.head_photo = storeData.head_photo;
|
||||
}
|
||||
if (storeData.store_name) {
|
||||
formData.name = storeData.store_name;
|
||||
if (storeData.name) {
|
||||
formData.name = storeData.name;
|
||||
}
|
||||
if (storeData.business_hours) {
|
||||
formData.business_time = storeData.business_hours;
|
||||
if (storeData.business_time) {
|
||||
formData.business_time = storeData.business_time;
|
||||
}
|
||||
if (storeData.service_skills && storeData.service_skills.length > 0) {
|
||||
if (storeData.servers_kill && storeData.servers_kill.length > 0) {
|
||||
// 直接传递数组
|
||||
formData.servers_kill = storeData.service_skills;
|
||||
formData.servers_kill = storeData.servers_kill;
|
||||
console.log('服务技能数组:', formData.servers_kill);
|
||||
} else {
|
||||
formData.servers_kill = [];
|
||||
|
|
@ -796,8 +613,8 @@
|
|||
console.log('最终 formData 中的 servers_kill:', formData.servers_kill);
|
||||
console.log('=== 调试结束 ===');
|
||||
|
||||
if (storeData.store_location) {
|
||||
formData.dependency = storeData.store_location;
|
||||
if (storeData.dependency) {
|
||||
formData.dependency = storeData.dependency;
|
||||
|
||||
// 地址编码
|
||||
if (storeData.dependency_code) {
|
||||
|
|
@ -810,22 +627,22 @@
|
|||
formData.dependency_city = storeData.dependency_city;
|
||||
}
|
||||
}
|
||||
if (storeData.store_address) {
|
||||
formData.address = storeData.store_address;
|
||||
if (storeData.address) {
|
||||
formData.address = storeData.address;
|
||||
}
|
||||
// 经纬度
|
||||
if (storeData.longitude) formData.longitude = storeData.longitude;
|
||||
if (storeData.latitude) formData.latitude = storeData.latitude;
|
||||
|
||||
// 其他信息
|
||||
if (storeData.get_message_method) {
|
||||
formData.get_msg_method = storeData.get_message_method;
|
||||
if (storeData.apply_state) {
|
||||
formData.get_msg_method = storeData.apply_state;
|
||||
}
|
||||
if (storeData.invite_code) {
|
||||
formData.invite_code_other = storeData.invite_code;
|
||||
if (storeData.invite_code_other) {
|
||||
formData.invite_code_other = storeData.invite_code_other;
|
||||
}
|
||||
if (storeData.professional_experience) {
|
||||
formData.major = storeData.professional_experience;
|
||||
if (storeData.major) {
|
||||
formData.major = storeData.major;
|
||||
}
|
||||
|
||||
// 账号信息 - 直接从登录时输入的手机号获取
|
||||
|
|
@ -859,62 +676,6 @@
|
|||
|
||||
},
|
||||
|
||||
// 构建手艺人数据
|
||||
buildArtisanData(personalData, qualificationData) {
|
||||
console.log('手艺人数据调试');
|
||||
console.log('personalData:', personalData);
|
||||
console.log('qualificationData:', qualificationData);
|
||||
|
||||
const formData = {
|
||||
...personalData,
|
||||
...qualificationData
|
||||
};
|
||||
|
||||
// 修复字段名映射
|
||||
const fieldMappings = {
|
||||
'service_area': 'servers_region', // 服务区域
|
||||
'service_time': 'default_times', // 服务时间
|
||||
'work_status': 'work_state', // 工作状态
|
||||
'invite_code': 'invite_code_other', // 邀请码
|
||||
// 健康证相关字段映射
|
||||
'health_card_expiry_type': 'health_expiry_type',
|
||||
'health_card_start_date': 'health_expiry_start',
|
||||
'health_card_end_date': 'health_expiry_end'
|
||||
};
|
||||
Object.keys(fieldMappings).forEach(oldKey => {
|
||||
if (formData[oldKey] !== undefined) {
|
||||
formData[fieldMappings[oldKey]] = formData[oldKey];
|
||||
// 可以保留原字段,也可以删除
|
||||
delete formData[oldKey];
|
||||
}
|
||||
});
|
||||
|
||||
// 服务区域直接传递数组格式(后端会处理序列化)
|
||||
if (formData.servers_region && typeof formData.servers_region === 'string') {
|
||||
// 将字符串转换为数组格式
|
||||
formData.servers_region = [formData.servers_region];
|
||||
} else if (!formData.servers_region) {
|
||||
// 如果没有服务区域数据,设置为空数组
|
||||
formData.servers_region = [];
|
||||
}
|
||||
|
||||
// 确保必要的字段都有值
|
||||
const requiredFields = [
|
||||
'head_photo', 'name', 'account', 'idcard_num', 'idcard_positive',
|
||||
'idcard_negative', 'idcard_hands', 'dependency', 'address',
|
||||
'servers_kill', 'get_msg_method', 'invite_code_other', 'major', 'work_status'
|
||||
];
|
||||
|
||||
requiredFields.forEach(field => {
|
||||
if (!formData[field]) {
|
||||
console.warn(`警告:字段 ${field} 为空`);
|
||||
}
|
||||
});
|
||||
|
||||
console.log('手艺人最终提交数据:', formData);
|
||||
return formData;
|
||||
},
|
||||
|
||||
async goNext() {
|
||||
console.log('当前步骤:', this.currentStep);
|
||||
console.log('身份类型:', this.identity);
|
||||
|
|
@ -930,61 +691,30 @@
|
|||
|
||||
// 步骤1需要验证信息
|
||||
if (this.currentStep === 1) {
|
||||
if (this.identity === 1) {
|
||||
console.log('手艺人验证个人信息');
|
||||
// 手艺人验证个人信息
|
||||
if (this.$refs.personalInfo) {
|
||||
// 等待异步验证完成
|
||||
const isValid = await this.$refs.personalInfo.saveFormData();
|
||||
if (!isValid) {
|
||||
console.log('手艺人个人信息验证失败');
|
||||
return;
|
||||
}
|
||||
// 保存到缓存
|
||||
this.artisanDataCache.personalInfo = this.$refs.personalInfo.getFormData();
|
||||
this.personalInfoData = this.artisanDataCache.personalInfo;
|
||||
console.log('手艺人个人信息验证通过');
|
||||
}
|
||||
} else if (this.identity === 2) {
|
||||
console.log('商家验证资质信息');
|
||||
// 商家验证资质信息
|
||||
if (this.$refs.qualificationInfo) {
|
||||
const isValid = await this.$refs.qualificationInfo.saveFormData();
|
||||
if (!isValid) {
|
||||
console.log('商家资质信息验证失败');
|
||||
return;
|
||||
}
|
||||
this.qualificationData = this.$refs.qualificationInfo.getFormData();
|
||||
console.log(' 商家资质信息验证通过 ');
|
||||
console.log('商家验证资质信息');
|
||||
// 商家验证资质信息
|
||||
if (this.$refs.qualificationInfo) {
|
||||
const isValid = await this.$refs.qualificationInfo.saveFormData();
|
||||
if (!isValid) {
|
||||
console.log('商家资质信息验证失败');
|
||||
return;
|
||||
}
|
||||
this.qualificationData = this.$refs.qualificationInfo.getFormData();
|
||||
console.log(' 商家资质信息验证通过 ');
|
||||
}
|
||||
}
|
||||
|
||||
// 步骤2需要验证信息
|
||||
if (this.currentStep === 2) {
|
||||
if (this.identity === 1) {
|
||||
// 手艺人验证资质信息
|
||||
if (this.$refs.qualificationSyr) {
|
||||
const isValid = await this.$refs.qualificationSyr.saveFormData();
|
||||
if (!isValid) {
|
||||
console.log('手艺人资质信息验证失败');
|
||||
return;
|
||||
}
|
||||
this.artisanDataCache.qualificationInfo = this.$refs.qualificationSyr.getFormData();
|
||||
this.qualificationData = this.artisanDataCache.qualificationInfo;
|
||||
console.log('手艺人资质信息验证通过');
|
||||
}
|
||||
} else if (this.identity === 2) {
|
||||
// 商家验证门店信息
|
||||
if (this.$refs.storeInfo) {
|
||||
const isValid = await this.$refs.storeInfo.saveFormData();
|
||||
if (!isValid) {
|
||||
console.log('商家门店信息验证失败');
|
||||
return;
|
||||
}
|
||||
this.storeInfoData = this.$refs.storeInfo.getFormData();
|
||||
console.log('商家门店信息验证通过');
|
||||
// 商家验证门店信息
|
||||
if (this.$refs.storeInfo) {
|
||||
const isValid = await this.$refs.storeInfo.saveFormData();
|
||||
if (!isValid) {
|
||||
console.log('商家门店信息验证失败');
|
||||
return;
|
||||
}
|
||||
this.storeInfoData = this.$refs.storeInfo.getFormData();
|
||||
console.log('商家门店信息验证通过');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1010,16 +740,6 @@
|
|||
}
|
||||
this.storeInfoData = this.$refs.storeInfo.getFormData();
|
||||
console.log('商家门店信息数据:', this.storeInfoData);
|
||||
} else if (this.identity === 1) {
|
||||
// 手艺人验证资质信息
|
||||
if (this.$refs.qualificationSyr) {
|
||||
if (!this.$refs.qualificationSyr.saveFormData()) {
|
||||
return;
|
||||
}
|
||||
this.artisanDataCache.qualificationInfo = this.$refs.qualificationSyr.getFormData();
|
||||
this.qualificationData = this.$refs.qualificationSyr.getFormData();
|
||||
console.log('手艺人资质信息数据:', this.qualificationData);
|
||||
}
|
||||
}
|
||||
|
||||
// 执行提交逻辑
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@
|
|||
<view class="form-item box-cont">
|
||||
<view class="label-wrapper">
|
||||
<text class="label required">店铺logo</text>
|
||||
<image class="label-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108" mode="aspectFit" @click="showTipPopup('store_logo')"></image>
|
||||
<image class="label-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108" mode="aspectFit" @click="showTipPopup('head_photo')"></image>
|
||||
</view>
|
||||
<view class="upload-box" @click="chooseImage('store_logo')">
|
||||
<image v-if="formData.store_logo" :src="formData.store_logo" mode="aspectFill" class="logo-image"></image>
|
||||
<view class="upload-box" @click="chooseImage('head_photo')">
|
||||
<image v-if="formData.head_photo" :src="formData.head_photo" mode="aspectFill" class="logo-image"></image>
|
||||
<view class="upload-placeholder" v-else>
|
||||
<image src="/static/images/upload-img.png" mode="aspectFit" class="upload-icon"></image>
|
||||
</view>
|
||||
|
|
@ -24,9 +24,9 @@
|
|||
<view class="form-item-one box-cont">
|
||||
<view class="label-wrapper">
|
||||
<text class="label required">店铺名称</text>
|
||||
<image class="label-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108" mode="aspectFit" @click="showTipPopup('store_name')"></image>
|
||||
<image class="label-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108" mode="aspectFit" @click="showTipPopup('name')"></image>
|
||||
</view>
|
||||
<input type="text" v-model="formData.store_name" placeholder="请输入营业执照的店铺名称"
|
||||
<input type="text" v-model="formData.name" placeholder="请输入营业执照的店铺名称"
|
||||
placeholder-class="placeholder" class="input"
|
||||
@input="saveFormDataToLocalDebounce" />
|
||||
</view>
|
||||
|
|
@ -35,8 +35,8 @@
|
|||
<view class="form-item-two box-cont" @click="openTimePicker">
|
||||
<text class="label required">营业时间</text>
|
||||
<view class="picker-content">
|
||||
<text :class="formData.business_hours ? 'picker-value' : 'placeholder'">
|
||||
{{formData.business_hours || '请输入营业时间'}}
|
||||
<text :class="formData.business_time ? 'picker-value' : 'placeholder'">
|
||||
{{formData.business_time || '请输入营业时间'}}
|
||||
</text>
|
||||
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/dccc4513-377c-4bfa-9fd2-a5cfdb9798f3" class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
<view class="form-item-two box-cont" @click="showServicePopup">
|
||||
<text class="label required">服务技能(多选)</text>
|
||||
<view class="picker-content">
|
||||
<text :class="formData.service_skills.length > 0 ? 'picker-value' : 'placeholder'">
|
||||
<text :class="formData.servers_kill.length > 0 ? 'picker-value' : 'placeholder'" v-if="formData.servers_kill">
|
||||
{{selectedServicesText || '请选择'}}
|
||||
</text>
|
||||
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/dccc4513-377c-4bfa-9fd2-a5cfdb9798f3" class="arrow-right" mode="aspectFit"></image>
|
||||
|
|
@ -57,8 +57,8 @@
|
|||
<view class="form-item-two box-cont" @click="showLocationPopup">
|
||||
<text class="label required">门店所在地:</text>
|
||||
<view class="picker-content">
|
||||
<text :class="formData.store_location ? 'picker-value' : 'placeholder'">
|
||||
{{formData.store_location || '请选择'}}
|
||||
<text :class="formData.dependency ? 'picker-value' : 'placeholder'">
|
||||
{{formData.dependency || '请选择'}}
|
||||
</text>
|
||||
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/dccc4513-377c-4bfa-9fd2-a5cfdb9798f3" class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
|
@ -68,8 +68,8 @@
|
|||
<view class="form-item-two box-cont" @click="getAddressInfo">
|
||||
<text class="label required">门店详细地址:</text>
|
||||
<view class="picker-content">
|
||||
<text :class="formData.store_address ? 'picker-value' : 'placeholder'">
|
||||
{{formData.store_address || '请选择'}}
|
||||
<text :class="formData.address ? 'picker-value' : 'placeholder'">
|
||||
{{formData.address || '请选择'}}
|
||||
</text>
|
||||
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/dccc4513-377c-4bfa-9fd2-a5cfdb9798f3" class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
|
@ -82,15 +82,15 @@
|
|||
</view>
|
||||
|
||||
<!-- 获取消息方式 -->
|
||||
<view class="form-item-two box-cont" @click="openMessageMethodPicker">
|
||||
<!-- <view class="form-item-two box-cont" @click="openMessageMethodPicker">
|
||||
<text class="label required">获取消息方式:</text>
|
||||
<view class="picker-content">
|
||||
<text :class="formData.get_message_method ? 'picker-value' : 'placeholder'">
|
||||
<text :class="formData.apply_state ? 'picker-value' : 'placeholder'">
|
||||
{{messageMethodText || '请选择'}}
|
||||
</text>
|
||||
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/dccc4513-377c-4bfa-9fd2-a5cfdb9798f3" class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 邀请码 -->
|
||||
<view class="form-item-one-yqr box-cont invite-code-container">
|
||||
|
|
@ -98,7 +98,7 @@
|
|||
<view class="label-wrapper">
|
||||
<text class="label required">邀请码</text>
|
||||
</view>
|
||||
<input type="text" v-model="formData.invite_code" placeholder="请输入邀请码"
|
||||
<input type="text" v-model="formData.invite_code_other" placeholder="请输入邀请码"
|
||||
placeholder-class="placeholder" class="input"
|
||||
@input="handleInviteCodeInput" />
|
||||
</view>
|
||||
|
|
@ -109,7 +109,7 @@
|
|||
<!-- 邀请人信息 -->
|
||||
<view class="invite-info-container">
|
||||
<!-- 默认提示 -->
|
||||
<text v-if="!formData.invite_code" class="invite-tip">
|
||||
<text v-if="!formData.invite_code_other" class="invite-tip">
|
||||
请填写邀请人的邀请码,若没有邀请人请填写13131313
|
||||
</text>
|
||||
|
||||
|
|
@ -124,7 +124,7 @@
|
|||
</view>
|
||||
|
||||
<!-- 特殊邀请码13131313 -->
|
||||
<view v-else-if="formData.invite_code === '13131313' && !inviterInfo" class="invite-tip">
|
||||
<view v-else-if="formData.invite_code_other === '13131313' && !inviterInfo" class="invite-tip">
|
||||
请填写邀请人的邀请码,若没有邀请人请填写13131313
|
||||
</view>
|
||||
|
||||
|
|
@ -147,7 +147,7 @@
|
|||
<view class="form-item-two box-cont" @click="openExperiencePicker">
|
||||
<text class="label required">专业经验:</text>
|
||||
<view class="picker-content">
|
||||
<text :class="formData.professional_experience ? 'picker-value' : 'placeholder'">
|
||||
<text :class="formData.major ? 'picker-value' : 'placeholder'">
|
||||
{{experienceText || '请选择'}}
|
||||
</text>
|
||||
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/dccc4513-377c-4bfa-9fd2-a5cfdb9798f3" class="arrow-right" mode="aspectFit"></image>
|
||||
|
|
@ -315,15 +315,15 @@ export default {
|
|||
|
||||
return {
|
||||
formData: loadedData || {
|
||||
store_logo: '',
|
||||
store_name: '',
|
||||
business_hours: '',
|
||||
service_skills: [],
|
||||
store_location: '',
|
||||
store_address: '',
|
||||
get_message_method: '',
|
||||
invite_code: '',
|
||||
professional_experience: '',
|
||||
head_photo: '',
|
||||
name: '',
|
||||
business_time: '',
|
||||
servers_kill: [],
|
||||
dependency: '',
|
||||
address: '',
|
||||
apply_state: '',
|
||||
invite_code_other: '',
|
||||
major: '',
|
||||
dependency_code: '', // 区code
|
||||
dependency_province: '', // 省code
|
||||
dependency_city: '', // 市code
|
||||
|
|
@ -351,7 +351,7 @@ export default {
|
|||
tipImage: '',
|
||||
currentTipType: '',
|
||||
userId: null,
|
||||
identity: null,
|
||||
identity: 2,
|
||||
tipImagesPreloaded: false,
|
||||
tipPopupBg: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/ab410a5d-5819-47f2-a0fc-3fd6b90d6770',
|
||||
|
||||
|
|
@ -387,16 +387,16 @@ export default {
|
|||
},
|
||||
|
||||
watch: {
|
||||
'formData.store_name'(newVal) {
|
||||
'name'(newVal) {
|
||||
this.saveFormDataToLocalDebounce();
|
||||
},
|
||||
'formData.store_logo'(newVal) {
|
||||
'formData.head_photo'(newVal) {
|
||||
this.saveFormDataToLocalDebounce();
|
||||
},
|
||||
'formData.invite_code'(newVal) {
|
||||
'formData.invite_code_other'(newVal) {
|
||||
this.saveFormDataToLocalDebounce();
|
||||
},
|
||||
'formData.store_address'(newVal) {
|
||||
'formData.address'(newVal) {
|
||||
this.saveFormDataToLocalDebounce();
|
||||
}
|
||||
},
|
||||
|
|
@ -412,7 +412,6 @@ export default {
|
|||
},
|
||||
|
||||
mounted() {
|
||||
this.identity = getApp().globalData.artisanType;
|
||||
this.getUserInfo();
|
||||
this.preloadTipImages();
|
||||
|
||||
|
|
@ -422,20 +421,20 @@ export default {
|
|||
this.updateSelectedServicesText();
|
||||
|
||||
// 初始化消息方式和专业经验显示文本
|
||||
if (this.formData.get_message_method) {
|
||||
if (this.formData.apply_state) {
|
||||
const methods = ['朋友圈', '抖音', '地推', '朋友介绍', '微博'];
|
||||
this.messageMethodText = methods[this.formData.get_message_method - 1] || '';
|
||||
this.messageMethodText = methods[this.formData.apply_state - 1] || '';
|
||||
}
|
||||
|
||||
if (this.formData.professional_experience) {
|
||||
if (this.formData.major) {
|
||||
const experiences = ['实习', '1-3年', '3-5年', '5-10年', '10年以上'];
|
||||
this.experienceText = experiences[this.formData.professional_experience - 1] || '';
|
||||
this.experienceText = experiences[this.formData.major - 1] || '';
|
||||
}
|
||||
|
||||
this.setupAddressListener();
|
||||
|
||||
if (this.formData.invite_code) {
|
||||
this.validateInviteCode(this.formData.invite_code);
|
||||
if (this.formData.invite_code_other) {
|
||||
this.validateInviteCode(this.formData.invite_code_other);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -461,15 +460,15 @@ export default {
|
|||
}
|
||||
|
||||
// 恢复获取消息方式的显示文本
|
||||
if (this.formData.get_message_method) {
|
||||
if (this.formData.apply_state) {
|
||||
const methods = ['朋友圈', '抖音', '地推', '朋友介绍', '微博'];
|
||||
this.messageMethodText = methods[this.formData.get_message_method - 1] || '';
|
||||
this.messageMethodText = methods[this.formData.apply_state - 1] || '';
|
||||
}
|
||||
|
||||
// 恢复专业经验的显示文本
|
||||
if (this.formData.professional_experience) {
|
||||
if (this.formData.major) {
|
||||
const experiences = ['实习', '1-3年', '3-5年', '5-10年', '10年以上'];
|
||||
this.experienceText = experiences[this.formData.professional_experience - 1] || '';
|
||||
this.experienceText = experiences[this.formData.major - 1] || '';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -480,8 +479,8 @@ export default {
|
|||
this.checkGlobalData();
|
||||
|
||||
// 邀请码验证
|
||||
if (this.formData.invite_code) {
|
||||
this.validateInviteCode(this.formData.invite_code);
|
||||
if (this.formData.invite_code_other) {
|
||||
this.validateInviteCode(this.formData.invite_code_other);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -508,7 +507,7 @@ export default {
|
|||
this.currentValidatingCode = inviteState.currentValidatingCode || '';
|
||||
|
||||
// 特殊处理:如果当前邀请码是13131313,确保状态正确
|
||||
if (this.formData.invite_code === '13131313') {
|
||||
if (this.formData.invite_code_other === '13131313') {
|
||||
console.log('检测到特殊邀请码13131313,重置验证状态');
|
||||
this.inviteCodeError = false;
|
||||
this.inviterInfo = null;
|
||||
|
|
@ -516,13 +515,13 @@ export default {
|
|||
}
|
||||
|
||||
// 如果正在验证的邀请码与当前表单中的一致,保持验证状态
|
||||
if (this.currentValidatingCode === this.formData.invite_code) {
|
||||
if (this.currentValidatingCode === this.formData.invite_code_other) {
|
||||
// 状态已恢复,无需额外操作
|
||||
} else {
|
||||
// 如果不一致,重新验证
|
||||
if (this.formData.invite_code && this.formData.invite_code.trim() !== '') {
|
||||
console.log('邀请码不一致,重新验证:', this.formData.invite_code);
|
||||
this.handleInviteCodeInput({ detail: { value: this.formData.invite_code } });
|
||||
if (this.formData.invite_code_other && this.formData.invite_code_other.trim() !== '') {
|
||||
console.log('邀请码不一致,重新验证:', this.formData.invite_code_other);
|
||||
this.handleInviteCodeInput({ detail: { value: this.formData.invite_code_other } });
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -550,7 +549,7 @@ export default {
|
|||
const inviteState = {
|
||||
inviterInfo: this.inviterInfo,
|
||||
inviteCodeError: this.inviteCodeError,
|
||||
currentValidatingCode: this.currentValidatingCode || this.formData.invite_code || ''
|
||||
currentValidatingCode: this.currentValidatingCode || this.formData.invite_code_other || ''
|
||||
};
|
||||
uni.setStorageSync('store_invite_state', inviteState);
|
||||
|
||||
|
|
@ -607,7 +606,7 @@ export default {
|
|||
|
||||
// 处理邀请码输入
|
||||
handleInviteCodeInput(e) {
|
||||
const code = e.detail ? e.detail.value : this.formData.invite_code;
|
||||
const code = e.detail ? e.detail.value : this.formData.invite_code_other;
|
||||
|
||||
console.log('邀请码输入:', code);
|
||||
|
||||
|
|
@ -618,14 +617,14 @@ export default {
|
|||
|
||||
// 如果邀请码为空,不进行验证
|
||||
if (!code || code.trim() === '') {
|
||||
this.formData.invite_code = '';
|
||||
this.formData.invite_code_other = '';
|
||||
this.saveFormDataToLocalDebounce();
|
||||
// 保存空状态
|
||||
this.saveInviteStateToLocal();
|
||||
return;
|
||||
}
|
||||
|
||||
this.formData.invite_code = code;
|
||||
this.formData.invite_code_other = code;
|
||||
this.saveFormDataToLocalDebounce();
|
||||
|
||||
// 【关键修复】如果是13131313,立即通过验证并取消任何正在进行的验证
|
||||
|
|
@ -672,13 +671,13 @@ export default {
|
|||
// 设置新的定时器
|
||||
this.inviteValidationTimer = setTimeout(() => {
|
||||
// 检查邀请码是否变化
|
||||
if (this.formData.invite_code !== this.currentValidatingCode) {
|
||||
if (this.formData.invite_code_other !== this.currentValidatingCode) {
|
||||
console.log('邀请码已变化,取消验证');
|
||||
return;
|
||||
}
|
||||
|
||||
// 再次检查是否是13131313(双重检查)
|
||||
if (this.formData.invite_code === '13131313') {
|
||||
if (this.formData.invite_code_other === '13131313') {
|
||||
console.log('双重检查:检测到特殊邀请码13131313');
|
||||
this.inviteCodeValidating = false;
|
||||
this.inviteCodeError = false;
|
||||
|
|
@ -694,8 +693,8 @@ export default {
|
|||
return;
|
||||
}
|
||||
|
||||
console.log('开始验证邀请码:', this.formData.invite_code);
|
||||
this.validateInviteCode(this.formData.invite_code);
|
||||
console.log('开始验证邀请码:', this.formData.invite_code_other);
|
||||
this.validateInviteCode(this.formData.invite_code_other);
|
||||
|
||||
// 清理定时器
|
||||
this.inviteValidationTimer = null;
|
||||
|
|
@ -861,10 +860,10 @@ export default {
|
|||
|
||||
// 立即更新已选择服务技能的显示文本(不依赖 serviceList)
|
||||
updateSelectedServicesText() {
|
||||
if (this.formData.service_skills && this.formData.service_skills.length > 0) {
|
||||
if (this.formData.servers_kill && this.formData.servers_kill.length > 0) {
|
||||
if (this.serviceList.length > 0) {
|
||||
const selectedServices = this.serviceList
|
||||
.filter(item => this.formData.service_skills.includes(item.id))
|
||||
.filter(item => this.formData.servers_kill.includes(item.id))
|
||||
.map(item => {
|
||||
item.checked = true;
|
||||
return item.title;
|
||||
|
|
@ -872,7 +871,7 @@ export default {
|
|||
this.selectedServicesText = selectedServices.join('、');
|
||||
} else {
|
||||
// serviceList 还未加载,显示数量
|
||||
this.selectedServicesText = `已选择${this.formData.service_skills.length}项`;
|
||||
this.selectedServicesText = `已选择${this.formData.servers_kill.length}项`;
|
||||
}
|
||||
} else {
|
||||
this.selectedServicesText = '';
|
||||
|
|
@ -927,7 +926,7 @@ export default {
|
|||
|
||||
if (!address) return;
|
||||
|
||||
this.formData.store_address = address;
|
||||
this.formData.address = address;
|
||||
|
||||
if (addressData.location) {
|
||||
const [longitude, latitude] = addressData.location.split(',');
|
||||
|
|
@ -940,7 +939,7 @@ export default {
|
|||
if (addressData.pname) locationParts.push(addressData.pname);
|
||||
if (addressData.cityname) locationParts.push(addressData.cityname);
|
||||
if (addressData.adname) locationParts.push(addressData.adname);
|
||||
this.formData.store_location = locationParts.join('-');
|
||||
this.formData.dependency = locationParts.join('-');
|
||||
}
|
||||
|
||||
this.saveFormDataToLocal();
|
||||
|
|
@ -965,9 +964,9 @@ export default {
|
|||
|
||||
// 更新已选择服务技能的显示文本
|
||||
updateSelectedServicesText() {
|
||||
if (this.formData.service_skills && this.formData.service_skills.length > 0 && this.serviceList.length > 0) {
|
||||
if (this.formData.servers_kill && this.formData.servers_kill.length > 0 && this.serviceList.length > 0) {
|
||||
const selectedServices = this.serviceList
|
||||
.filter(item => this.formData.service_skills.includes(item.id))
|
||||
.filter(item => this.formData.servers_kill.includes(item.id))
|
||||
.map(item => {
|
||||
item.checked = true;
|
||||
return item.title;
|
||||
|
|
@ -978,7 +977,7 @@ export default {
|
|||
|
||||
// 获取用户信息
|
||||
getUserInfo() {
|
||||
request.post('/user/getuser', { type: 1 }).then(result => {
|
||||
request.post('/sj/User/getUser').then(result => {
|
||||
this.userId = result.data.id;
|
||||
})
|
||||
},
|
||||
|
|
@ -1031,11 +1030,11 @@ export default {
|
|||
// 显示提示弹窗
|
||||
showTipPopup(field) {
|
||||
const tipConfig = {
|
||||
'store_logo': {
|
||||
'head_photo': {
|
||||
title: '如何查看店铺logo',
|
||||
image: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/98ad5649-db6d-4453-a308-c592fe155ed9'
|
||||
},
|
||||
'store_name': {
|
||||
'name': {
|
||||
title: '如何查看店铺名称',
|
||||
image: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/4a2dc8c2-98d4-4465-ae31-b2ea2d13aa23'
|
||||
}
|
||||
|
|
@ -1069,7 +1068,7 @@ export default {
|
|||
// 加载服务技能列表
|
||||
async loadServiceSkills() {
|
||||
try {
|
||||
const res = await request.post('/user/firstclass');
|
||||
const res = await request.post('/sj/firstclass');
|
||||
this.serviceList = res.data.map(item => ({
|
||||
...item,
|
||||
checked: false
|
||||
|
|
@ -1085,9 +1084,9 @@ export default {
|
|||
|
||||
// 恢复服务技能选择状态
|
||||
restoreServiceSkillsSelection() {
|
||||
if (this.formData.service_skills && this.formData.service_skills.length > 0) {
|
||||
if (this.formData.servers_kill && this.formData.servers_kill.length > 0) {
|
||||
this.serviceList.forEach(item => {
|
||||
item.checked = this.formData.service_skills.includes(item.id);
|
||||
item.checked = this.formData.servers_kill.includes(item.id);
|
||||
});
|
||||
this.updateSelectedServicesText();
|
||||
}
|
||||
|
|
@ -1202,7 +1201,7 @@ export default {
|
|||
|
||||
// 确认时间选择
|
||||
confirmTime() {
|
||||
this.formData.business_hours = `${this.formatTime(this.startTime)}-${this.formatTime(this.endTime)}`;
|
||||
this.formData.business_time = `${this.formatTime(this.startTime)}-${this.formatTime(this.endTime)}`;
|
||||
this.saveFormDataToLocal();
|
||||
this.hideTimePopup();
|
||||
},
|
||||
|
|
@ -1236,7 +1235,7 @@ export default {
|
|||
return;
|
||||
}
|
||||
|
||||
this.formData.service_skills = selectedServicesId;
|
||||
this.formData.servers_kill = selectedServicesId;
|
||||
this.selectedServicesText = selectedServices.join('、');
|
||||
this.saveFormDataToLocal();
|
||||
this.hideServicePopup();
|
||||
|
|
@ -1270,10 +1269,10 @@ export default {
|
|||
let province = this.ChinaCitys[index1].province;
|
||||
let city = this.locatinCitys[index2].city;
|
||||
let area = this.locationAreas[index3].area;
|
||||
this.formData.store_location = province + '-' + city + '-' + area;
|
||||
this.formData.dependency = province + '-' + city + '-' + area;
|
||||
|
||||
// 清空详细地址,因为所在地已经改变
|
||||
this.formData.store_address = '';
|
||||
this.formData.address = '';
|
||||
this.formData.longitude = '';
|
||||
this.formData.latitude = '';
|
||||
|
||||
|
|
@ -1302,16 +1301,16 @@ export default {
|
|||
let params = 'source=sj_info'; // 用于地址返回
|
||||
|
||||
// 如果有门店所在地,添加dependency参数
|
||||
if (this.formData.store_location) {
|
||||
if (this.formData.dependency) {
|
||||
|
||||
const locationStr = encodeURIComponent(this.formData.store_location);
|
||||
const locationStr = encodeURIComponent(this.formData.dependency);
|
||||
params += `&dependency=${locationStr}`;
|
||||
|
||||
if (this.formData.dependency_code) {
|
||||
params += `&dependency_code=${this.formData.dependency_code}`;
|
||||
}
|
||||
|
||||
console.log('传递的地区信息:', this.formData.store_location);
|
||||
console.log('传递的地区信息:', this.formData.dependency);
|
||||
console.log('编码后的地区信息:', locationStr);
|
||||
}
|
||||
|
||||
|
|
@ -1333,7 +1332,7 @@ export default {
|
|||
itemList: ['朋友圈', '抖音', '地推', '朋友介绍', '微博'],
|
||||
success: (res) => {
|
||||
const methods = ['朋友圈', '抖音', '地推', '朋友介绍', '微博'];
|
||||
this.formData.get_message_method = res.tapIndex + 1;
|
||||
this.formData.apply_state = res.tapIndex + 1;
|
||||
this.messageMethodText = methods[res.tapIndex];
|
||||
this.saveFormDataToLocal();
|
||||
}
|
||||
|
|
@ -1346,7 +1345,7 @@ export default {
|
|||
itemList: ['实习', '1-3年', '3-5年', '5-10年', '10年以上'],
|
||||
success: (res) => {
|
||||
const experiences = ['实习', '1-3年', '3-5年', '5-10年', '10年以上'];
|
||||
this.formData.professional_experience = res.tapIndex + 1;
|
||||
this.formData.major = res.tapIndex + 1;
|
||||
this.experienceText = experiences[res.tapIndex];
|
||||
this.saveFormDataToLocal();
|
||||
}
|
||||
|
|
@ -1356,56 +1355,56 @@ export default {
|
|||
// 保存表单数据(用于提交前验证)
|
||||
saveFormData() {
|
||||
// 验证必填字段
|
||||
if (!this.formData.store_logo) {
|
||||
if (!this.formData.head_photo) {
|
||||
uni.showToast({
|
||||
title: '请上传店铺logo',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!this.formData.store_name) {
|
||||
if (!this.formData.name) {
|
||||
uni.showToast({
|
||||
title: '请输入店铺名称',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!this.formData.business_hours) {
|
||||
if (!this.formData.business_time) {
|
||||
uni.showToast({
|
||||
title: '请选择营业时间',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.formData.service_skills.length === 0) {
|
||||
if (this.formData.servers_kill.length === 0) {
|
||||
uni.showToast({
|
||||
title: '请选择服务技能',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!this.formData.store_location) {
|
||||
if (!this.formData.dependency) {
|
||||
uni.showToast({
|
||||
title: '请选择门店所在地',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!this.formData.store_address) {
|
||||
if (!this.formData.address) {
|
||||
uni.showToast({
|
||||
title: '请选择门店详细地址',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!this.formData.get_message_method) {
|
||||
uni.showToast({
|
||||
title: '请选择获取消息方式',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!this.formData.invite_code) {
|
||||
// if (!this.formData.apply_state) {
|
||||
// uni.showToast({
|
||||
// title: '请选择获取消息方式',
|
||||
// icon: 'none'
|
||||
// });
|
||||
// return false;
|
||||
// }
|
||||
if (!this.formData.invite_code_other) {
|
||||
uni.showToast({
|
||||
title: '请输入邀请码',
|
||||
icon: 'none'
|
||||
|
|
@ -1420,7 +1419,7 @@ export default {
|
|||
}
|
||||
|
||||
// 特殊邀请码13131313直接通过
|
||||
if (this.formData.invite_code === '13131313') {
|
||||
if (this.formData.invite_code_other === '13131313') {
|
||||
// 直接通过
|
||||
} else if (this.inviteCodeError || !this.inviterInfo) {
|
||||
// 邀请码无效,触发抖动效果
|
||||
|
|
@ -1428,7 +1427,7 @@ export default {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!this.formData.professional_experience) {
|
||||
if (!this.formData.major) {
|
||||
uni.showToast({
|
||||
title: '请选择专业经验',
|
||||
icon: 'none'
|
||||
|
|
@ -1948,7 +1947,7 @@ export default {
|
|||
}
|
||||
|
||||
/* 店铺logo图片的特殊样式 */
|
||||
.tip-image.store_logo {
|
||||
.tip-image.head_photo {
|
||||
width: 582rpx;
|
||||
height: 327rpx;
|
||||
margin-right: 0;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -43,16 +43,9 @@
|
|||
<!-- 服务标签 -->
|
||||
<view class="services">
|
||||
<view class="service-tag">
|
||||
<!-- 有券时:显示券后价 -->
|
||||
<view v-if="item.hasCoupon" class="coupon-wrapper">
|
||||
<text class="coupon-label">券后</text>
|
||||
<text class="price coupon-price">¥{{ item.coupon_price }}</text>
|
||||
<!-- <text class="line-price original-price">¥{{ item.server_price }}</text> -->
|
||||
</view>
|
||||
<!-- 无券时:只显示原价 -->
|
||||
<view v-else class="price">¥{{ item.server_price }}</view>
|
||||
<view class="price">¥{{ item.server_price }}</view>
|
||||
<view class="split"></view>
|
||||
<view class="server_time">{{ item.server_time }}分钟</view>
|
||||
<view class="server_time">服务时长:{{ item.server_time }}分钟</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -200,16 +193,10 @@
|
|||
},
|
||||
computed: {
|
||||
listWithShortTitle() {
|
||||
return this.list.map((item, index) => {
|
||||
// 目前先模拟,等条件出来再修改:偶数索引有券
|
||||
const hasCoupon = index % 2 === 0;
|
||||
// 模拟券后价随机生成
|
||||
const coupon_price = hasCoupon ? Math.floor(item.server_price * 0.8) : null;
|
||||
return {
|
||||
...item,
|
||||
hasCoupon,
|
||||
coupon_price
|
||||
};
|
||||
return this.list.map(item => {
|
||||
return {
|
||||
...item
|
||||
};
|
||||
});
|
||||
},
|
||||
},
|
||||
|
|
@ -393,7 +380,7 @@
|
|||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
flex-shrink: 0;
|
||||
margin-top: 10rpx;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.position {
|
||||
|
|
@ -415,18 +402,6 @@
|
|||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.coupon-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.coupon-label {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #e8101e;
|
||||
line-height: 34rpx;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-weight: 700;
|
||||
font-size: 26rpx;
|
||||
|
|
@ -434,26 +409,6 @@
|
|||
font-family: DINPro, DINPro;
|
||||
}
|
||||
|
||||
.coupon-price {
|
||||
color: #e8101e;
|
||||
}
|
||||
|
||||
.line-price{
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
text-decoration: line-through;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.coupon-badge {
|
||||
background: #e8101e;
|
||||
color: #fff;
|
||||
font-size: 20rpx;
|
||||
padding: 2rpx 8rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.server_time {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
|
|
|
|||
|
|
@ -42,20 +42,11 @@
|
|||
<text class="shop-list-item__title__tip" v-if="item.team_buy.length > 0">拼团</text>
|
||||
{{ item.title }}
|
||||
</view>
|
||||
<!-- 价格区域:根据是否有券显示不同内容 -->
|
||||
<view class="shop-list-item__price">
|
||||
<view v-if="item.hasCoupon" class="coupon-wrapper">
|
||||
<text class="coupon-label">券后</text>
|
||||
<text style="font-size: 20rpx;margin-top: 4rpx;">¥</text>
|
||||
<text class="coupon-price">{{ item.coupon_price }}</text>
|
||||
</view>
|
||||
<view v-else>
|
||||
<text style="font-size: 20rpx">¥</text>
|
||||
{{ (item.team_buy && item.team_buy.length > 0) ? item.team_buy.price : item.server_price }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="shop-list-item__price"><text style="font-size: 20rpx">¥</text>{{
|
||||
item.team_buy.length > 0 ? item.team_buy.price : item.server_price
|
||||
}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -161,27 +152,6 @@
|
|||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
/* 券后价包装器 */
|
||||
.coupon-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4rpx;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
|
||||
/* 券后标签 */
|
||||
.coupon-label {
|
||||
font-weight: 400;
|
||||
font-size: 22rpx;
|
||||
color: #e8101e;
|
||||
// line-height: 30rpx;
|
||||
}
|
||||
/* 券后价格 */
|
||||
.coupon-price {
|
||||
font-size: 26rpx;
|
||||
color: #e8101e;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1017,17 +1017,4 @@
|
|||
position: fixed !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
::v-deep .service-item-wrapper {
|
||||
padding: 0;
|
||||
}
|
||||
::v-deep .artisan-row {
|
||||
padding: 0 10rpx;
|
||||
margin: 0;
|
||||
}
|
||||
::v-deep .service-item {
|
||||
padding: 10rpx 10rpx 30rpx 10rpx;
|
||||
}
|
||||
::v-deep .order-btn {
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -14,16 +14,7 @@
|
|||
<view class="goods-name">{{ item.title }}</view>
|
||||
<!-- 价格+销量区域 -->
|
||||
<view class="goods-footer">
|
||||
<!-- 价格区域:根据 hasCoupon 显示券后价或原价 -->
|
||||
<view v-if="item.hasCoupon" class="price-wrapper coupon-wrapper">
|
||||
<text class="coupon-label">券后</text>
|
||||
<text class="goods-price coupon-price">¥{{ item.coupon_price }}</text>
|
||||
<!-- 如需显示原价划线可取消下一行注释 -->
|
||||
<!-- <text class="line-price">¥{{ item.server_price }}</text> -->
|
||||
</view>
|
||||
<view v-else class="price-wrapper">
|
||||
<text class="goods-price">¥{{ item.server_price }}</text>
|
||||
</view>
|
||||
<text class="goods-price">¥{{ item.server_price }}</text>
|
||||
<text class="goods-sales">销量 {{ item.sales_num }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -113,30 +104,6 @@ export default {
|
|||
justify-content: space-between;
|
||||
padding: 0 10rpx 20rpx 10rpx;
|
||||
|
||||
/* 券后价包装器 */
|
||||
.coupon-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4rpx;
|
||||
}
|
||||
|
||||
/* 券后标签 */
|
||||
.coupon-label {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #e8101e;
|
||||
// background: #ffe9e9;
|
||||
// padding: 2rpx 8rpx;
|
||||
// border-radius: 20rpx;
|
||||
// margin-right: 4rpx;
|
||||
line-height: 33rpx;
|
||||
}
|
||||
|
||||
/* 券后价格(如需调整字体可在此覆盖) */
|
||||
.coupon-price {
|
||||
/* 默认继承 .price-value 样式 */
|
||||
}
|
||||
|
||||
/* 价格:红色 */
|
||||
.goods-price {
|
||||
font-family: DINPro, DINPro;
|
||||
|
|
@ -146,7 +113,6 @@ export default {
|
|||
line-height: 36rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-top: -8rpx;
|
||||
}
|
||||
|
||||
/* 销量:灰色 */
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@
|
|||
});
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: `/pages/order/pay-success?orderId=${this.orderInfo.id}&order_type=6`,
|
||||
url: `/pages/order/pay-success?orderId=${this.orderInfo.id}&serviceType=2`,
|
||||
});
|
||||
}, 50);
|
||||
this.isSubmit = true;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -345,8 +345,8 @@ export default {
|
|||
width: 100%;
|
||||
|
||||
.list-item-left-price-text {
|
||||
font-weight: bold;
|
||||
font-size: 42rpx;
|
||||
font-weight: 500;
|
||||
font-size: 40rpx;
|
||||
color: #e8101e;
|
||||
line-height: 48rpx;
|
||||
text-align: left;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<view>
|
||||
<custom-navbar title="服务列表" :leftImg="'/static/images/whiteBack.png'" :showUser="true"
|
||||
<custom-navbar title="分类" :leftImg="'/static/images/whiteBack.png'" :showUser="true"
|
||||
backgroundColor="linear-gradient( 134deg, #F52540 0%, #E8101E 100%)" titleColor="#fff"></custom-navbar>
|
||||
<serviecFirstTab :tabs="tabs" :activeId="activeId" activeColor="#E8101E" @tab-click="tabClick" bgColor="#fff">
|
||||
</serviecFirstTab>
|
||||
|
|
@ -9,17 +9,20 @@
|
|||
<CommonList ref="groupRef" :apiUrl="'/user/getSearchList'" :initialQuery="queryData"
|
||||
:listScrollHeight="`calc(100vh - ${statusBarHeight * 2 + 250}rpx)`">
|
||||
<template #headerScroll>
|
||||
<!-- 二级icon分类 -->
|
||||
<view class="icon-tabs">
|
||||
<view v-for="(item, idx) in iconTabs" :key="item.id" class="icon-tab"
|
||||
:class="{active: queryData.second_class == item.id}" @click="getSecondlist(item.id)">
|
||||
<image :src="item.photo" class="icon-img" mode="aspectFill"></image>
|
||||
<text class="icon-text">{{ item.title }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 添加过滤器组件 -->
|
||||
<filterVue :key="activeId" @filter-change="handleFilterChange"></filterVue>
|
||||
</template>
|
||||
<!-- 二级icon分类 -->
|
||||
<view class="icon-tabs">
|
||||
<view v-for="(item, idx) in iconTabs" :key="item.id" class="icon-tab"
|
||||
:class="{active: queryData.second_class == item.id}" @click="getSecondlist(item.id)">
|
||||
<image :src="item.photo" class="icon-img" mode="aspectFill"></image>
|
||||
<text class="icon-text">{{ item.title }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 添加过滤器组件 -->
|
||||
<filterVue
|
||||
:key="activeId"
|
||||
@filter-change="handleFilterChange"
|
||||
></filterVue>
|
||||
</template>
|
||||
<template #listData="{ list }">
|
||||
<serviceCardList :list="list" btnText="立即预约"></serviceCardList>
|
||||
</template>
|
||||
|
|
@ -40,7 +43,7 @@
|
|||
import FilterPanel from "./components/intmentFilter.vue";
|
||||
import CommonList from "@/components/common/CommonList.vue";
|
||||
import filterVue from "./components/filter.vue";
|
||||
|
||||
|
||||
export default {
|
||||
components: {
|
||||
searchBox,
|
||||
|
|
@ -130,7 +133,7 @@
|
|||
// 处理过滤器变化
|
||||
handleFilterChange(filterData) {
|
||||
console.log("收到筛选数据:", filterData);
|
||||
|
||||
|
||||
// 更新查询参数
|
||||
if (filterData.distance !== undefined && filterData.distance !== null) {
|
||||
// 注意:接口需要的是km单位,组件里是米,需要转换
|
||||
|
|
@ -138,41 +141,41 @@
|
|||
} else {
|
||||
delete this.queryData.distance;
|
||||
}
|
||||
|
||||
|
||||
if (filterData.minPrice !== undefined && filterData.minPrice !== null) {
|
||||
this.queryData.min_price = filterData.minPrice;
|
||||
} else {
|
||||
delete this.queryData.min_price;
|
||||
}
|
||||
|
||||
|
||||
if (filterData.maxPrice !== undefined && filterData.maxPrice !== null) {
|
||||
this.queryData.max_price = filterData.maxPrice;
|
||||
} else {
|
||||
delete this.queryData.max_price;
|
||||
}
|
||||
|
||||
|
||||
if (filterData.sortType !== undefined && filterData.sortType !== null) {
|
||||
// 根据接口文档映射排序类型
|
||||
const sortMap = {
|
||||
'distance': 1, // 离我最近
|
||||
'sales': 2, // 销量最高
|
||||
'price_asc': 3, // 价格最低
|
||||
'price_desc': 4 // 价格最高
|
||||
'distance': 1, // 离我最近
|
||||
'sales': 2, // 销量最高
|
||||
'price_asc': 3, // 价格最低
|
||||
'price_desc': 4 // 价格最高
|
||||
};
|
||||
this.queryData.sort_type = sortMap[filterData.sortType];
|
||||
} else {
|
||||
delete this.queryData.sort_type;
|
||||
}
|
||||
|
||||
|
||||
if (filterData.serviceType !== undefined && filterData.serviceType !== null) {
|
||||
// 接口文档中服务方式是 server_kind,1=上门,2=到店
|
||||
this.queryData.server_kind = filterData.serviceType;
|
||||
} else {
|
||||
delete this.queryData.server_kind;
|
||||
}
|
||||
|
||||
|
||||
console.log("最终查询参数:", this.queryData);
|
||||
|
||||
|
||||
// 重新搜索
|
||||
this.search();
|
||||
},
|
||||
|
|
@ -201,19 +204,16 @@
|
|||
|
||||
|
||||
//list样式
|
||||
.common-list {
|
||||
.common-list{
|
||||
// background-color: #fafafa!important; // 这个是莫名其妙多出来一小行的盒子元凶
|
||||
border-radius: 30rpx 30rpx 0rpx 0rpx;
|
||||
|
||||
::v-deep .list-container {
|
||||
::v-deep .list-container{
|
||||
padding: 0rpx;
|
||||
}
|
||||
|
||||
::v-deep .list-scroll {
|
||||
::v-deep .list-scroll{
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-tabs {
|
||||
display: flex;
|
||||
column-gap: 48rpx;
|
||||
|
|
@ -231,7 +231,7 @@
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.icon-img {
|
||||
|
|
@ -239,7 +239,7 @@
|
|||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
border: 2rpx solid transparent;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.icon-text {
|
||||
|
|
@ -259,17 +259,16 @@
|
|||
.icon-tab.active .icon-img {
|
||||
border: 2rpx solid #E8101E;
|
||||
}
|
||||
|
||||
::v-deep .list-scroll {
|
||||
|
||||
::v-deep .list-scroll{
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.service-first-tab {
|
||||
border-bottom: none;
|
||||
.service-first-tab{
|
||||
border-bottom:none;
|
||||
}
|
||||
|
||||
.service-list {
|
||||
padding-top: 17rpx !important;
|
||||
|
||||
.service-list{
|
||||
padding-top: 17rpx!important;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 20rpx 20rpx 0rpx 0rpx;
|
||||
}
|
||||
|
|
@ -277,11 +276,7 @@
|
|||
::v-deep .service-list {
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
::v-deep .service-item-wrapper {
|
||||
padding: 5rpx !important;
|
||||
}
|
||||
|
||||
|
||||
// ::v-deep .common-list {
|
||||
// background-color: #f5f5f5;
|
||||
// }
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -37,39 +37,16 @@
|
|||
</swiper>
|
||||
</view>
|
||||
<!-- 服务信息 -->
|
||||
<!--<view class="service-info">
|
||||
<view class="service-info">
|
||||
<view class="service-price">
|
||||
<text class="price-symbol">¥</text>
|
||||
<text class="price-value">{{serviceInfo.server_price}}</text>
|
||||
<text class="line-value">¥{{serviceInfo.line_price}}</text>
|
||||
</view>
|
||||
<view class="service-title">
|
||||
<text
|
||||
class="service-type">{{serviceInfo.server_kind == 1 ? '到家' : serviceInfo.server_kind == 2 ? '到店' : ''}}</text>
|
||||
<text class="title-text">{{serviceInfo.title}}</text>
|
||||
</view>
|
||||
</view>-->
|
||||
|
||||
<!-- 服务价格(带背景) -->
|
||||
<view class="service-header-price">
|
||||
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cabdfdbd-aeff-42c5-993e-45520265ea60.png" class="service-header-price-bj"></image>
|
||||
<view class="service-price">
|
||||
<text class="price-prefix">券后</text>
|
||||
<text class="price-symbol">¥</text>
|
||||
<text class="price-value">{{ serviceInfo.server_price }}</text>
|
||||
<view>
|
||||
<image class="triangle" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/c18845a3-e3c7-488d-bf7d-355f39f5af53.png"></image>
|
||||
<text class="price-discount" v-if="serviceInfo.line_price">已优惠¥{{ serviceInfo.line_price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 服务标题(白色卡片) -->
|
||||
<view class="service-info">
|
||||
<view class="service-title">
|
||||
<text class="service-type">{{serviceInfo.server_kind == 1 ? '到家' : serviceInfo.server_kind == 2 ? '到店' : ''}}</text>
|
||||
<text class="title-text">{{serviceInfo.title}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 下单选择 -->
|
||||
|
|
@ -867,14 +844,6 @@
|
|||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.price-prefix {
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
margin-right: 6rpx;
|
||||
margin: 0rpx 6rpx 3rpx 6rpx;
|
||||
}
|
||||
|
||||
.price-symbol {
|
||||
font-size: 26rpx;
|
||||
color: rgba(232, 16, 30, 1);
|
||||
|
|
@ -888,15 +857,6 @@
|
|||
color: rgba(232, 16, 30, 1);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.line-value{
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
text-decoration: line-through;
|
||||
margin-left: 10rpx;
|
||||
transform: translateY(6rpx);
|
||||
}
|
||||
|
||||
.service-title {
|
||||
margin-bottom: 10rpx;
|
||||
|
|
@ -907,93 +867,6 @@
|
|||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.service-header-price {
|
||||
margin: 20rpx 24rpx 0 24rpx;
|
||||
width: 702rpx;
|
||||
height: 97rpx;
|
||||
position: relative;
|
||||
}
|
||||
.service-header-price-bj {
|
||||
width: 702rpx;
|
||||
height: 97rpx;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.service-info {
|
||||
margin: 0rpx 24rpx 0rpx 24rpx;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.05);
|
||||
padding-top: 10rpx;
|
||||
padding-bottom: 14rpx;
|
||||
border-radius: 16rpx 0rpx 16rpx 16rpx;
|
||||
transform: translateY(-16rpx);
|
||||
}
|
||||
.service-price {
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-end;
|
||||
padding-top: 10rpx;
|
||||
padding-left: 24rpx;
|
||||
}
|
||||
.service-price .price-symbol {
|
||||
font-family: DINPro, DINPro;
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
line-height: 31rpx;
|
||||
margin-right: 6rpx;
|
||||
transform: translateY(-6rpx);
|
||||
}
|
||||
.service-price .price-value {
|
||||
font-family: DINPro, DINPro;
|
||||
font-weight: 500;
|
||||
font-size: 48rpx;
|
||||
color: #ffffff;
|
||||
line-height: 61rpx;
|
||||
}
|
||||
.triangle {
|
||||
width: 9rpx;
|
||||
height: 12rpx;
|
||||
transform: translate(10rpx,15rpx);
|
||||
|
||||
}
|
||||
.service-price .price-discount {
|
||||
margin-left: 16rpx;
|
||||
transform: translateY(-10rpx);
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #E8101E;
|
||||
line-height: 33rpx;
|
||||
background: #fff;
|
||||
border-radius: 6rpx;
|
||||
padding: 3rpx 8rpx;
|
||||
// text-decoration: line-through;
|
||||
}
|
||||
.service-title {
|
||||
padding: 0 24rpx;
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: flex-start;
|
||||
align-items: baseline;
|
||||
}
|
||||
.service-type {
|
||||
font-size: 26rpx;
|
||||
color: #FFFFFF;
|
||||
background-color: rgba(232, 16, 30, 1);
|
||||
padding: 2rpx 10rpx;
|
||||
border-radius: 7rpx;
|
||||
margin-right: 12rpx;
|
||||
transform: translateY(-4rpx);
|
||||
}
|
||||
.title-text {
|
||||
flex: 1;
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.service-type {
|
||||
font-size: 26rpx;
|
||||
color: #FFFFFF;
|
||||
|
|
|
|||
|
|
@ -9,126 +9,52 @@
|
|||
<!-- 账户安全 -->
|
||||
<view class="section-list">
|
||||
<view class="list-item" @click="navigateTo('/pages/settings/password')">
|
||||
<view class="item-left flex-row-center">
|
||||
<image class="item-left-img"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/82abd15d-eb6f-423c-be25-4f71d32dfcbb.png">
|
||||
</image>
|
||||
<text class="item-text">修改密码</text>
|
||||
</view>
|
||||
<image
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/34d8b914-58bd-46d7-9d88-08ed446f26c4.png"
|
||||
class="arrow-right" mode="aspectFit"></image>
|
||||
<text class="item-text">修改密码</text>
|
||||
<image src="/static/images/arrow_right.png" class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
||||
<view class="list-item">
|
||||
<view class="item-left flex-row-center">
|
||||
<image class="item-left-img"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/8c69954f-9b73-4493-ab8d-5bd3d4951313.png">
|
||||
</image>
|
||||
<text class="item-text">绑定手机</text>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
<image src="/static/images/sign-green.png" class="sign-icon" mode="aspectFit"></image>
|
||||
<text class="phone-number">{{account}}</text>
|
||||
<image
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/34d8b914-58bd-46d7-9d88-08ed446f26c4.png"
|
||||
class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="list-item" @click="navigateTo('/pages/agreement/agreement?type=26')">
|
||||
<text class="item-text">隐私政策</text>
|
||||
<image src="/static/images/arrow_right.png" class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
||||
<view class="list-item" @click="navigateTo('/pages/agreement/agreement?type=4')">
|
||||
<view class="item-left flex-row-center">
|
||||
<image class="item-left-img"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/e42a5659-88e1-47dd-82a9-f0d08fcd7382.png">
|
||||
</image>
|
||||
<text class="item-text">隐私政策</text>
|
||||
</view>
|
||||
<image
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/34d8b914-58bd-46d7-9d88-08ed446f26c4.png"
|
||||
class="arrow-right" mode="aspectFit"></image>
|
||||
<view class="list-item" @click="navigateTo('/pages/agreement/agreement?type=28')">
|
||||
<text class="item-text">用户协议</text>
|
||||
<image src="/static/images/arrow_right.png" class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
||||
<view class="list-item" @click="navigateTo('/pages/agreement/agreement?type=3')">
|
||||
<view class="item-left flex-row-center">
|
||||
<image class="item-left-img"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/5278dec3-c0b0-44c3-b099-e0d9253b8afe.png">
|
||||
</image>
|
||||
<text class="item-text">用户协议</text>
|
||||
</view>
|
||||
<image
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/34d8b914-58bd-46d7-9d88-08ed446f26c4.png"
|
||||
class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="section-list">
|
||||
<view class="list-item" @click="deleteAccount">
|
||||
<view class="item-left flex-row-center">
|
||||
<image class="item-left-img"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/d12d5407-0db9-4f3a-96c9-7df4def364cd.png">
|
||||
</image>
|
||||
<text class="item-text">注销账号</text>
|
||||
</view>
|
||||
<image
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/34d8b914-58bd-46d7-9d88-08ed446f26c4.png"
|
||||
class="arrow-right" mode="aspectFit"></image>
|
||||
<text class="item-text">注销账号</text>
|
||||
<image src="/static/images/arrow_right.png" class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
||||
<view class="list-item" @click="navigateTo('/pages/message/settings')">
|
||||
<view class="item-left flex-row-center">
|
||||
<image class="item-left-img"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/94382bb8-2819-4710-aa65-f615e49c7cf6.png">
|
||||
</image>
|
||||
<text class="item-text">消息通知</text>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
<text class="cache-size">订单、优惠通知等</text>
|
||||
<image
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/34d8b914-58bd-46d7-9d88-08ed446f26c4.png"
|
||||
class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="list-item" @click="clearStorage">
|
||||
<view class="item-left flex-row-center">
|
||||
<image class="item-left-img"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/5b7919c1-14a8-4b87-ba06-86cbb413228b.png">
|
||||
</image>
|
||||
<text class="item-text">清除缓存</text>
|
||||
</view>
|
||||
<text class="item-text">清除缓存</text>
|
||||
<view class="item-right">
|
||||
<text class="cache-size">{{ cacheSize }}</text>
|
||||
<image
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/34d8b914-58bd-46d7-9d88-08ed446f26c4.png"
|
||||
class="arrow-right" mode="aspectFit"></image>
|
||||
<image src="/static/images/arrow_right.png" class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="list-item" @click="uploadApp">
|
||||
<view class="item-left flex-row-center">
|
||||
<image class="item-left-img"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/c6f188af-abbf-47be-b1b9-c6622470eadd.png">
|
||||
</image>
|
||||
<text class="item-text">检查更新</text>
|
||||
</view>
|
||||
<text class="item-text">检查更新</text>
|
||||
<view class="item-right">
|
||||
<text class="version">{{version_number}}</text>
|
||||
<image
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/34d8b914-58bd-46d7-9d88-08ed446f26c4.png"
|
||||
class="arrow-right" mode="aspectFit"></image>
|
||||
<image src="/static/images/arrow_right.png" class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 退出登录按钮 -->
|
||||
<view class="logout-btn" @click="logout">
|
||||
<text class="logout-text">退出登录</text>
|
||||
<view class="logout-text flex-row-center-center">退出登录</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
unRegisterPush
|
||||
} from '@/uni_modules/TencentCloud-Push';
|
||||
import request from '../../utils/request'
|
||||
import uploadApp from '../../utils/uploadApp'
|
||||
export default {
|
||||
|
|
@ -177,9 +103,7 @@
|
|||
});
|
||||
},
|
||||
getUserInfo() {
|
||||
request.post('/user/getuser', {
|
||||
type: 1
|
||||
}).then(result => {
|
||||
request.post('/sj/user/getUser').then(result => {
|
||||
console.log('result', result)
|
||||
this.account = this.formatPhone(result.data.account);
|
||||
|
||||
|
|
@ -300,9 +224,7 @@
|
|||
})
|
||||
},
|
||||
//清除所有本地存储数据,但「保留指定 key」
|
||||
async clearAllExceptSpecified(keysToKeep = ['setVersion', 'searchCity', 'userAdrees', 'startLocate',
|
||||
'isLocation'
|
||||
]) {
|
||||
async clearAllExceptSpecified(keysToKeep = ['setVersion', 'searchCity', 'userAdrees', 'startLocate','isLocation']) {
|
||||
let keepData = {};
|
||||
|
||||
try {
|
||||
|
|
@ -327,21 +249,6 @@
|
|||
}
|
||||
|
||||
console.log('已清除所有缓存,保留指定key');
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
unRegisterPush(
|
||||
// 成功回调
|
||||
(res) => {
|
||||
console.log('反注册推送成功', res);
|
||||
// 清理本地存储的推送token(可选,建议做)
|
||||
},
|
||||
// 失败回调
|
||||
(err) => {
|
||||
console.error('反注册推送失败', err);
|
||||
}
|
||||
);
|
||||
// #endif
|
||||
|
||||
} catch (err) {
|
||||
console.error('操作失败:', err);
|
||||
}
|
||||
|
|
@ -373,13 +280,13 @@
|
|||
content: '本次注销将要停止使用美融融所有权力,请确认您没有未完成的订单,检查账户余额,是否注销?',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
|
||||
|
||||
// TODO: 实现注销账号逻辑
|
||||
request.post('/user/cancellation').then(res => {
|
||||
if (res.state == 1) {
|
||||
request.post('/sj/cancellation').then(res => {
|
||||
if (res.state == 1 || res.code==200) {
|
||||
that.clearAllExceptSpecified();
|
||||
uni.reLaunch({
|
||||
url: '/pages/my/my'
|
||||
url: '/pages/home/home'
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
@ -417,42 +324,35 @@
|
|||
}
|
||||
|
||||
.section-list {
|
||||
background-color: #FFFFFF;
|
||||
margin: 20rpx 20rpx 0 20rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
margin: 20rpx 30rpx;
|
||||
.list-item {
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1rpx solid #F1F1F1;
|
||||
background: transparent;
|
||||
padding: 30rpx 0;
|
||||
margin: 0 24rpx;
|
||||
.item-text {
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
line-height: 42rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.list-item {
|
||||
padding: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1rpx solid #F5F5F5;
|
||||
}
|
||||
|
||||
|
||||
.list-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.item-left {
|
||||
gap: 16rpx;
|
||||
|
||||
.item-left-img {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
|
||||
.item-text {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.item-right {
|
||||
display: flex;
|
||||
|
|
@ -473,11 +373,9 @@
|
|||
|
||||
.cache-size,
|
||||
.version {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
line-height: 37rpx;
|
||||
margin-right: 10rpx;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.arrow {
|
||||
|
|
@ -486,20 +384,26 @@
|
|||
}
|
||||
|
||||
.logout-btn {
|
||||
height: 98rpx;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left:0;
|
||||
right: 0;
|
||||
height: 165rpx;
|
||||
background-color: #FFFFFF;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 48rpx 20rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.logout-text {
|
||||
font-weight: 500;
|
||||
font-size: 30rpx;
|
||||
width: 690rpx;
|
||||
height: 90rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 47rpx;
|
||||
font-weight: 400;
|
||||
font-size: 34rpx;
|
||||
color: #333333;
|
||||
line-height: 42rpx;
|
||||
line-height: 48rpx;
|
||||
}
|
||||
|
||||
.sign-icon {
|
||||
|
|
@ -507,11 +411,6 @@
|
|||
height: 30rpx;
|
||||
}
|
||||
|
||||
.arrow-right {
|
||||
width: 10rpx;
|
||||
height: 18rpx;
|
||||
}
|
||||
|
||||
/* 平台适配 */
|
||||
/* #ifdef H5 */
|
||||
.nav-bar {
|
||||
|
|
|
|||
|
|
@ -177,11 +177,10 @@
|
|||
}
|
||||
|
||||
// 3. 调用设置密码接口(注意:原接口是sendcode,需替换为实际的设置密码接口)
|
||||
request.post('/user/passwordSet', { // 建议替换为实际接口名
|
||||
request.post('/sj/passwordSet', { // 建议替换为实际接口名
|
||||
account: that.phone,
|
||||
password: that.surePassword
|
||||
}).then(result => {
|
||||
console.log(1111111,result)
|
||||
if (result.code == 200) {
|
||||
uni.showToast({
|
||||
title: '密码设置成功',
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@
|
|||
<view class="service-info">
|
||||
<view class="service-box">
|
||||
<view class="service-name-row">
|
||||
<text class="service-name white-space-nowrap">{{
|
||||
<text class="service-name white-space-nowrap">{{
|
||||
orderInfo.title
|
||||
}}</text>
|
||||
<text class="service-name-num">×1</text>
|
||||
<text class="service-name-num">×1</text>
|
||||
</view>
|
||||
<text class="service-subtitle white-space-nowrap">{{identity==0?'使用场景':'服务范围'}}:{{
|
||||
orderInfo.first_class_title +
|
||||
|
|
@ -37,12 +37,12 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="service-real-1">
|
||||
<text class="real-lable">应付金额:</text>
|
||||
<view class="real-price">
|
||||
<text class="icon">¥</text>
|
||||
<text class="price">{{ orderInfo.order_money }}</text>
|
||||
</view>
|
||||
<text class="real-lable">应付金额:</text>
|
||||
<view class="real-price">
|
||||
<text class="icon">¥</text>
|
||||
<text class="price">{{ orderInfo.order_money }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="service-real">
|
||||
<view class="card_time">预约开始时间:{{
|
||||
formatDateAndAddMinutes(orderInfo.reserve_start_time).original
|
||||
|
|
@ -68,7 +68,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 到家订单 客户以及手艺人信息 -->
|
||||
<view class="shop_card">
|
||||
<view class="card_title" v-if="identity==0">顾客信息</view>
|
||||
|
|
@ -76,12 +76,13 @@
|
|||
<view class="shop_title_box">
|
||||
<image class="shop_photo" :src="orderInfo.head_photo" />
|
||||
<view class="left-section">
|
||||
<view class="shop_title">{{ orderInfo.name }}</view>
|
||||
<text class="shop_phone" @click="contactService(orderInfo.phone)">
|
||||
{{ orderInfo.phone || orderInfo.account }}
|
||||
</text>
|
||||
<view class="shop_title">{{ orderInfo.name }}</view>
|
||||
<text class="shop_phone" @click="contactService(orderInfo.phone)">
|
||||
{{ orderInfo.phone || orderInfo.account }}
|
||||
</text>
|
||||
</view>
|
||||
<image class="shop_icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/5e6bb10e-9f14-4349-8021-7e79078a8da7.png"
|
||||
<image class="shop_icon"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/5e6bb10e-9f14-4349-8021-7e79078a8da7.png"
|
||||
@click="contactService(orderInfo.phone)" />
|
||||
</view>
|
||||
<view class="service_content" :class="{service_content__last:identity==0}"
|
||||
|
|
@ -127,7 +128,7 @@
|
|||
: ""
|
||||
}}</text>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- <view class="info-item" v-if="orderInfo.state != 1 && orderInfo.pay_money">
|
||||
<text class="label">支付小计</text>
|
||||
<text class="value" style="color: #E8101E">{{ orderInfo.order_money }}元</text>
|
||||
|
|
@ -141,12 +142,12 @@
|
|||
<text class="label">接单时间</text>
|
||||
<text class="value">{{ orderInfo.get_time }}</text>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="info-item" v-if="orderInfo.state >= 4 && orderInfo.start_time">
|
||||
<text class="label">开始服务时间</text>
|
||||
<text class="value">{{ orderInfo.start_time }}</text>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="info-item" v-if="orderInfo.state >= 5 && orderInfo.end_time">
|
||||
<text class="label">完成服务时间</text>
|
||||
<text class="value">{{ orderInfo.end_time }}</text>
|
||||
|
|
@ -154,7 +155,7 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<view class="bottom-buttons">
|
||||
|
|
@ -253,7 +254,7 @@
|
|||
computed: {
|
||||
backgroundColor() {
|
||||
if (this.scrollTop > 10) {
|
||||
return `rgba(255, 255, 255, ${0.02 * this.scrollTop});`;
|
||||
return `rgba(255, 255, 255, ${Math.min(0.02 * this.scrollTop, 1)})`;
|
||||
}
|
||||
return "transparent";
|
||||
},
|
||||
|
|
@ -305,12 +306,12 @@
|
|||
// 用于标准格式的方法
|
||||
formatDateTime(dateStr, includeSeconds = true) {
|
||||
if (!dateStr) {
|
||||
return '';
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
// 处理日期字符串,兼容不同格式
|
||||
const originalDate = new Date(dateStr.replace(/-/g, '/'));
|
||||
|
||||
|
||||
// 格式化为 YYYY-MM-DD HH:mm:ss
|
||||
const year = originalDate.getFullYear();
|
||||
const month = String(originalDate.getMonth() + 1).padStart(2, "0");
|
||||
|
|
@ -318,11 +319,11 @@
|
|||
const hours = String(originalDate.getHours()).padStart(2, "0");
|
||||
const minutes = String(originalDate.getMinutes()).padStart(2, "0");
|
||||
const seconds = String(originalDate.getSeconds()).padStart(2, "0");
|
||||
|
||||
|
||||
if (includeSeconds) {
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
} else {
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}`;
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}`;
|
||||
}
|
||||
},
|
||||
formatDateAndAddMinutes(dateStr, addMinutes = 0) {
|
||||
|
|
@ -378,7 +379,7 @@
|
|||
}
|
||||
|
||||
// 计算服务时长
|
||||
this.orderInfo.service_duration = this.calculateServiceDuration();
|
||||
this.orderInfo.service_duration = this.calculateServiceDuration();
|
||||
|
||||
this.orderInfo.second_class_title?.join("、");
|
||||
});
|
||||
|
|
@ -388,25 +389,25 @@
|
|||
if (!this.orderInfo.reserve_start_time || !this.orderInfo.reserve_end_time) {
|
||||
return '--';
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
// 处理日期字符串,兼容不同格式
|
||||
const startTime = new Date(this.orderInfo.reserve_start_time.replace(/-/g, '/'));
|
||||
const endTime = new Date(this.orderInfo.reserve_end_time.replace(/-/g, '/'));
|
||||
|
||||
|
||||
// 计算时间差(毫秒)
|
||||
const diffMs = endTime.getTime() - startTime.getTime();
|
||||
|
||||
|
||||
if (diffMs <= 0) {
|
||||
return '--';
|
||||
return '--';
|
||||
}
|
||||
|
||||
|
||||
// 转换为分钟
|
||||
const diffMinutes = Math.floor(diffMs / (1000 * 60));
|
||||
|
||||
|
||||
// 返回XX分钟格式
|
||||
return `${diffMinutes}分钟`;
|
||||
|
||||
|
||||
} catch (error) {
|
||||
console.error('计算服务时长失败:', error);
|
||||
return '--';
|
||||
|
|
@ -733,7 +734,7 @@
|
|||
border-radius: 16rpx;
|
||||
margin-right: 24rpx;
|
||||
background-color: #e2e2e2;
|
||||
flex-shrink: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.service-info {
|
||||
|
|
@ -786,7 +787,7 @@
|
|||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
line-height: 34rpx;
|
||||
flex-shrink: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.service-price {
|
||||
|
|
@ -800,10 +801,11 @@
|
|||
padding-top: 8rpx;
|
||||
// border-top: 1rpx solid rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.service-real-1 {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content:flex-end;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding-top: 14rpx;
|
||||
border-top: 1rpx solid rgba(0, 0, 0, 0.05);
|
||||
|
|
@ -821,8 +823,9 @@
|
|||
transform: translateY(-5rpx);
|
||||
|
||||
.icon {
|
||||
font-size: 20rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-family: DINPro, DINPro;
|
||||
}
|
||||
|
|
@ -883,8 +886,8 @@
|
|||
align-items: center;
|
||||
flex: 1;
|
||||
gap: 20rpx;
|
||||
min-width: 0;
|
||||
|
||||
min-width: 0;
|
||||
|
||||
.shop_title {
|
||||
margin-left: 12rpx;
|
||||
font-size: 32rpx;
|
||||
|
|
@ -895,18 +898,19 @@
|
|||
flex-shrink: 0;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
|
||||
.shop_phone {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
margin-bottom: -5rpx;
|
||||
line-height: 40rpx;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
transform: translateY(-3rpx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.shop_icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@
|
|||
<view class="per-cont">便于您使用该功能上传您的照片/图片/视频以及用于更换头像、发布商品等场景中所需内容。</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
@ -259,64 +258,43 @@
|
|||
this.openCamera(type);
|
||||
return
|
||||
}
|
||||
let xcpermission = '';
|
||||
let xjpermission = '';
|
||||
if (systemInfo.platform === 'ios') {
|
||||
xcpermission = 'photo_library',
|
||||
xjpermission = 'camera'
|
||||
} else {
|
||||
xcpermission =
|
||||
`android.permission.READ_EXTERNAL_STORAGE,android.permission.WRITE_EXTERNAL_STORAGE`
|
||||
xjpermission = 'android.permission.CAMERA'
|
||||
}
|
||||
let firstRequest = ""
|
||||
if (type == 3) {
|
||||
const firstRequest = !plus.storage.getItem(`perm_${xcpermission}`)
|
||||
} else {
|
||||
const firstRequest = !plus.storage.getItem(`perm_${xjpermission}`)
|
||||
}
|
||||
// 根据类型确定权限字符串和提示文本
|
||||
const permissionKey = type === 3 ? 'photo_library' : 'camera';
|
||||
const permissionAndroid = type === 3
|
||||
? 'android.permission.READ_EXTERNAL_STORAGE,android.permission.WRITE_EXTERNAL_STORAGE'
|
||||
: 'android.permission.CAMERA';
|
||||
const dialogTitle = type === 3 ? '相册权限申请' : '相机权限申请';
|
||||
const dialogContent = type === 3
|
||||
? '我们需要访问您的相册以完成图片添加'
|
||||
: '我们需要访问您的相机以完成图片拍摄';
|
||||
const nowQer = type === 3 ? 'xc' : 'xj';
|
||||
|
||||
// 检查是否是首次请求(用于控制自定义视图显示)
|
||||
const firstRequest = !plus.storage.getItem(`perm_${permissionKey}`);
|
||||
if (firstRequest) {
|
||||
this.isShowPer = true;
|
||||
this.nowQer = nowQer;
|
||||
}
|
||||
|
||||
let xcj = null
|
||||
let text1 = "相册权限申"
|
||||
let text2 = "我们需要访问您的相册以完成图片添加"
|
||||
if (type == 3) {
|
||||
this.nowQer = 'xc';
|
||||
xcj = await permissionUtils.checkPermission('photo_library', '需要相册权限用于上传照片');
|
||||
} else {
|
||||
this.nowQer = 'xj';
|
||||
xcj = await permissionUtils.checkPermission('camera', '需要相机权限用于拍摄照片');
|
||||
let text1 = "相机权限申"
|
||||
let text2 = "我们需要访问您的相册以完成图片添加"
|
||||
}
|
||||
this.isShowPer = false;
|
||||
this.nowQer = '';
|
||||
if (xcj.granted) {
|
||||
|
||||
// 1. 检查权限
|
||||
const { granted } = await permissionUtils.checkPermission(permissionKey, dialogContent);
|
||||
if (granted) {
|
||||
this.isShowPer = false;
|
||||
this.openCamera(type);
|
||||
return;
|
||||
}
|
||||
// 2. 显示权限说明弹窗
|
||||
const confirm = await this.showPermissionDialog(
|
||||
text1,
|
||||
text2
|
||||
);
|
||||
|
||||
|
||||
// 2. 隐藏自定义视图,显示系统风格弹窗
|
||||
this.isShowPer = false;
|
||||
const confirm = await this.showPermissionDialog(dialogTitle, dialogContent);
|
||||
if (!confirm) return;
|
||||
|
||||
let result = null
|
||||
if (type == 3) {
|
||||
result = await permissionUtils.requestPermission('photo_library', '我们需要访问您的相册以上传图片');
|
||||
} else {
|
||||
result = await permissionUtils.requestPermission('camera', '我们需要访问您的相机以上传图片');
|
||||
}
|
||||
|
||||
|
||||
// 3. 请求权限
|
||||
const result = await permissionUtils.requestPermission(permissionKey, dialogContent);
|
||||
if (result) {
|
||||
this.openCamera(type);
|
||||
} else {
|
||||
locationService.openAppSettings();
|
||||
// uni.showToast({ title: '相机权限被拒绝', icon: 'none' });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('权限处理出错:', error);
|
||||
|
|
@ -339,7 +317,7 @@
|
|||
});
|
||||
});
|
||||
},
|
||||
// 打开相机
|
||||
// 打开相机/相册
|
||||
async openCamera(type) {
|
||||
this.isShowPer = false;
|
||||
let result = null
|
||||
|
|
|
|||
|
|
@ -16,25 +16,11 @@
|
|||
</view>
|
||||
|
||||
<!-- 服务价格 -->
|
||||
<view class="form-item" style="flex-wrap: wrap;">
|
||||
<text class="form-label required">服务定价</text>
|
||||
<input type="digit" v-model.number="formData.line_price" placeholder="请输入定价,最多两位小数"
|
||||
placeholder-class="placeholder" class="form-input" @input="inpPrice2" @blur="inpPrice2"
|
||||
@confirm="inpPrice2" step="0.01" />
|
||||
<view class="price-tip">
|
||||
<text class="price-tip-card">服务的基础定价,未参与任何优惠的价格</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 服务价格 -->
|
||||
<view class="form-item" style="flex-wrap: wrap;">
|
||||
<text class="form-label required">服务售价</text>
|
||||
<input type="digit" v-model.number="formData.server_price" placeholder="请输入售价,最多两位小数"
|
||||
<view class="form-item">
|
||||
<text class="form-label required">服务价格</text>
|
||||
<input type="digit" v-model.number="formData.server_price" placeholder="请输入服务价格,最多两位小数"
|
||||
placeholder-class="placeholder" class="form-input" @input="inpPrice" @blur="inpPrice"
|
||||
@confirm="inpPrice" step="0.01" />
|
||||
<view class="price-tip">
|
||||
<text class="price-tip-card">服务参与单品优惠后的价格</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 服务分类 -->
|
||||
|
|
@ -254,7 +240,6 @@
|
|||
server_kind: getApp().globalData.artisanType,
|
||||
title: '',
|
||||
server_price: '',
|
||||
line_price:'',
|
||||
server_time: '',
|
||||
first_class_id: '',
|
||||
second_class_id: '',
|
||||
|
|
@ -434,7 +419,6 @@
|
|||
this.formData.back_text = res.data.back_text;
|
||||
this.formData.title = res.data.title;
|
||||
this.formData.server_price = res.data.server_price;
|
||||
this.formData.line_price = res.data.line_price;
|
||||
this.formData.server_time = res.data.server_time;
|
||||
this.formData.first_class_id = res.data.first_class_id;
|
||||
this.formData.second_class_id = res.data.second_class_id;
|
||||
|
|
@ -505,29 +489,6 @@
|
|||
}
|
||||
that.$set(that.formData, 'server_price', value);
|
||||
},
|
||||
inpPrice2(e) {
|
||||
let that = this;
|
||||
let value = e.detail.value;
|
||||
|
||||
// 1. 移除非数字和小数点
|
||||
value = value.replace(/[^\d.]/g, '');
|
||||
|
||||
// 2. 确保只有一个小数点
|
||||
const parts = value.split('.');
|
||||
if (parts.length > 2) {
|
||||
value = parts[0] + '.' + parts.slice(1).join('');
|
||||
}
|
||||
|
||||
// 3. 限制小数点后最多一位
|
||||
if (parts.length > 1) {
|
||||
value = parts[0] + '.' + parts[1].slice(0, 2);
|
||||
}
|
||||
// 4. 如果以小数点开头,前面补0
|
||||
if (value.startsWith('.')) {
|
||||
value = '0' + value;
|
||||
}
|
||||
that.$set(that.formData, 'line_price', value);
|
||||
},
|
||||
addDetailItem(item) {
|
||||
let detailItem = {
|
||||
title: item.detailItem,
|
||||
|
|
@ -577,7 +538,6 @@
|
|||
const {
|
||||
title,
|
||||
server_price,
|
||||
line_price,
|
||||
server_time,
|
||||
first_class_id,
|
||||
second_class_id,
|
||||
|
|
@ -589,7 +549,6 @@
|
|||
let item = {
|
||||
title,
|
||||
server_price,
|
||||
line_price,
|
||||
server_time,
|
||||
first_class_id,
|
||||
second_class_id,
|
||||
|
|
@ -664,21 +623,13 @@
|
|||
})
|
||||
return
|
||||
}
|
||||
if (!this.formData.line_price) {
|
||||
uni.showToast({
|
||||
title: '请输入服务定价',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!this.formData.server_price) {
|
||||
uni.showToast({
|
||||
title: '请输入服务售价',
|
||||
title: '请输入服务价格',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (!this.formData.first_class_id) {
|
||||
uni.showToast({
|
||||
title: '请选择服务分类',
|
||||
|
|
@ -779,7 +730,6 @@
|
|||
} else {
|
||||
url = '/user/serverupdate'
|
||||
}
|
||||
console.log(1111,this.formData)
|
||||
request.post(url, this.formData).then(res => {
|
||||
if (res.state == 1) {
|
||||
const pages = getCurrentPages();
|
||||
|
|
@ -936,20 +886,6 @@
|
|||
color: #333333;
|
||||
margin-left: 32rpx;
|
||||
}
|
||||
|
||||
.price-tip{
|
||||
width: 100%;
|
||||
margin-top: 40rpx;
|
||||
.price-tip-card{
|
||||
padding: 8rpx 12rpx;
|
||||
background: #FDF0F0;
|
||||
border-radius: 8rpx;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #EE4853;
|
||||
line-height: 33rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.form-right {
|
||||
display: flex;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@
|
|||
<view class="service-address" v-if="order.order_kind == 1">
|
||||
<image src="/static/images/position_icon.png" class="location-icon"></image>
|
||||
<text
|
||||
class="text-overflow-1">{{Object.assign({},order.reservation_address_arr).dependency}}{{Object.assign({},order.reservation_address_arr).address}}</text>
|
||||
>{{Object.assign({},order.reservation_address_arr).dependency}}{{Object.assign({},order.reservation_address_arr).address}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -552,6 +553,15 @@
|
|||
color: #999999;
|
||||
font-weight: 500;
|
||||
margin-top: 8rpx;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.text-overflow-1 {
|
||||
white-space: normal !important;
|
||||
word-break: break-word !important;
|
||||
overflow: visible !important;
|
||||
text-overflow: clip !important;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.time-icon,
|
||||
|
|
@ -560,6 +570,7 @@
|
|||
height: 24rpx;
|
||||
margin-right: 4rpx;
|
||||
flex-shrink: 0;
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
|
||||
.order-actions {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
<view class="service-price" >
|
||||
<text v-if="dataItem.team_buy_id">{{`团购价: `}}</text>¥<text
|
||||
style="font-size: 34rpx;">{{ dataItem.order_money }}</text>
|
||||
<text class="service-price-line">{{ dataItem.line_money }}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
|
@ -286,14 +285,6 @@
|
|||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
.service-price-line{
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
line-height: 34rpx;
|
||||
margin-left: 10rpx;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
|
||||
.service-type {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@
|
|||
<view class="service-price">
|
||||
<text v-if="dataItem.team_buy_id">{{`团购价: `}}</text>¥<text
|
||||
style="font-size: 34rpx;">{{ dataItem.order_money }}</text>
|
||||
<text class="service-price-line">{{ dataItem.line_money }}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
|
@ -259,15 +258,6 @@
|
|||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
|
||||
.service-price-line {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
line-height: 34rpx;
|
||||
margin-left: 10rpx;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
|
||||
.service-type {
|
||||
|
|
|
|||
1179
pages/shop/home.vue
1179
pages/shop/home.vue
File diff suppressed because it is too large
Load Diff
|
|
@ -1,611 +0,0 @@
|
|||
<template>
|
||||
<view class="my-page">
|
||||
<custom-navbar title="个人中心" :showBack="true" borderBottom="none"
|
||||
backgroundColor="linear-gradient( 106deg, #FFE1E1 0%, #CCD8F7 100%)"></custom-navbar>
|
||||
|
||||
<!-- 用户信息区域 -->
|
||||
<view class="user-info">
|
||||
<view class="user-header">
|
||||
<view class="avatar-wrap">
|
||||
<image class="avatar" v-if="userInfo.head_photo" :src="userInfo.head_photo" mode="aspectFill">
|
||||
</image>
|
||||
</view>
|
||||
<view class="user-detail">
|
||||
<view class="name-wrap">
|
||||
<text class="name">{{ userInfo.name }}</text>
|
||||
<view class="amount-box" @click="navigateTo('/pages/wallet/wallet')">
|
||||
<image class="amount-img" src="@/static/images/icons/wallet.png" />
|
||||
<text class="amount-lable"> 钱包余额: </text>
|
||||
<text class="amount-text"> {{ userInfo.money }}元 </text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="edit-profile" @click="goArtisanProfile">
|
||||
<text class="edit-text">编辑资料</text>
|
||||
<image class="arrow-right" src="/static/images/arrow_right.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="notify" v-if="unbindReadNum>0">
|
||||
<view class="notify-left">
|
||||
<image class="notify-left-img" src="@/static/images/icons/notify2.png"></image>
|
||||
<text>通知:你有员工解绑申请</text>
|
||||
</view>
|
||||
<image class="notify-right" @click="goUnbundleList" src="@/static/images/icons/notify1.png"></image>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<view class="module box-cont">
|
||||
<view class="module-lable"> 交易项目 </view>
|
||||
<view class="module-cont">
|
||||
<image :src="item.imgUrl" class="module-cont-img" mode="aspectFit" v-for="(item,i) in tradeList"
|
||||
:key="item.id" @click="navigateTo(item.pathUrl)"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="module box-cont module-order">
|
||||
<view class="module-lable"> 交易订单 </view>
|
||||
<view class="module-cont">
|
||||
<image :src="item.imgUrl" class="module-cont-img" mode="aspectFit" v-for="(item,i) in orderTypeList"
|
||||
:key="item.id" @click="navigateTo(item.pathUrl)"></image>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<!-- 营销中心 -->
|
||||
<view class="module box-cont module-order">
|
||||
<view class="module-lable"> 营销中心 </view>
|
||||
<view class="module-cont">
|
||||
<image :src="item.imgUrl" class="module-cont-img" mode="aspectFit"
|
||||
v-for="(item,i) in marketingTypeList" :key="item.id" @click="navigateTo(item.pathUrl)"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="module box-cont">
|
||||
<view class="module-lable"> 员工服务 </view>
|
||||
<view class="module-cont">
|
||||
<image :src="item.imgUrl" class="module-cont-img" mode="aspectFit" v-for="(item,i) in staffList"
|
||||
:key="item.id" @click="navigateTo(item.pathUrl)"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 平台自营项目 -->
|
||||
<image class="module-banner" @click="goAgreement" v-if="userInfo.self_state==0" mode="widthFix"
|
||||
src="/static/images/home/zyBanner.png"></image>
|
||||
<view class="module box-cont module-order" v-else>
|
||||
<view class="module-lable"> 平台自营项目 </view>
|
||||
|
||||
<view class="module-cont">
|
||||
<image :src="item.imgUrl" class="module-cont-img" mode="aspectFit"
|
||||
v-for="(item,i) in selfOperatedList" :key="item.id" @click="navigateTo(item.pathUrl)"></image>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<!-- 功能列表 -->
|
||||
<view class="function-list">
|
||||
<!-- <view class="function-item" @click="navigateTo('/pages/ranking/index')">
|
||||
<text class="function-text">排行榜</text>
|
||||
<text class="arrow">></text>
|
||||
</view> -->
|
||||
<!-- <view class="function-item" @click="navigateTo('/pages/shop/groupBuying/list')">
|
||||
<text class="function-text">拼团管理</text>
|
||||
<image class="right_gray" src="@/static/images/icons/right_gray3.png" />
|
||||
</view> -->
|
||||
<view class="function-item" @click="navigateTo('/pages/contact/contact')">
|
||||
<text class="function-text">客服</text>
|
||||
<image class="right_gray" src="@/static/images/icons/right_gray3.png" />
|
||||
</view>
|
||||
<!-- <view class="function-item" @click="navigateTo('/pages/share/syrandsjshare')">
|
||||
<text class="function-text">分享</text>
|
||||
<text class="arrow">></text>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from "../../utils/request";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userInfo: {},
|
||||
orderCount: 0,
|
||||
servicesCount: 0,
|
||||
selfOperatedList: [{
|
||||
id: 0,
|
||||
imgUrl: '/static/images/tab/SelfOperatedServe.png',
|
||||
pathUrl: '/pages/selfOperated/list'
|
||||
}, {
|
||||
id: 1,
|
||||
imgUrl: '/static/images/tab/SelfOperatedOrder.png',
|
||||
pathUrl: "/pages/shop/userorders?serviceType=2"
|
||||
}, ],
|
||||
tradeList: [{
|
||||
id: 0,
|
||||
title: "服务管理",
|
||||
des: "服务的发布与管理",
|
||||
imgUrl: "/static/images/tab/service_gl.png",
|
||||
pathUrl: "/pages/artisan/service-list",
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: '工位管理',
|
||||
des: '工位的发布与管理',
|
||||
imgUrl: '/static/images/tab/station_gl.png',
|
||||
pathUrl: '/pages/shop/workSpace/list'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "购买服务",
|
||||
des: "可购买手艺人的服务",
|
||||
imgUrl: "/static/images/tab/buy_service.png",
|
||||
pathUrl: "/pages/shop/buy-service",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: '购买工时',
|
||||
des: '可购买手艺人的工时',
|
||||
imgUrl: '/static/images/tab/buy_time.png',
|
||||
pathUrl: '/pages/shop/manHour/buyManHour'
|
||||
},
|
||||
],
|
||||
orderTypeList: [{
|
||||
id: 0,
|
||||
title: "用户订单",
|
||||
des: "我售卖的服务信息",
|
||||
imgUrl: "/static/images/tab/user_order.png",
|
||||
pathUrl: "/pages/shop/userorders",
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: '工位订单',
|
||||
des: '我售卖的工位信息',
|
||||
imgUrl: '/static/images/tab/station_order.png',
|
||||
pathUrl: '/pages/shop/workSpace/saleList'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "服务订单",
|
||||
des: "我买的手艺人服务",
|
||||
imgUrl: "/static/images/tab/shop_service_order.png",
|
||||
pathUrl: "/pages/shop/buy-order",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: '工时订单',
|
||||
des: '我买的手艺人工时',
|
||||
imgUrl: '/static/images/tab/shop_time_order.png',
|
||||
pathUrl: '/pages/shop/manHour/saleList'
|
||||
},
|
||||
],
|
||||
marketingTypeList: [{
|
||||
id: 0,
|
||||
imgUrl: "/static/images/tab/pintuan_order.png",
|
||||
pathUrl: "/pages/shop/groupBuying/list",
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
imgUrl: '/static/images/tab/promotion_order.png',
|
||||
pathUrl: '/pages/promotion/promotion'
|
||||
},
|
||||
],
|
||||
staffList: [{
|
||||
id: 0,
|
||||
imgUrl: "/static/images/tab/staff2.png",
|
||||
pathUrl: "/pages/shop/staff/manage",
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
imgUrl: '/static/images/tab/staff1.png',
|
||||
pathUrl: '/pages/shop/staff/distribution-service'
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
props: {
|
||||
unbindReadNum: {
|
||||
type: [Number,String],
|
||||
default:0
|
||||
},
|
||||
},
|
||||
onLoad() {},
|
||||
async created() {
|
||||
|
||||
const {
|
||||
data
|
||||
} = await request.post("/user/getuser", {
|
||||
type: 3,
|
||||
});
|
||||
this.userInfo = data;
|
||||
//存储商家地址
|
||||
uni.setStorageSync("shopdependency", this.userInfo.dependency);
|
||||
// this.getServicesList();
|
||||
},
|
||||
methods: {
|
||||
goUnbundleList() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/shop/staff/unbundleList",
|
||||
});
|
||||
},
|
||||
goAgreement() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/selfOperated/agreement?title=平台自营项目介绍&type=18",
|
||||
});
|
||||
},
|
||||
goArtisanProfile() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/artisan/profile",
|
||||
});
|
||||
},
|
||||
// 已上架服务数量
|
||||
getServicesList() {
|
||||
let url = null;
|
||||
if (getApp().globalData.artisanType == 1) {
|
||||
url = "/user/syrserverlist";
|
||||
} else if (getApp().globalData.artisanType == 2) {
|
||||
url = "/user/sjserverlist";
|
||||
}
|
||||
request
|
||||
.post(url, {
|
||||
state: 2,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.state == 1) {
|
||||
this.servicesCount = res.data.length;
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 页面跳转
|
||||
navigateTo(url) {
|
||||
uni.navigateTo({
|
||||
url,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
.notify {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 702rpx;
|
||||
box-sizing: border-box;
|
||||
padding: 14rpx 24rpx 14rpx 40rpx;
|
||||
background: linear-gradient(320deg, #FFFFFF 0%, #FFFFFF 100%);
|
||||
border-radius: 19rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.notify-left {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
line-height: 40rpx;
|
||||
text-align: right;
|
||||
font-style: normal;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.notify-left-img {
|
||||
width: 42rpx;
|
||||
height: 42rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.notify-right {
|
||||
width: 130rpx;
|
||||
height: 54rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.my-page {
|
||||
position: relative;
|
||||
margin-bottom: 120rpx;
|
||||
}
|
||||
|
||||
.my-page::before {
|
||||
content: "";
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 676rpx !important;
|
||||
background-image: url("/static/images/background/bj.png");
|
||||
background-size: cover;
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.user-info {
|
||||
padding: 0 24rpx;
|
||||
position: relative;
|
||||
z-index: 99;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
|
||||
.user-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 48rpx;
|
||||
}
|
||||
|
||||
.avatar-wrap {
|
||||
width: 110rpx;
|
||||
height: 110rpx;
|
||||
border-radius: 64rpx;
|
||||
overflow: hidden;
|
||||
margin-right: 24rpx;
|
||||
border: 4rpx solid #fff;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.user-detail {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.name-wrap {
|
||||
display: flex;
|
||||
flex-flow: column nowrap;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-weight: 500;
|
||||
font-size: 34rpx;
|
||||
color: #333333;
|
||||
line-height: 56rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.verified {
|
||||
width: 130rpx;
|
||||
height: 44rpx;
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border: 1rpx solid #E8101E;
|
||||
background-color: #fff1f1;
|
||||
border-radius: 22rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.verified-no {
|
||||
width: 130rpx;
|
||||
height: 44rpx;
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border: 1rpx solid #666666;
|
||||
border-radius: 22rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.verified-text {
|
||||
font-size: 24rpx;
|
||||
color: #E8101E;
|
||||
}
|
||||
|
||||
.verified-text.no {
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.sign-icon {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
|
||||
.edit-profile {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.edit-text {
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.arrow {
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.amount-img {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.amount-box {
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
background: rgba(252, 67, 124, 0.1);
|
||||
border-radius: 30rpx;
|
||||
padding: 10rpx 16rpx;
|
||||
}
|
||||
|
||||
.amount-lable {
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
line-height: 30rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.amount-text {
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
line-height: 30rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
color: #E8101E;
|
||||
}
|
||||
|
||||
.function-list {
|
||||
background: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
padding: 24rpx;
|
||||
box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.05);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 30rpx;
|
||||
}
|
||||
|
||||
.function-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
/* border-bottom: 1rpx solid rgba(0, 0, 0, 0.05); */
|
||||
}
|
||||
|
||||
.function-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.function-text {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #232220;
|
||||
line-height: 40rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
/* 交易项目 */
|
||||
.module {
|
||||
margin: 0;
|
||||
border-radius: 24rpx;
|
||||
padding: 24rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.module-banner {
|
||||
width: 702rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.module-cont {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.module-cont-img {
|
||||
width: 310rpx;
|
||||
height: 120rpx;
|
||||
margin-top: 23rpx;
|
||||
}
|
||||
|
||||
.module-item {
|
||||
width: 310rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 16rpx;
|
||||
border: 2rpx solid #f0eeee;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 24rpx 22rpx 24rpx 24rpx;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.module-order .module-item {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.right_gray {
|
||||
width: 14rpx;
|
||||
height: 26rpx;
|
||||
}
|
||||
|
||||
.module-lable {
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
line-height: 45rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.module-left {
|
||||
display: flex;
|
||||
flex-flow: column nowrap;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.module-tit {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
line-height: 40rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-bottom: 4rpx;
|
||||
}
|
||||
|
||||
.module-des {
|
||||
font-weight: 500;
|
||||
font-size: 20rpx;
|
||||
color: #999999;
|
||||
line-height: 28rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.module-icon {
|
||||
width: 68rpx;
|
||||
height: 68rpx;
|
||||
}
|
||||
|
||||
.module-order .module-icon {
|
||||
margin-right: 28rpx;
|
||||
}
|
||||
|
||||
.arrow-right {
|
||||
width: 11rpx;
|
||||
height: 22rpx;
|
||||
}
|
||||
|
||||
/* 平台适配 */
|
||||
/* #ifdef H5 */
|
||||
|
||||
/* #endif */
|
||||
|
||||
/* #ifdef MP-WEIXIN */
|
||||
|
||||
/* #endif */
|
||||
</style>
|
||||
|
|
@ -105,9 +105,7 @@
|
|||
<view class="per-cont">便于您使用该功能上传您的照片/图片/视频以及用于更换头像、发布商品等场景中所需内容。</view>
|
||||
</view>
|
||||
|
||||
<video v-show="videoPlay" :src="videoUrl" controls id="myvideo" style="height: 0; width: 0; position: absolute; top: -999rpx; left: -999rpx;"
|
||||
@fullscreenchange="screenChange"></video>
|
||||
<uv-divider></uv-divider>
|
||||
<video v-show="videoPlay" :src="videoUrl" controls id="myvideo" style="height: 0;width: 0;" @fullscreenchange="screenChange"></video>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -122,7 +120,6 @@
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
videoContext:null,
|
||||
videoPlay: false,
|
||||
videoUrl: "",
|
||||
disabled: false,
|
||||
|
|
@ -204,13 +201,10 @@
|
|||
},
|
||||
methods: {
|
||||
screenChange(e) {
|
||||
|
||||
let fullScreen = e.detail.fullScreen; // 值true为进入全屏,false为退出全屏
|
||||
console.log(e, "全屏");
|
||||
if (!fullScreen) {
|
||||
//退出全屏
|
||||
this.videoContext.pause()
|
||||
plus.screen.lockOrientation('portrait-primary');
|
||||
this.videoPlay = false; // 隐藏播放盒子
|
||||
}
|
||||
},
|
||||
|
|
@ -226,8 +220,8 @@
|
|||
direction: 90
|
||||
});
|
||||
this.videoContext.play();
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
async submitPhoto() {
|
||||
// 1. 防连点核心逻辑:如果正在提交中,直接return阻止后续执行
|
||||
|
|
@ -372,8 +366,7 @@
|
|||
if (this.formData.type == 1) {
|
||||
res = await uploadImage.handleUpload(this.userInfo.id, 3);
|
||||
} else {
|
||||
res = await uploadImage.handleUpload(this.userInfo.id, 3, ['album', 'camera'],
|
||||
'video');
|
||||
res = await uploadImage.handleUpload(this.userInfo.id, 3, ['album', 'camera'], 'video');
|
||||
}
|
||||
console.log('上传单张图片', res)
|
||||
this.formData.url = res;
|
||||
|
|
@ -427,8 +420,7 @@
|
|||
// 1. 检查权限
|
||||
// const { granted } = await permissionUtils.checkPermission('photo_library', '需要相册权限用于上传照片');
|
||||
this.nowQer = 'xc';
|
||||
const xc = await permissionUtils.checkPermission('photo_library',
|
||||
'需要相册权限用于上传照片');
|
||||
const xc = await permissionUtils.checkPermission('photo_library', '需要相册权限用于上传照片');
|
||||
this.nowQer = 'xj';
|
||||
const xj = await permissionUtils.checkPermission('camera', '需要相机权限用于拍摄照片');
|
||||
this.isShowPer = false;
|
||||
|
|
@ -447,10 +439,8 @@
|
|||
if (!confirm) return;
|
||||
|
||||
// 3. 请求权限
|
||||
const result1 = await permissionUtils.requestPermission('photo_library',
|
||||
'我们需要访问您的相册以上传图片/视频');
|
||||
const result2 = await permissionUtils.requestPermission('camera',
|
||||
'我们需要访问您的相机以上传图片/视频');
|
||||
const result1 = await permissionUtils.requestPermission('photo_library', '我们需要访问您的相册以上传图片/视频');
|
||||
const result2 = await permissionUtils.requestPermission('camera', '我们需要访问您的相机以上传图片/视频');
|
||||
if (result1 && result2) {
|
||||
this.openCamera();
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -35,10 +35,6 @@
|
|||
<image class="photo-mask-img" mode="aspectFill" src="/static/images/icons/time.png"></image>
|
||||
<text class="photo-mask-text">审核中…</text>
|
||||
</view>
|
||||
<view class="content-photo-mask" v-if="item2.apply_state==3">
|
||||
<image class="photo-mask-img" mode="aspectFill" src="/static/images/icons/close2.png"></image>
|
||||
<view class="photo-mask-text">已驳回</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-content flex-row-center" v-else>
|
||||
|
|
@ -61,11 +57,11 @@
|
|||
<!-- <video class="content-photo-video" loop="true" :controls="false" :autoplay="true" :muted="true"
|
||||
:src="item2.url || item2.auth_url">
|
||||
</video> -->
|
||||
<view class="content-photo-mask" v-if="item2.apply_state==1">
|
||||
<view class="content-photo-mask" v-if="item2.apply_state==1">
|
||||
<image class="photo-mask-img" mode="aspectFill" src="/static/images/icons/time.png"></image>
|
||||
<view class="photo-mask-text">审核中…</view>
|
||||
</view>
|
||||
<view class="content-photo-mask" v-if="item2.apply_state==3">
|
||||
<view class="content-photo-mask" v-if="item2.apply_state==3">
|
||||
<image class="photo-mask-img" mode="aspectFill" src="/static/images/icons/close2.png"></image>
|
||||
<view class="photo-mask-text">已驳回</view>
|
||||
</view>
|
||||
|
|
@ -119,7 +115,7 @@
|
|||
await this.getList()
|
||||
},
|
||||
async onLoad(options) {
|
||||
if (options.type) {
|
||||
if(options.type){
|
||||
this.type = options.type
|
||||
}
|
||||
},
|
||||
|
|
@ -155,25 +151,7 @@
|
|||
// });
|
||||
},
|
||||
goAdd(id, item) {
|
||||
if (this.type == 1) {
|
||||
if ( this.imgVideoList[id] && this.imgVideoList[id].length >= 20) {
|
||||
uni.showToast({
|
||||
title: '最多上传20张图片',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return
|
||||
}
|
||||
} else if (this.type == 2) {
|
||||
if ( this.imgVideoList[id] && this.imgVideoList[id].length >= 10) {
|
||||
uni.showToast({
|
||||
title: '最多上传10张视频',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return
|
||||
}
|
||||
}
|
||||
console.log(11111, id)
|
||||
// 1. 原有逻辑:分类id为空,拦截提示
|
||||
if (!id) {
|
||||
uni.showToast({
|
||||
|
|
@ -208,19 +186,14 @@
|
|||
});
|
||||
},
|
||||
async getList() {
|
||||
try {
|
||||
const res = await request.post("/sj/imgVideo/list", {
|
||||
type: this.type
|
||||
});
|
||||
// 核心修复:保留imgVideoList对象结构,可选链避免属性不存在,默认值确保始终为对象
|
||||
this.imgVideoList = res.data?.list?.[this.type] || {};
|
||||
// 若接口返回格式为res.data.list[this.type]是对应类型的id数据,需调整为:
|
||||
// this.imgVideoList = res.data?.list?.[this.type] || {};
|
||||
} catch (err) {
|
||||
// 网络错误等异常处理,确保imgVideoList始终为对象
|
||||
console.error("获取图片/视频列表失败:", err);
|
||||
this.imgVideoList = {};
|
||||
}
|
||||
await request.post("/sj/imgVideo/list", {
|
||||
type: this.type
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.imgVideoList = res.data.list[this.type]
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="container-card">
|
||||
|
||||
|
||||
<view class="card-content flex-row-center" v-if="type==1">
|
||||
<view class="card-content-page">{{ imgVideoList.length }}/20张</view>
|
||||
<view class="content-default" @click="goAdd(class_type)"
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<view class="container-buttons flex-row-center-center" v-if="isManage">
|
||||
<view class="container-buttons flex-row-center-center" v-if="isManage">
|
||||
<view class="container-buttons-sure2 flex-row-center-center" @click="handleDelete">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -121,15 +121,18 @@
|
|||
async handleDelete() {
|
||||
// 收集选中项的ID
|
||||
let deleteIds = this.selectedItems.map(index => this.imgVideoList[index].id);
|
||||
let auth_ids = this.selectedItems.map(index => this.imgVideoList[index].auth_id).filter(item =>
|
||||
item !== 0);
|
||||
console.log(1111, deleteIds, auth_ids, [1, 6])
|
||||
let auth_ids = this.selectedItems.map(index => this.imgVideoList[index].auth_id).filter(item => item !== 0);
|
||||
console.log(1111,deleteIds,auth_ids,[1,6])
|
||||
try {
|
||||
const res = await request.post("/sj/imgVideo/del", {
|
||||
ids: deleteIds,
|
||||
auth_ids: auth_ids
|
||||
auth_ids:auth_ids
|
||||
});
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'success'
|
||||
});
|
||||
// 重新获取列表
|
||||
await this.getList();
|
||||
// 退出管理模式
|
||||
|
|
@ -150,8 +153,8 @@
|
|||
},
|
||||
goAdd(id, item) {
|
||||
if (this.isManage) return; // 管理模式下禁止跳转
|
||||
if (this.type == 1) {
|
||||
if (this.imgVideoList.length >= 20) {
|
||||
if(this.type==1){
|
||||
if(this.imgVideoList.length>=20){
|
||||
uni.showToast({
|
||||
title: '最多上传20张图片',
|
||||
icon: 'none',
|
||||
|
|
@ -159,8 +162,8 @@
|
|||
});
|
||||
return
|
||||
}
|
||||
} else if (this.type == 2) {
|
||||
if (this.imgVideoList.length >= 10) {
|
||||
}else if(this.type==2){
|
||||
if(this.imgVideoList.length>=10){
|
||||
uni.showToast({
|
||||
title: '最多上传10张视频',
|
||||
icon: 'none',
|
||||
|
|
@ -203,20 +206,14 @@
|
|||
return obj
|
||||
},
|
||||
async getList() {
|
||||
try {
|
||||
const res = await request.post("/sj/imgVideo/list", {
|
||||
type: this.type,
|
||||
class_type: this.class_type
|
||||
});
|
||||
// 核心修复:逐层可选链保护 + 兜底空数组,彻底避免属性访问错误
|
||||
this.imgVideoList = res.code === 200 ?
|
||||
res.data?.list?.[this.type]?.[this.class_type] || [] :
|
||||
[];
|
||||
} catch (err) {
|
||||
// 网络错误、接口报错等所有异常的兜底处理
|
||||
console.error("获取媒体列表失败:", err);
|
||||
this.imgVideoList = [];
|
||||
}
|
||||
await request.post("/sj/imgVideo/list", {
|
||||
type: this.type,
|
||||
class_type: this.class_type
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.imgVideoList = res.data.list[this.type][this.class_type]
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -233,16 +230,16 @@
|
|||
font-style: normal;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
||||
.review {
|
||||
background: rgba(255, 250, 218, 1);
|
||||
border-radius: 20rpx 20rpx 0rpx 0rpx;
|
||||
margin: 20rpx;
|
||||
padding: 20rpx 20rpx 20rpx 20rpx;
|
||||
|
||||
|
||||
.review-title {
|
||||
margin-bottom: 6rpx;
|
||||
|
||||
|
||||
.review-title-text {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
|
|
@ -252,7 +249,7 @@
|
|||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.container-card {
|
||||
|
|
@ -295,8 +292,8 @@
|
|||
.card-content {
|
||||
gap: 14rpx;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.card-content-page {
|
||||
|
||||
.card-content-page{
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
|
|
|
|||
|
|
@ -290,6 +290,16 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 存储权限提示 -->
|
||||
<view class="permission" :class="{ transform: isShowStoragePer }">
|
||||
<view class="per-tit">美融融plus 对储存空间/照片权限申请说明</view>
|
||||
<view class="per-cont">便于您使用该功能上传您的照片/图片/视频以及用于更换头像、发布商品等场景中读取相册和文件内容。</view>
|
||||
</view>
|
||||
<!-- 相机权限提示 -->
|
||||
<view class="permission" :class="{ transform: isShowCameraPer }">
|
||||
<view class="per-tit">美融融plus 对相机拍摄权限申请说明</view>
|
||||
<view class="per-cont">便于您使用该功能上传您的照片/图片/视频以及用于更换头像、发布商品等场景中所需内容。</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -351,6 +361,9 @@ export default {
|
|||
// 识别状态
|
||||
isRecognizing: false,
|
||||
recognizeType: '', // 'idcard_front', 'idcard_back', 'business_license'
|
||||
|
||||
isShowStoragePer: false,
|
||||
isShowCameraPer: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -1206,6 +1219,19 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
showPermissionDialog(title, content) {
|
||||
return new Promise((resolve) => {
|
||||
uni.showModal({
|
||||
title,
|
||||
content,
|
||||
confirmText: '去开启',
|
||||
success(res) {
|
||||
resolve(res.confirm);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 表单验证
|
||||
validateForm() {
|
||||
const validationRules = [
|
||||
|
|
@ -1505,50 +1531,74 @@ export default {
|
|||
// 图片上传方法
|
||||
async chooseImage(type) {
|
||||
if (!this.editable) return;
|
||||
|
||||
try {
|
||||
const systemInfo = uni.getSystemInfoSync()
|
||||
|
||||
if (systemInfo.platform === 'ios') {
|
||||
this.openCamera(type);
|
||||
} else {
|
||||
let xcpermission = '';
|
||||
let xjpermission = '';
|
||||
if (systemInfo.platform === 'ios') {
|
||||
xcpermission = 'photo_library',
|
||||
xjpermission = 'camera'
|
||||
} else {
|
||||
xcpermission = `android.permission.READ_EXTERNAL_STORAGE,android.permission.WRITE_EXTERNAL_STORAGE`
|
||||
xjpermission = 'android.permission.CAMERA'
|
||||
}
|
||||
const xjfirstRequest = !plus.storage.getItem(`perm_${xjpermission}`)
|
||||
const xcfirstRequest = !plus.storage.getItem(`perm_${xcpermission}`)
|
||||
if (xcfirstRequest || xjfirstRequest) {
|
||||
this.isShowPer = true;
|
||||
}
|
||||
|
||||
const xc = await permissionUtils.checkPermission('photo_library', '需要相册权限用于上传照片');
|
||||
const xj = await permissionUtils.checkPermission('camera', '需要相机权限用于拍摄照片');
|
||||
if (xc.granted && xj.granted) {
|
||||
this.openCamera(type);
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const isIOS = systemInfo.platform === 'ios';
|
||||
|
||||
// 弹出操作菜单
|
||||
const res = await new Promise((resolve, reject) => {
|
||||
uni.showActionSheet({
|
||||
itemList: ['拍照', '从相册选择'],
|
||||
success: resolve,
|
||||
fail: reject
|
||||
});
|
||||
}).catch(() => ({ tapIndex: -1 }));
|
||||
|
||||
if (res.tapIndex === -1) return; // 用户取消
|
||||
|
||||
// 处理拍照
|
||||
if (res.tapIndex === 0) {
|
||||
if (isIOS) {
|
||||
// iOS 直接调用相机(系统自动处理权限)
|
||||
this._openCamera(type, ['camera']);
|
||||
} else {
|
||||
this.isShowCameraPer = true;
|
||||
const { granted } = await permissionUtils.checkPermission('camera', '需要相机权限以拍照');
|
||||
if (granted) {
|
||||
this.isShowCameraPer = false;
|
||||
this._openCamera(type, ['camera']);
|
||||
return;
|
||||
}
|
||||
this.isShowCameraPer = false;
|
||||
const confirm = await this.showPermissionDialog('相机权限申请', '我们需要访问您的相机权限,以便您拍照上传资质照片');
|
||||
if (!confirm) return;
|
||||
|
||||
const result1 = await permissionUtils.requestPermission('photo_library', '我们需要访问您的相册以上传图片/视频');
|
||||
const result2 = await permissionUtils.requestPermission('camera', '我们需要访问您的相机以上传图片/视频');
|
||||
if (result1 && result2) {
|
||||
this.openCamera(type);
|
||||
const result = await permissionUtils.requestPermission('camera', '需要相机权限以拍照');
|
||||
if (result) {
|
||||
this._openCamera(type, ['camera']);
|
||||
} else {
|
||||
locationService.openAppSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
// 处理从相册选择
|
||||
else if (res.tapIndex === 1) {
|
||||
if (isIOS) {
|
||||
this._openCamera(type, ['album']);
|
||||
} else {
|
||||
this.isShowStoragePer = true;
|
||||
const { granted } = await permissionUtils.checkPermission('photo_library', '需要存储权限以选择照片');
|
||||
if (granted) {
|
||||
this.isShowStoragePer = false;
|
||||
this._openCamera(type, ['album']);
|
||||
return;
|
||||
}
|
||||
this.isShowStoragePer = false;
|
||||
const confirm = await this.showPermissionDialog('存储权限申请', '我们需要访问您的相册权限,以便您上传资质照片');
|
||||
if (!confirm) return;
|
||||
|
||||
const result = await permissionUtils.requestPermission('photo_library', '需要存储权限以选择照片');
|
||||
if (result) {
|
||||
this._openCamera(type, ['album']);
|
||||
} else {
|
||||
locationService.openAppSettings();
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.log('选择图片出错:', err);
|
||||
this.openCamera(type);
|
||||
}
|
||||
},
|
||||
|
||||
async openCamera(type) {
|
||||
// 实际打开相机/相册并上传
|
||||
async _openCamera(type, sourceType) {
|
||||
try {
|
||||
if (!this.userId) {
|
||||
console.log('重新获取用户信息...');
|
||||
|
|
@ -1559,7 +1609,7 @@ export default {
|
|||
uni.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ['compressed'],
|
||||
sourceType: ['album', 'camera'],
|
||||
sourceType: sourceType, // 使用传入的 sourceType
|
||||
success: resolve,
|
||||
fail: reject
|
||||
});
|
||||
|
|
@ -1571,13 +1621,9 @@ export default {
|
|||
}
|
||||
|
||||
const tempFilePath = chooseResult.tempFilePaths[0];
|
||||
|
||||
const file = {
|
||||
path: tempFilePath,
|
||||
size: 0
|
||||
};
|
||||
const file = { path: tempFilePath, size: 0 };
|
||||
|
||||
console.log('openCamera - 开始上传图片,字段类型:', type, '用户ID:', this.userId);
|
||||
console.log('_openCamera - 开始上传图片,字段类型:', type, '用户ID:', this.userId);
|
||||
|
||||
const result = await this.directUpload(file, this.userId, 3, type);
|
||||
|
||||
|
|
@ -2359,4 +2405,10 @@ export default {
|
|||
.tip-btn .btn-text {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.permission.transform {
|
||||
top: calc(var(--status-bar-height) + 88rpx + 20rpx);
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,170 @@
|
|||
<template>
|
||||
<view class="set-page">
|
||||
<view class="home-navbar">
|
||||
<custom-navbar
|
||||
title="营业设置"
|
||||
:show-back="true"
|
||||
title-color="#333333"
|
||||
:backgroundColor="'#FFFFFF'"
|
||||
></custom-navbar>
|
||||
</view>
|
||||
<view class="set_item">
|
||||
<view class="set_item_left" @click="goMoreSetting">
|
||||
<image
|
||||
class="set_item_left_logo"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/5c3fbe37-924a-476e-b266-f3c5b1eb9692.png"
|
||||
/>
|
||||
<text class="text" >营业设置</text>
|
||||
<!-- <image
|
||||
class="set_item_left_right"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/675f97c8-93d2-440a-8d1e-e91279f13465.png"
|
||||
/> -->
|
||||
</view>
|
||||
<view class="set_item_right" @click="changeOrderTaking">
|
||||
<view
|
||||
class="btn_change btn_change_yes"
|
||||
v-if="userInfo.order_taking == 1"
|
||||
>营业中</view
|
||||
>
|
||||
<view v-else class="btn_change btn_change_no">休息中</view>
|
||||
<view
|
||||
class="btn_change_ball"
|
||||
:style="{ left: userInfo.order_taking == 2 ? '8rpx' : '88rpx' }"
|
||||
></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from "@/utils/request";
|
||||
|
||||
import CustomNavbar from "@/components/custom-navbar/custom-navbar.vue";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isLogin: false,
|
||||
sjId: null,
|
||||
userInfo: {},
|
||||
};
|
||||
},
|
||||
components: {
|
||||
CustomNavbar,
|
||||
},
|
||||
onShow() {},
|
||||
computed: {},
|
||||
onLoad() {
|
||||
this.isLogin = uni.getStorageSync("accessToken") ? true : false;
|
||||
if (this.isLogin) {
|
||||
this.getUserInfo();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
goMoreSetting() {
|
||||
// uni.navigateTo({
|
||||
// url: "/subPackages/artisan/unavailable-time",
|
||||
// });
|
||||
},
|
||||
changeOrderTaking() {
|
||||
let newStatus = this.userInfo.order_taking == 1 ? 2 : 1;
|
||||
request
|
||||
.post("/sj/sjordertaking", {
|
||||
order_taking: newStatus,
|
||||
sjid: this.sjId,
|
||||
})
|
||||
.then((res) => {
|
||||
this.userInfo.order_taking = newStatus;
|
||||
this.getUserInfo();
|
||||
});
|
||||
},
|
||||
getUserInfo() {
|
||||
request.post("/sj/user/getUser").then((result) => {
|
||||
this.userInfo = result.data;
|
||||
//存储用户id
|
||||
uni.setStorageSync("sjId", result.data.id);
|
||||
this.sjId = result.data.id;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
// background: linear-gradient(to bottom, #fafafa, #ffffff);
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.set_item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 15rpx 20rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
margin: 40rpx 20rpx 0;
|
||||
|
||||
.set_item_left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14rpx;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
.set_item_left_logo {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
.set_item_left_right {
|
||||
width: 9rpx;
|
||||
height: 16rpx;
|
||||
}
|
||||
}
|
||||
.set_item_right {
|
||||
position: relative;
|
||||
width: 134rpx;
|
||||
height: 50rpx;
|
||||
overflow: hidden;
|
||||
.btn_change {
|
||||
position: absolute;
|
||||
box-sizing: border-box;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 134rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
border-radius: 30rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
&.btn_change_yes {
|
||||
box-sizing: border-box;
|
||||
background: #e8101e;
|
||||
color: #ffffff;
|
||||
text-align: left;
|
||||
padding-left: 15rpx;
|
||||
z-index: 10;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
&.btn_change_no {
|
||||
box-sizing: border-box;
|
||||
background: #cecfd5;
|
||||
color: #ffffff;
|
||||
text-align: right;
|
||||
padding-right: 15rpx;
|
||||
}
|
||||
}
|
||||
.btn_change_ball {
|
||||
position: absolute;
|
||||
top: 6rpx;
|
||||
width: 38rpx;
|
||||
height: 38rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0rpx 2rpx 4rpx rgba(0, 0, 0, 0.1);
|
||||
transition: all 0.3s ease;
|
||||
z-index: 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue