Compare commits
No commits in common. "f1d1f5cc5c16fc76ce7c2a586b704f9ca236018d" and "18bdb4d4d52362ee8812a5618e7ae04e1d809bbf" have entirely different histories.
f1d1f5cc5c
...
18bdb4d4d5
@ -1,325 +1,325 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="chat" :style="{height:fn+'px'}">
|
<div class="chat" :style="{height:fn+'px'}">
|
||||||
<div :style="{height:'100%'}" :class="['tui-chat', !isPC && 'tui-chat-h5']">
|
<div :style="{height:'100%'}" :class="['tui-chat', !isPC && 'tui-chat-h5']">
|
||||||
<div
|
<div
|
||||||
v-if="!currentConversationID"
|
v-if="!currentConversationID"
|
||||||
:class="['tui-chat-default', !isPC && 'tui-chat-h5-default']"
|
:class="['tui-chat-default', !isPC && 'tui-chat-h5-default']"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="currentConversationID"
|
v-if="currentConversationID"
|
||||||
:class="['tui-chat', !isPC && 'tui-chat-h5']"
|
:class="['tui-chat', !isPC && 'tui-chat-h5']"
|
||||||
>
|
>
|
||||||
<ChatHeader
|
<ChatHeader
|
||||||
:class="[
|
:class="[
|
||||||
'tui-chat-header',
|
'tui-chat-header',
|
||||||
!isPC && 'tui-chat-H5-header',
|
!isPC && 'tui-chat-H5-header',
|
||||||
isUniFrameWork && 'tui-chat-uniapp-header',
|
isUniFrameWork && 'tui-chat-uniapp-header',
|
||||||
]"
|
]"
|
||||||
:isGroup="isGroup"
|
:isGroup="isGroup"
|
||||||
:headerExtensionList="headerExtensionList"
|
:headerExtensionList="headerExtensionList"
|
||||||
@closeChat="closeChat"
|
@closeChat="closeChat"
|
||||||
@openGroupManagement="handleGroup"
|
@openGroupManagement="handleGroup"
|
||||||
/>
|
/>
|
||||||
<Forward @toggleMultipleSelectMode="toggleMultipleSelectMode" />
|
<Forward @toggleMultipleSelectMode="toggleMultipleSelectMode" />
|
||||||
<MessageList
|
<MessageList
|
||||||
ref="messageListRef"
|
ref="messageListRef"
|
||||||
:class="['tui-chat-message-list', !isPC && 'tui-chat-h5-message-list']"
|
:class="['tui-chat-message-list', !isPC && 'tui-chat-h5-message-list']"
|
||||||
:isGroup="isGroup"
|
:isGroup="isGroup"
|
||||||
:groupID="groupID"
|
:groupID="groupID"
|
||||||
:isNotInGroup="isNotInGroup"
|
:isNotInGroup="isNotInGroup"
|
||||||
:isMultipleSelectMode="isMultipleSelectMode"
|
:isMultipleSelectMode="isMultipleSelectMode"
|
||||||
@handleEditor="handleEditor"
|
@handleEditor="handleEditor"
|
||||||
@closeInputToolBar="() => changeToolbarDisplayType('none')"
|
@closeInputToolBar="() => changeToolbarDisplayType('none')"
|
||||||
@toggleMultipleSelectMode="toggleMultipleSelectMode"
|
@toggleMultipleSelectMode="toggleMultipleSelectMode"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
v-if="isNotInGroup"
|
v-if="isNotInGroup"
|
||||||
:class="{
|
:class="{
|
||||||
'tui-chat-leave-group': true,
|
'tui-chat-leave-group': true,
|
||||||
'tui-chat-leave-group-mobile': isMobile,
|
'tui-chat-leave-group-mobile': isMobile,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
{{ leaveGroupReasonText }}
|
{{ leaveGroupReasonText }}
|
||||||
</div>
|
</div>
|
||||||
<MultipleSelectPanel
|
<MultipleSelectPanel
|
||||||
v-else-if="isMultipleSelectMode"
|
v-else-if="isMultipleSelectMode"
|
||||||
@oneByOneForwardMessage="oneByOneForwardMessage"
|
@oneByOneForwardMessage="oneByOneForwardMessage"
|
||||||
@mergeForwardMessage="mergeForwardMessage"
|
@mergeForwardMessage="mergeForwardMessage"
|
||||||
@toggleMultipleSelectMode="toggleMultipleSelectMode"
|
@toggleMultipleSelectMode="toggleMultipleSelectMode"
|
||||||
/>
|
/>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<MessageInputToolbar
|
<MessageInputToolbar
|
||||||
v-if="isInputToolbarShow"
|
v-if="isInputToolbarShow"
|
||||||
:class="[
|
:class="[
|
||||||
'tui-chat-message-input-toolbar',
|
'tui-chat-message-input-toolbar',
|
||||||
!isPC && 'tui-chat-h5-message-input-toolbar',
|
!isPC && 'tui-chat-h5-message-input-toolbar',
|
||||||
isUniFrameWork && 'tui-chat-uni-message-input-toolbar'
|
isUniFrameWork && 'tui-chat-uni-message-input-toolbar'
|
||||||
]"
|
]"
|
||||||
:displayType="inputToolbarDisplayType"
|
:displayType="inputToolbarDisplayType"
|
||||||
@insertEmoji="insertEmoji"
|
@insertEmoji="insertEmoji"
|
||||||
@changeToolbarDisplayType="changeToolbarDisplayType"
|
@changeToolbarDisplayType="changeToolbarDisplayType"
|
||||||
@scrollToLatestMessage="scrollToLatestMessage"
|
@scrollToLatestMessage="scrollToLatestMessage"
|
||||||
/>
|
/>
|
||||||
<MessageInput
|
<MessageInput
|
||||||
ref="messageInputRef"
|
ref="messageInputRef"
|
||||||
:class="[
|
:class="[
|
||||||
'tui-chat-message-input',
|
'tui-chat-message-input',
|
||||||
!isPC && 'tui-chat-h5-message-input',
|
!isPC && 'tui-chat-h5-message-input',
|
||||||
isUniFrameWork && 'tui-chat-uni-message-input',
|
isUniFrameWork && 'tui-chat-uni-message-input',
|
||||||
isWeChat && 'tui-chat-wx-message-input',
|
isWeChat && 'tui-chat-wx-message-input',
|
||||||
]"
|
]"
|
||||||
:enableAt="featureConfig.InputMention"
|
:enableAt="featureConfig.InputMention"
|
||||||
:isMuted="false"
|
:isMuted="false"
|
||||||
:muteText="TUITranslateService.t('TUIChat.您已被管理员禁言')"
|
:muteText="TUITranslateService.t('TUIChat.您已被管理员禁言')"
|
||||||
:placeholder="TUITranslateService.t('TUIChat.请输入消息')"
|
:placeholder="TUITranslateService.t('TUIChat.请输入消息')"
|
||||||
:inputToolbarDisplayType="inputToolbarDisplayType"
|
:inputToolbarDisplayType="inputToolbarDisplayType"
|
||||||
@changeToolbarDisplayType="changeToolbarDisplayType"
|
@changeToolbarDisplayType="changeToolbarDisplayType"
|
||||||
|
|
||||||
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<!-- Group Management -->
|
<!-- Group Management -->
|
||||||
<div
|
<div
|
||||||
v-if="!isNotInGroup && !isApp && isUniFrameWork && isGroup && headerExtensionList.length > 0"
|
v-if="!isNotInGroup && !isApp && isUniFrameWork && isGroup && headerExtensionList.length > 0"
|
||||||
class="group-profile"
|
class="group-profile"
|
||||||
@click="handleGroup"
|
@click="handleGroup"
|
||||||
>
|
>
|
||||||
{{ headerExtensionList[0].text }}
|
{{ headerExtensionList[0].text }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, onMounted, onUnmounted, computed } from '../../adapter-vue';
|
import { ref, onMounted, onUnmounted, computed } from '../../adapter-vue';
|
||||||
import TUIChatEngine, {
|
import TUIChatEngine, {
|
||||||
TUITranslateService,
|
TUITranslateService,
|
||||||
TUIConversationService,
|
TUIConversationService,
|
||||||
TUIStore,
|
TUIStore,
|
||||||
StoreName,
|
StoreName,
|
||||||
IMessageModel,
|
IMessageModel,
|
||||||
IConversationModel,
|
IConversationModel,
|
||||||
} from '@tencentcloud/chat-uikit-engine';
|
} from '@tencentcloud/chat-uikit-engine';
|
||||||
import TUICore, { TUIConstants, ExtensionInfo } from '@tencentcloud/tui-core';
|
import TUICore, { TUIConstants, ExtensionInfo } from '@tencentcloud/tui-core';
|
||||||
import ChatHeader from './chat-header/index.vue';
|
import ChatHeader from './chat-header/index.vue';
|
||||||
import MessageList from './message-list/index.vue';
|
import MessageList from './message-list/index.vue';
|
||||||
import MessageInput from './message-input/index.vue';
|
import MessageInput from './message-input/index.vue';
|
||||||
import MultipleSelectPanel from './mulitple-select-panel/index.vue';
|
import MultipleSelectPanel from './mulitple-select-panel/index.vue';
|
||||||
import Forward from './forward/index.vue';
|
import Forward from './forward/index.vue';
|
||||||
import MessageInputToolbar from './message-input-toolbar/index.vue';
|
import MessageInputToolbar from './message-input-toolbar/index.vue';
|
||||||
import { isPC, isWeChat, isUniFrameWork, isMobile, isApp } from '../../utils/env';
|
import { isPC, isWeChat, isUniFrameWork, isMobile, isApp } from '../../utils/env';
|
||||||
import { ToolbarDisplayType } from '../../interface';
|
import { ToolbarDisplayType } from '../../interface';
|
||||||
import TUIChatConfig from './config';
|
import TUIChatConfig from './config';
|
||||||
// @Start uniapp use Chat only
|
// @Start uniapp use Chat only
|
||||||
import { onLoad, onUnload,onNavigationBarButtonTap } from '@dcloudio/uni-app';
|
import { onLoad, onUnload,onNavigationBarButtonTap } from '@dcloudio/uni-app';
|
||||||
import { initChat, logout } from './entry-chat-only.ts';
|
import { initChat, logout } from './entry-chat-only.ts';
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
console.dir(options)
|
console.dir(options)
|
||||||
initChat(options);
|
initChat(options);
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnload(() => {
|
onUnload(() => {
|
||||||
// Whether logout is decided by yourself when the page is unloaded. The default is false.
|
// Whether logout is decided by yourself when the page is unloaded. The default is false.
|
||||||
logout(false).then(() => {
|
logout(false).then(() => {
|
||||||
// Handle success result from promise.then when you set true.
|
// Handle success result from promise.then when you set true.
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
// handle error
|
// handle error
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
// @End uniapp use Chat only
|
// @End uniapp use Chat only
|
||||||
|
|
||||||
const emits = defineEmits(['closeChat']);
|
const emits = defineEmits(['closeChat']);
|
||||||
const fn = uni.getSystemInfoSync().windowHeight
|
const fn = uni.getSystemInfoSync().windowHeight
|
||||||
const groupID = ref(undefined);
|
const groupID = ref(undefined);
|
||||||
const isGroup = ref(false);
|
const isGroup = ref(false);
|
||||||
const isNotInGroup = ref(false);
|
const isNotInGroup = ref(false);
|
||||||
const notInGroupReason = ref<number>();
|
const notInGroupReason = ref<number>();
|
||||||
const currentConversationID = ref("");
|
const currentConversationID = ref("");
|
||||||
const isMultipleSelectMode = ref(false);
|
const isMultipleSelectMode = ref(false);
|
||||||
const inputToolbarDisplayType = ref<ToolbarDisplayType>('none');
|
const inputToolbarDisplayType = ref<ToolbarDisplayType>('none');
|
||||||
const messageInputRef = ref();
|
const messageInputRef = ref();
|
||||||
const messageListRef = ref<InstanceType<typeof MessageList>>();
|
const messageListRef = ref<InstanceType<typeof MessageList>>();
|
||||||
const headerExtensionList = ref<ExtensionInfo[]>([]);
|
const headerExtensionList = ref<ExtensionInfo[]>([]);
|
||||||
const featureConfig = TUIChatConfig.getFeatureConfig();
|
const featureConfig = TUIChatConfig.getFeatureConfig();
|
||||||
|
|
||||||
onNavigationBarButtonTap((e) => {
|
onNavigationBarButtonTap((e) => {
|
||||||
if (isGroup.value) {
|
if (isGroup.value) {
|
||||||
handleGroup();
|
handleGroup();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
TUIStore.watch(StoreName.CONV, {
|
TUIStore.watch(StoreName.CONV, {
|
||||||
currentConversation: onCurrentConversationUpdate,
|
currentConversation: onCurrentConversationUpdate,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
TUIStore.unwatch(StoreName.CONV, {
|
TUIStore.unwatch(StoreName.CONV, {
|
||||||
currentConversation: onCurrentConversationUpdate,
|
currentConversation: onCurrentConversationUpdate,
|
||||||
});
|
});
|
||||||
reset();
|
reset();
|
||||||
});
|
});
|
||||||
|
|
||||||
const isInputToolbarShow = computed<boolean>(() => {
|
const isInputToolbarShow = computed<boolean>(() => {
|
||||||
return isUniFrameWork ? inputToolbarDisplayType.value !== 'none' : true;
|
return isUniFrameWork ? inputToolbarDisplayType.value !== 'none' : true;
|
||||||
});
|
});
|
||||||
|
|
||||||
const leaveGroupReasonText = computed<string>(() => {
|
const leaveGroupReasonText = computed<string>(() => {
|
||||||
let text = '';
|
let text = '';
|
||||||
switch (notInGroupReason.value) {
|
switch (notInGroupReason.value) {
|
||||||
case 4:
|
case 4:
|
||||||
text = TUITranslateService.t('TUIChat.您已被管理员移出群聊');
|
text = TUITranslateService.t('TUIChat.您已被管理员移出群聊');
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
text = TUITranslateService.t('TUIChat.该群聊已被解散');
|
text = TUITranslateService.t('TUIChat.该群聊已被解散');
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
text = TUITranslateService.t('TUIChat.您已退出该群聊');
|
text = TUITranslateService.t('TUIChat.您已退出该群聊');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
text = TUITranslateService.t('TUIChat.您已退出该群聊');
|
text = TUITranslateService.t('TUIChat.您已退出该群聊');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
});
|
});
|
||||||
|
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
TUIConversationService.switchConversation('');
|
TUIConversationService.switchConversation('');
|
||||||
};
|
};
|
||||||
|
|
||||||
const closeChat = (conversationID: string) => {
|
const closeChat = (conversationID: string) => {
|
||||||
emits('closeChat', conversationID);
|
emits('closeChat', conversationID);
|
||||||
reset();
|
reset();
|
||||||
};
|
};
|
||||||
|
|
||||||
const insertEmoji = (emojiObj: object) => {
|
const insertEmoji = (emojiObj: object) => {
|
||||||
messageInputRef.value?.insertEmoji(emojiObj);
|
messageInputRef.value?.insertEmoji(emojiObj);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleEditor = (message: IMessageModel, type: string) => {
|
const handleEditor = (message: IMessageModel, type: string) => {
|
||||||
if (!message || !type) return;
|
if (!message || !type) return;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'reference':
|
case 'reference':
|
||||||
// todo
|
// todo
|
||||||
break;
|
break;
|
||||||
case 'reply':
|
case 'reply':
|
||||||
// todo
|
// todo
|
||||||
break;
|
break;
|
||||||
case 'reedit':
|
case 'reedit':
|
||||||
if (message?.payload?.text) {
|
if (message?.payload?.text) {
|
||||||
messageInputRef?.value?.reEdit(message?.payload?.text);
|
messageInputRef?.value?.reEdit(message?.payload?.text);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleGroup = () => {
|
const handleGroup = () => {
|
||||||
headerExtensionList.value[0].listener.onClicked({ groupID: groupID.value });
|
headerExtensionList.value[0].listener.onClicked({ groupID: groupID.value });
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/TUIKit/components/TUIGroup/index`
|
url: `/TUIKit/components/TUIGroup/index`
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function changeToolbarDisplayType(type: ToolbarDisplayType) {
|
function changeToolbarDisplayType(type: ToolbarDisplayType) {
|
||||||
inputToolbarDisplayType.value = inputToolbarDisplayType.value === type ? 'none' : type;
|
inputToolbarDisplayType.value = inputToolbarDisplayType.value === type ? 'none' : type;
|
||||||
if (inputToolbarDisplayType.value !== 'none' && isUniFrameWork) {
|
if (inputToolbarDisplayType.value !== 'none' && isUniFrameWork) {
|
||||||
uni.$emit('scroll-to-bottom');
|
uni.$emit('scroll-to-bottom');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function scrollToLatestMessage() {
|
function scrollToLatestMessage() {
|
||||||
messageListRef.value?.scrollToLatestMessage();
|
messageListRef.value?.scrollToLatestMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleMultipleSelectMode(visible?: boolean) {
|
function toggleMultipleSelectMode(visible?: boolean) {
|
||||||
isMultipleSelectMode.value = visible === undefined ? !isMultipleSelectMode.value : visible;
|
isMultipleSelectMode.value = visible === undefined ? !isMultipleSelectMode.value : visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
function mergeForwardMessage() {
|
function mergeForwardMessage() {
|
||||||
messageListRef.value?.mergeForwardMessage();
|
messageListRef.value?.mergeForwardMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
function oneByOneForwardMessage() {
|
function oneByOneForwardMessage() {
|
||||||
messageListRef.value?.oneByOneForwardMessage();
|
messageListRef.value?.oneByOneForwardMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateUIUserNotInGroup(conversation: IConversationModel) {
|
function updateUIUserNotInGroup(conversation: IConversationModel) {
|
||||||
if (conversation?.operationType > 0) {
|
if (conversation?.operationType > 0) {
|
||||||
headerExtensionList.value = [];
|
headerExtensionList.value = [];
|
||||||
isNotInGroup.value = true;
|
isNotInGroup.value = true;
|
||||||
/**
|
/**
|
||||||
* 4 - be removed from the group
|
* 4 - be removed from the group
|
||||||
* 5 - group is dismissed
|
* 5 - group is dismissed
|
||||||
* 8 - quit group
|
* 8 - quit group
|
||||||
*/
|
*/
|
||||||
notInGroupReason.value = conversation?.operationType;
|
notInGroupReason.value = conversation?.operationType;
|
||||||
} else {
|
} else {
|
||||||
isNotInGroup.value = false;
|
isNotInGroup.value = false;
|
||||||
notInGroupReason.value = undefined;
|
notInGroupReason.value = undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onCurrentConversationUpdate(conversation: IConversationModel) {
|
function onCurrentConversationUpdate(conversation: IConversationModel) {
|
||||||
updateUIUserNotInGroup(conversation);
|
updateUIUserNotInGroup(conversation);
|
||||||
// return when currentConversation is null
|
// return when currentConversation is null
|
||||||
if (!conversation) {
|
if (!conversation) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// return when currentConversationID.value is the same as conversation.conversationID.
|
// return when currentConversationID.value is the same as conversation.conversationID.
|
||||||
if (currentConversationID.value === conversation?.conversationID) {
|
if (currentConversationID.value === conversation?.conversationID) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
isGroup.value = false;
|
isGroup.value = false;
|
||||||
let conversationType = TUIChatEngine.TYPES.CONV_C2C;
|
let conversationType = TUIChatEngine.TYPES.CONV_C2C;
|
||||||
const conversationID = conversation.conversationID;
|
const conversationID = conversation.conversationID;
|
||||||
if (conversationID.startsWith(TUIChatEngine.TYPES.CONV_GROUP)) {
|
if (conversationID.startsWith(TUIChatEngine.TYPES.CONV_GROUP)) {
|
||||||
conversationType = TUIChatEngine.TYPES.CONV_GROUP;
|
conversationType = TUIChatEngine.TYPES.CONV_GROUP;
|
||||||
isGroup.value = true;
|
isGroup.value = true;
|
||||||
groupID.value = conversationID.replace(TUIChatEngine.TYPES.CONV_GROUP, '');
|
groupID.value = conversationID.replace(TUIChatEngine.TYPES.CONV_GROUP, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
headerExtensionList.value = [];
|
headerExtensionList.value = [];
|
||||||
isMultipleSelectMode.value = false;
|
isMultipleSelectMode.value = false;
|
||||||
// Initialize chatType
|
// Initialize chatType
|
||||||
TUIChatConfig.setChatType(conversationType);
|
TUIChatConfig.setChatType(conversationType);
|
||||||
// While converstaion change success, notify callkit and roomkit、or other components.
|
// While converstaion change success, notify callkit and roomkit、or other components.
|
||||||
TUICore.notifyEvent(TUIConstants.TUIChat.EVENT.CHAT_STATE_CHANGED, TUIConstants.TUIChat.EVENT_SUB_KEY.CHAT_OPENED, { groupID: groupID.value });
|
TUICore.notifyEvent(TUIConstants.TUIChat.EVENT.CHAT_STATE_CHANGED, TUIConstants.TUIChat.EVENT_SUB_KEY.CHAT_OPENED, { groupID: groupID.value });
|
||||||
// The TUICustomerServicePlugin plugin determines if the current conversation is a customer service conversation, then sets chatType and activates the conversation.
|
// The TUICustomerServicePlugin plugin determines if the current conversation is a customer service conversation, then sets chatType and activates the conversation.
|
||||||
TUICore.callService({
|
TUICore.callService({
|
||||||
serviceName: TUIConstants.TUICustomerServicePlugin.SERVICE.NAME,
|
serviceName: TUIConstants.TUICustomerServicePlugin.SERVICE.NAME,
|
||||||
method: TUIConstants.TUICustomerServicePlugin.SERVICE.METHOD.ACTIVE_CONVERSATION,
|
method: TUIConstants.TUICustomerServicePlugin.SERVICE.METHOD.ACTIVE_CONVERSATION,
|
||||||
params: { conversationID: conversationID },
|
params: { conversationID: conversationID },
|
||||||
});
|
});
|
||||||
// When open chat in room, close main chat ui and reset theme.
|
// When open chat in room, close main chat ui and reset theme.
|
||||||
if (TUIChatConfig.getChatType() === TUIConstants.TUIChat.TYPE.ROOM) {
|
if (TUIChatConfig.getChatType() === TUIConstants.TUIChat.TYPE.ROOM) {
|
||||||
if (TUIChatConfig.getFeatureConfig(TUIConstants.TUIChat.FEATURE.InputVoice) === true) {
|
if (TUIChatConfig.getFeatureConfig(TUIConstants.TUIChat.FEATURE.InputVoice) === true) {
|
||||||
TUIChatConfig.setTheme('light');
|
TUIChatConfig.setTheme('light');
|
||||||
currentConversationID.value = '';
|
currentConversationID.value = '';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Get chat header extensions
|
// Get chat header extensions
|
||||||
if (TUIChatConfig.getChatType() === TUIConstants.TUIChat.TYPE.GROUP) {
|
if (TUIChatConfig.getChatType() === TUIConstants.TUIChat.TYPE.GROUP) {
|
||||||
headerExtensionList.value = TUICore.getExtensionList(TUIConstants.TUIChat.EXTENSION.CHAT_HEADER.EXT_ID);
|
headerExtensionList.value = TUICore.getExtensionList(TUIConstants.TUIChat.EXTENSION.CHAT_HEADER.EXT_ID);
|
||||||
}
|
}
|
||||||
TUIStore.update(StoreName.CUSTOM, 'activeConversation', conversationID);
|
TUIStore.update(StoreName.CUSTOM, 'activeConversation', conversationID);
|
||||||
currentConversationID.value = conversationID;
|
currentConversationID.value = conversationID;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss" src="./style/index.scss">
|
<style scoped lang="scss" src="./style/index.scss">
|
||||||
.chat{
|
.chat{
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
height: 100vh !important;
|
height: 100vh !important;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -19,7 +19,7 @@ export function getRegionsById(id = 0) {
|
|||||||
// 获取IM接口前缀
|
// 获取IM接口前缀
|
||||||
export function getIMDetail() {
|
export function getIMDetail() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `${api.common}/common/IM`,
|
url: `${api.common}/IM`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
message: false,
|
message: false,
|
||||||
});
|
});
|
||||||
|
|||||||
52
api/goods.js
@ -118,58 +118,8 @@ export function getCategoryList(id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 达人申请
|
|
||||||
* @param parent_id
|
|
||||||
*/
|
|
||||||
export function getMon(params) {
|
|
||||||
return http.request({
|
|
||||||
url: `/expert/applyExpert`,
|
|
||||||
method: Method.POST,
|
|
||||||
loading: false,
|
|
||||||
data: params,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 申请店铺第一步-填写企业信息
|
|
||||||
export function applyFirst (params) {
|
|
||||||
return http.request({
|
|
||||||
url: '/store/store/apply/first',
|
|
||||||
// needToken: true,
|
|
||||||
method: Method.PUT,
|
|
||||||
params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 申请店铺第一步-填写企业信息
|
|
||||||
export function applySecond (params) {
|
|
||||||
return http.request({
|
|
||||||
url: '/store/store/apply/second',
|
|
||||||
needToken: true,
|
|
||||||
method: Method.PUT,
|
|
||||||
params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 申请店铺第一步-填写企业信息
|
|
||||||
export function applyThird (params) {
|
|
||||||
return http.request({
|
|
||||||
url: '/store/store/apply/third',
|
|
||||||
needToken: true,
|
|
||||||
method: Method.PUT,
|
|
||||||
params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 店铺申请
|
|
||||||
* @param parent_id
|
|
||||||
*/
|
|
||||||
export function getMonapplyStore(params) {
|
|
||||||
return http.request({
|
|
||||||
url: `/expert/store/applyStore`,
|
|
||||||
method: Method.POST,
|
|
||||||
loading: false,
|
|
||||||
data: params,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前会员的分销商信息 可根据分销商信息查询待提现金额以及冻结金额等信息
|
* 获取当前会员的分销商信息 可根据分销商信息查询待提现金额以及冻结金额等信息
|
||||||
|
|||||||
@ -315,28 +315,6 @@ export function getMemberstate(params) {
|
|||||||
data:params
|
data:params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 获取二维码
|
|
||||||
*/
|
|
||||||
export function geterwei(params) {
|
|
||||||
return http.request({
|
|
||||||
url: "/member/friend/qrcode",
|
|
||||||
method: Method.GET,
|
|
||||||
needToken: true,
|
|
||||||
data:params
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取二维码解析
|
|
||||||
*/
|
|
||||||
export function geterweijki(params) {
|
|
||||||
return http.request({
|
|
||||||
url: "/member/friend/parse-post?qrContent="+encodeURIComponent(params),
|
|
||||||
method: Method.POST,
|
|
||||||
needToken: true,
|
|
||||||
// data:
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 获取站内信删除
|
* 获取站内信删除
|
||||||
*/
|
*/
|
||||||
|
|||||||
24
api/point.js
@ -12,28 +12,8 @@ export function sign() {
|
|||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 获取推荐码
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export function mymon() {
|
|
||||||
return http.request({
|
|
||||||
url: '/share/code/my',
|
|
||||||
method: Method.GET,
|
|
||||||
needToken: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 绑定推荐码
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export function inviteCode(data) {
|
|
||||||
return http.request({
|
|
||||||
url: '/share/code/bind/'+data,
|
|
||||||
method: Method.POST,
|
|
||||||
needToken: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 签到时间获取
|
* 签到时间获取
|
||||||
|
|||||||
15
api/trade.js
@ -58,21 +58,6 @@ export function addToCart(data) {
|
|||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 本地购物车生成订单
|
|
||||||
* @param skuId 产品ID
|
|
||||||
* @param num 产品的购买数量
|
|
||||||
* @param cartType 购物车类型,默认加入购物车
|
|
||||||
*/
|
|
||||||
export function orderaddToCart(data) {
|
|
||||||
return http.request({
|
|
||||||
url: "/order/createWithVerification",
|
|
||||||
method: Method.POST,
|
|
||||||
needToken: true,
|
|
||||||
header: { "content-type": "application/x-www-form-urlencoded" },
|
|
||||||
data,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -18,18 +18,12 @@
|
|||||||
border-radius="20"
|
border-radius="20"
|
||||||
class="uimage"
|
class="uimage"
|
||||||
height="200rpx"
|
height="200rpx"
|
||||||
:src=" selectedSpecImg ? selectedSpecImg : imgfun(goodsDetail.thumbnail)"
|
:src="selectedSpecImg ? selectedSpecImg : goodsDetail.thumbnail"
|
||||||
></u-image>
|
></u-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-skus">
|
<view class="goods-skus">
|
||||||
<!-- 有活动商品价格 -->
|
<!-- 有活动商品价格 -->
|
||||||
<view
|
<view class="goods-price" v-if="goodsDetail.promotionPrice && ((isGroup && buyType === 'PINTUAN') || !isGroup)">
|
||||||
class="goods-price"
|
|
||||||
v-if="
|
|
||||||
goodsDetail.promotionPrice &&
|
|
||||||
((isGroup && buyType === 'PINTUAN') || !isGroup)
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<span v-if="goodsDetail.promotionPrice && !pointDetail">
|
<span v-if="goodsDetail.promotionPrice && !pointDetail">
|
||||||
¥
|
¥
|
||||||
<span class="goods-price-promotionShow goods-price-bigshow">{{
|
<span class="goods-price-promotionShow goods-price-bigshow">{{
|
||||||
@ -84,9 +78,7 @@
|
|||||||
<!-- 正常逻辑 循环出sku -->
|
<!-- 正常逻辑 循环出sku -->
|
||||||
<view
|
<view
|
||||||
v-if="!parentOrder"
|
v-if="!parentOrder"
|
||||||
:class="{
|
:class="{ active: spec_val.value == currentSelceted[specIndex] }"
|
||||||
active: spec_val.value == currentSelceted[specIndex],
|
|
||||||
}"
|
|
||||||
class="skus-view-item"
|
class="skus-view-item"
|
||||||
v-for="(spec_val, spec_index) in spec.values"
|
v-for="(spec_val, spec_index) in spec.values"
|
||||||
:key="spec_index"
|
:key="spec_index"
|
||||||
@ -97,9 +89,7 @@
|
|||||||
<!-- 拼团购买,仅筛选出当前拼团类型商品 -->
|
<!-- 拼团购买,仅筛选出当前拼团类型商品 -->
|
||||||
<view
|
<view
|
||||||
v-if="parentOrder && spec_val.skuId == goodsDetail.id"
|
v-if="parentOrder && spec_val.skuId == goodsDetail.id"
|
||||||
:class="{
|
:class="{ active: spec_val.value == currentSelceted[specIndex] }"
|
||||||
active: spec_val.value == currentSelceted[specIndex],
|
|
||||||
}"
|
|
||||||
class="skus-view-item"
|
class="skus-view-item"
|
||||||
v-for="(spec_val, spec_index) in spec.values"
|
v-for="(spec_val, spec_index) in spec.values"
|
||||||
:key="spec_index"
|
:key="spec_index"
|
||||||
@ -128,17 +118,11 @@
|
|||||||
<view class="btns">
|
<view class="btns">
|
||||||
<view
|
<view
|
||||||
class="box-btn card"
|
class="box-btn card"
|
||||||
v-if="
|
v-if="buyType != 'PINTUAN' && goodsDetail.goodsType != 'VIRTUAL_GOODS'"
|
||||||
buyType != 'PINTUAN' &&
|
|
||||||
goodsDetail.goodsType != 'VIRTUAL_GOODS' &&
|
|
||||||
ste == 1
|
|
||||||
"
|
|
||||||
@click="addToCartOrBuy('cart')"
|
@click="addToCartOrBuy('cart')"
|
||||||
>加入购物车</view
|
>加入购物车</view
|
||||||
>
|
>
|
||||||
<view class="box-btn buy" @click="addToCartOrBuy('buy')"
|
<view class="box-btn buy" @click="addToCartOrBuy('buy')">立即购买</view>
|
||||||
>立即购买</view
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
@ -147,7 +131,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import * as API_trade from "@/api/trade.js";
|
import * as API_trade from "@/api/trade.js";
|
||||||
import setup from "./popup";
|
import setup from "./popup";
|
||||||
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -170,23 +154,17 @@ export default {
|
|||||||
currentSelceted: [],
|
currentSelceted: [],
|
||||||
skuList: "",
|
skuList: "",
|
||||||
isClose: false, //是否可以点击遮罩关闭
|
isClose: false, //是否可以点击遮罩关闭
|
||||||
ste: 0,
|
|
||||||
// 存储备注
|
|
||||||
remarkVal: [],
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
|
||||||
this.ste = uni.getStorageSync("ste");
|
|
||||||
},
|
|
||||||
props: {
|
props: {
|
||||||
buyMask: {
|
buyMask: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
isGroup: {
|
isGroup: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
goodsDetail: {
|
goodsDetail: {
|
||||||
default: "",
|
default: "",
|
||||||
type: null,
|
type: null,
|
||||||
@ -277,14 +255,7 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
* 跳转
|
|
||||||
*/
|
|
||||||
navigateTo(url) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
* 直接购买
|
* 直接购买
|
||||||
*/
|
*/
|
||||||
@ -313,11 +284,11 @@ export default {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const storedSte = uni.getStorageSync("ste");
|
const storedSte = uni.getStorageSync('ste');
|
||||||
let data = {
|
let data = {
|
||||||
skuId: this.goodsDetail.id,
|
skuId: this.goodsDetail.id,
|
||||||
num: this.num,
|
num: this.num,
|
||||||
ste: storedSte,
|
ste:storedSte
|
||||||
};
|
};
|
||||||
|
|
||||||
if (val == "cart") {
|
if (val == "cart") {
|
||||||
@ -341,15 +312,13 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
data.cartType = "BUY_NOW";
|
data.cartType = "BUY_NOW";
|
||||||
}
|
}
|
||||||
//商城填写订单
|
|
||||||
API_trade.addToCart(data).then((res) => {
|
API_trade.addToCart(data).then((res) => {
|
||||||
if (res.data.code == 200) {
|
if (res.data.code == 200) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
|
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
|
||||||
this.addr.id || ""
|
this.addr.id || ""
|
||||||
}&parentOrder=${encodeURIComponent(
|
}&parentOrder=${encodeURIComponent(JSON.stringify(this.parentOrder))}`,
|
||||||
JSON.stringify(this.parentOrder)
|
|
||||||
)}`,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -358,9 +327,9 @@ export default {
|
|||||||
formatSku(list) {
|
formatSku(list) {
|
||||||
// 格式化数据
|
// 格式化数据
|
||||||
let arr = [{}];
|
let arr = [{}];
|
||||||
|
|
||||||
if (!Array.isArray(list)) {
|
if(!Array.isArray(list)){
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
list.forEach((item, index) => {
|
list.forEach((item, index) => {
|
||||||
item.specValues.forEach((spec, specIndex) => {
|
item.specValues.forEach((spec, specIndex) => {
|
||||||
@ -433,13 +402,12 @@ export default {
|
|||||||
@import "./popup.scss";
|
@import "./popup.scss";
|
||||||
|
|
||||||
.buy {
|
.buy {
|
||||||
|
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
|
||||||
background-color: $aider-light-color ;
|
|
||||||
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
|
background-image: linear-gradient(135deg, #f2140c, #f2270c 70%, #f24d0c);
|
||||||
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
<div class="goods-list">
|
<div class="goods-list">
|
||||||
<div @click="handleClick(item)" class="goods-item" v-for="(item, item_index) in goodsList" :key="item_index">
|
<div @click="handleClick(item)" class="goods-item" v-for="(item, item_index) in goodsList" :key="item_index">
|
||||||
<div class="goods-img">
|
<div class="goods-img">
|
||||||
<u-image :src="imgfun(item.content.thumbnail)" mode="aspectFill" height="350rpx" width="100%">
|
<u-image :src="item.content.thumbnail" mode="aspectFill" height="350rpx" width="100%">
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
</u-image>
|
</u-image>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,12 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 遮罩层 -->
|
<!-- 遮罩层 -->
|
||||||
<u-popup
|
<u-popup @close="close" v-model="show" mode="bottom" border-radius="30" height="260rpx">
|
||||||
@close="close"
|
|
||||||
v-model="show"
|
|
||||||
mode="bottom"
|
|
||||||
border-radius="30"
|
|
||||||
height="260rpx"
|
|
||||||
>
|
|
||||||
<view class="share-title">
|
<view class="share-title">
|
||||||
<span>分享至</span>
|
<span>分享至</span>
|
||||||
</view>
|
</view>
|
||||||
@ -19,12 +14,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef APP-PLUS -->
|
<!-- #ifdef APP-PLUS -->
|
||||||
<view
|
<view class="share-item" @click="handleShare(item)" v-for="(item, index) in list" :key="index">
|
||||||
class="share-item"
|
|
||||||
@click="handleShare(item)"
|
|
||||||
v-for="(item, index) in list"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<u-icon :color="item.color" size="80" :name="item.icon"></u-icon>
|
<u-icon :color="item.color" size="80" :name="item.icon"></u-icon>
|
||||||
<view>{{ item.title }}</view>
|
<view>{{ item.title }}</view>
|
||||||
</view>
|
</view>
|
||||||
@ -32,7 +22,7 @@
|
|||||||
<!-- #ifdef H5 -->
|
<!-- #ifdef H5 -->
|
||||||
<view class="share-item" @click="copyLink()">
|
<view class="share-item" @click="copyLink()">
|
||||||
<u-icon color="#b4aee8" size="80" name="share-fill"></u-icon>
|
<u-icon color="#b4aee8" size="80" name="share-fill"></u-icon>
|
||||||
<view>{{ "复制链接" }}</view>
|
<view>{{ '复制链接' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
@ -62,18 +52,12 @@ export default {
|
|||||||
icon: "weixin-circle-fill",
|
icon: "weixin-circle-fill",
|
||||||
type: 1,
|
type: 1,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
color: "#04BE02",
|
|
||||||
title: "消息",
|
|
||||||
icon: "weixin-circle-fill",
|
|
||||||
type: 2,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
// 图片缩略图、 商品名称 、 type(goods,shop,pintuan) 拼团商品分享以及店铺分享
|
// 图片缩略图、 商品名称 、 type(goods,shop,pintuan) 拼团商品分享以及店铺分享
|
||||||
|
|
||||||
props: ["thumbnail", "goodsName", "type", "goodsId", "link","price"],
|
props: ["thumbnail", "goodsName", "type", "goodsId", "link"],
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close() {
|
||||||
this.$emit("close");
|
this.$emit("close");
|
||||||
@ -153,39 +137,6 @@ export default {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (val.type == 2) {
|
|
||||||
// 优化复制逻辑,确保内容存在
|
|
||||||
// props: ["thumbnail", "goodsName", "type", "goodsId", "link","price"],
|
|
||||||
// console.log(this.link,'===')
|
|
||||||
// const mofn=JSON.stringify('名字:'+this.goodsName+',价格:'+this.price+','+this.link)
|
|
||||||
|
|
||||||
const mofn=this.goodsName+','+this.price+','+this.thumbnail.split('?')[0].split('com')[1]+','+this.link.split('?')[1]
|
|
||||||
// const mofn={nage:this.goodsName,price:this.price,img:this.thumbnail.split('?')[0],link:this.link}
|
|
||||||
console.log('===+++',mofn.split(',')[1])
|
|
||||||
console.log('===+++',this.thumbnail)
|
|
||||||
console.log('===+++',mofn.split(',')[3])
|
|
||||||
// uni.setClipboardData({
|
|
||||||
// data: mofn,
|
|
||||||
// success: () => {
|
|
||||||
// uni.showToast({
|
|
||||||
// title: "复制成功",
|
|
||||||
// icon: "none",
|
|
||||||
// });
|
|
||||||
// uni.switchTab({
|
|
||||||
// url: "/pages/tabbar/im/index",
|
|
||||||
// fail: (err) => {
|
|
||||||
// console.error("跳转失败--:", err); // 查看具体错误
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
|
|
||||||
// },
|
|
||||||
// fail: () => {
|
|
||||||
// uni.showToast({
|
|
||||||
// title: "不支持",
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
@ -224,4 +175,4 @@ button:after {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -6,18 +6,20 @@
|
|||||||
const dev = {
|
const dev = {
|
||||||
// common: "https://common-api.pickmall.cn",
|
// common: "https://common-api.pickmall.cn",
|
||||||
// buyer: "https://buyer-api.pickmall.cn",
|
// buyer: "https://buyer-api.pickmall.cn",
|
||||||
common: "http://192.168.1.211:8890",
|
|
||||||
buyer: "http://192.168.1.211:8888",
|
common: "http://192.168.1.113:8890",
|
||||||
vlog: "http://192.168.1.211:8099",
|
buyer: "http://192.168.1.113:8888",
|
||||||
web: "http://192.168.1.211:8099",
|
vlog: "http://192.168.1.86:8099",
|
||||||
|
web: "http://192.168.1.113:8099",
|
||||||
|
|
||||||
};
|
};
|
||||||
// 生产环境
|
// 生产环境
|
||||||
const prod = {
|
const prod = {
|
||||||
// common: "https://common-api.pickmall.cn",
|
// common: "https://common-api.pickmall.cn",
|
||||||
// buyer: "https://buyer-api.pickmall.cn",
|
// buyer: "https://buyer-api.pickmall.cn",
|
||||||
common: "http://192.168.1.211:8890",
|
common: "http://192.168.1.113:8890",
|
||||||
buyer: "http://192.168.1.211:8888",
|
buyer: "http://192.168.1.113:8888",
|
||||||
vlog: "http://192.168.1.211:8099",
|
vlog: "http://192.168.1.86:8099",
|
||||||
};
|
};
|
||||||
|
|
||||||
//默认生产环境
|
//默认生产环境
|
||||||
|
|||||||
@ -12,6 +12,5 @@ export default {
|
|||||||
iosAppId:"id1564638363", //AppStore的应用地址id 具体在分享->拷贝链接中查看
|
iosAppId:"id1564638363", //AppStore的应用地址id 具体在分享->拷贝链接中查看
|
||||||
logo:"https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png", //logo地址
|
logo:"https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png", //logo地址
|
||||||
customerServiceMobile:"13161366885", //客服电话
|
customerServiceMobile:"13161366885", //客服电话
|
||||||
customerServiceEmail:"lili@lili.com", //客服邮箱
|
customerServiceEmail:"lili@lili.com" //客服邮箱
|
||||||
img:'https://wzjbucket.oss-rg-china-mainland.aliyuncs.com', //图片地址,聊天分享的图片地址
|
|
||||||
};
|
};
|
||||||
|
|||||||
5
main.js
@ -51,8 +51,3 @@ const app = new Vue({
|
|||||||
...App,
|
...App,
|
||||||
});
|
});
|
||||||
app.$mount();
|
app.$mount();
|
||||||
|
|
||||||
// 全局方法 imgfun
|
|
||||||
Vue.prototype.imgfun = function(val) {
|
|
||||||
return val.split("?")[0];
|
|
||||||
};
|
|
||||||
|
|||||||
70
pages.json
@ -20,8 +20,7 @@
|
|||||||
"navigationBarTitleText": "商城",
|
"navigationBarTitleText": "商城",
|
||||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||||
"navigationBarTextStyle": "black",
|
"navigationBarTextStyle": "black",
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true
|
||||||
"onReachBottomDistance": 50
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -567,54 +566,7 @@
|
|||||||
{
|
{
|
||||||
"root": "pages/mine",
|
"root": "pages/mine",
|
||||||
"pages": [
|
"pages": [
|
||||||
{
|
|
||||||
"path": "mydistribution/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "我的分销"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "makeMoney/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "赚钱"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "invite",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "我的推荐"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "inviteinput",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "输入邀请码"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "expert/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "达人申请"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "openShop/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "店铺申请"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "openShop/secon",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "店铺申请"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "openShop/ThirdApply",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "店铺申请"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "signIn",
|
"path": "signIn",
|
||||||
"style": {
|
"style": {
|
||||||
@ -914,24 +866,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "vengoods",
|
|
||||||
"style": {
|
|
||||||
"backgroundColor": "#fff",
|
|
||||||
"navigationStyle": "custom",
|
|
||||||
"app-plus": {
|
|
||||||
// 将回弹属性关掉
|
|
||||||
"bounce": "none",
|
|
||||||
// 禁止页面滚动
|
|
||||||
"scrollIndicator": "none",
|
|
||||||
"safearea": {
|
|
||||||
"bottom": {
|
|
||||||
"offset": "none"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "askList",
|
"path": "askList",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
@ -149,6 +149,7 @@
|
|||||||
parms.sn = this.sn;
|
parms.sn = this.sn;
|
||||||
parms.orderType = this.orderType;
|
parms.orderType = this.orderType;
|
||||||
parms.clientType = this.paymentType;
|
parms.clientType = this.paymentType;
|
||||||
|
|
||||||
API_Trade.getCashierData(parms).then((res) => {
|
API_Trade.getCashierData(parms).then((res) => {
|
||||||
|
|
||||||
if(res.data.success){
|
if(res.data.success){
|
||||||
|
|||||||
@ -1,333 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view style="padding: 10px">
|
|
||||||
<u-form :model="form" ref="uForm" :rules="rules">
|
|
||||||
<u-form-item label="姓名"
|
|
||||||
><u-input v-model="form.name" placeholder="请输入您真实姓名"
|
|
||||||
/></u-form-item>
|
|
||||||
<u-form-item label="性别">
|
|
||||||
<u-radio-group v-model="form.sex" style="margin-left: 30px">
|
|
||||||
<u-radio
|
|
||||||
v-for="(item, index) in radioList"
|
|
||||||
:key="index"
|
|
||||||
:name="item.value"
|
|
||||||
:value="item.value"
|
|
||||||
:disabled="item.disabled"
|
|
||||||
>
|
|
||||||
{{ item.name }}
|
|
||||||
</u-radio>
|
|
||||||
</u-radio-group>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item label="联系方式"
|
|
||||||
><u-input v-model="form.contact" placeholder="请输入"
|
|
||||||
/></u-form-item>
|
|
||||||
<u-form-item label="店铺地址"
|
|
||||||
><u-input v-model="form.residenceAddress" placeholder="请输入"
|
|
||||||
/></u-form-item>
|
|
||||||
<u-form-item label="营业执照">
|
|
||||||
<u-upload
|
|
||||||
:action="action"
|
|
||||||
:header="{ accessToken: storage.getAccessToken() }"
|
|
||||||
max-count="1"
|
|
||||||
style="margin-left: 30px"
|
|
||||||
@on-uploaded="onUploaded"
|
|
||||||
></u-upload>
|
|
||||||
<!-- <u-input v-model="form.businessLicense" placeholder="请输入"/> -->
|
|
||||||
</u-form-item>
|
|
||||||
|
|
||||||
<u-form-item label="证件类别"
|
|
||||||
><u-input v-model="idType" type="select" @click="show = true" />
|
|
||||||
<u-action-sheet
|
|
||||||
:list="actionSheetList"
|
|
||||||
v-model="show"
|
|
||||||
@click="actionSheetCallback"
|
|
||||||
></u-action-sheet>
|
|
||||||
</u-form-item>
|
|
||||||
|
|
||||||
<u-form-item label="证件照片">
|
|
||||||
<u-upload
|
|
||||||
:header="{ accessToken: storage.getAccessToken() }"
|
|
||||||
max-count="2"
|
|
||||||
:action="action"
|
|
||||||
@on-uploaded="onUploadedtwo"
|
|
||||||
style="margin-left: 30px"
|
|
||||||
></u-upload>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item label="证件有效期" right-icon="arrow-right">
|
|
||||||
<u-input
|
|
||||||
v-model="form.idExpiryDate"
|
|
||||||
placeholder="请输入"
|
|
||||||
@click="showtime = true"
|
|
||||||
/>
|
|
||||||
<u-calendar
|
|
||||||
v-model="showtime"
|
|
||||||
mode="date"
|
|
||||||
@change="changetime"
|
|
||||||
max-date="30000"
|
|
||||||
></u-calendar>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item label="经营范围">
|
|
||||||
<u-checkbox-group
|
|
||||||
@change="checkboxGroupChange"
|
|
||||||
style="margin-left: 30px"
|
|
||||||
>
|
|
||||||
<u-checkbox
|
|
||||||
v-model="item.checked"
|
|
||||||
v-for="(item, index) in cateList"
|
|
||||||
:key="index"
|
|
||||||
:name="item.id"
|
|
||||||
>{{ item.name }}</u-checkbox
|
|
||||||
>
|
|
||||||
</u-checkbox-group>
|
|
||||||
</u-form-item>
|
|
||||||
</u-form>
|
|
||||||
<button @click="consub" :style="{ background: '#FE3C3C' }"
|
|
||||||
class="bunem">提交</button>
|
|
||||||
<u-toast ref="uToast" />
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import storage from "@/utils/storage.js";
|
|
||||||
import { upload } from "@/api/common.js";
|
|
||||||
import { getCategoryList, getMon } from "@/api/goods.js";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
action: upload,
|
|
||||||
storage: storage,
|
|
||||||
form: {
|
|
||||||
name: "",
|
|
||||||
sex: "",
|
|
||||||
contact: "",
|
|
||||||
residenceAddress: "",
|
|
||||||
businessLicense: "",
|
|
||||||
idType: "",
|
|
||||||
idPhoto: [],
|
|
||||||
idExpiryDate: "",
|
|
||||||
businessAddress: "",
|
|
||||||
businessScope: "",
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
name: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "姓名不能为空",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
sex: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "性别不能为空",
|
|
||||||
trigger: "change",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
contact: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "联系方式不能为空",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
residenceAddress: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "居住地址不能为空",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
businessLicense: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "营业执照不能为空",
|
|
||||||
trigger: "change",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
idType: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "证件类别不能为空",
|
|
||||||
trigger: "change",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
idPhoto: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "证件照片不能为空",
|
|
||||||
trigger: "change",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
idExpiryDate: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "证件有效期不能为空",
|
|
||||||
trigger: "change",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
businessAddress: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "经营范围不能为空",
|
|
||||||
trigger: "change",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
idType: "",
|
|
||||||
radioList: [
|
|
||||||
{
|
|
||||||
name: "男",
|
|
||||||
disabled: false,
|
|
||||||
value: "MALE",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "女",
|
|
||||||
disabled: false,
|
|
||||||
value: "FEMALE",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
showtime: false, // 控制u-calendar的显示与隐藏
|
|
||||||
show: false, // 控制actionSheet的显示与隐藏--证件
|
|
||||||
// 证件
|
|
||||||
actionSheetList: [
|
|
||||||
{
|
|
||||||
text: "身份证",
|
|
||||||
value: "ID",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "护照",
|
|
||||||
value: "PASSPORT",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "其他",
|
|
||||||
value: "OTHER",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
radio: "",
|
|
||||||
switchVal: false,
|
|
||||||
cateList: [],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
onLoad() {
|
|
||||||
// 页面加载时可以初始化数据
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
// 页面显示时可以执行一些操作
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.getCategoryList(); // 调用获取分类列表的方法
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
//点击actionSheet回调--证件
|
|
||||||
actionSheetCallback(index) {
|
|
||||||
this.form.idType = this.actionSheetList[index].value;
|
|
||||||
this.idType = this.actionSheetList[index].text;
|
|
||||||
},
|
|
||||||
consub() {
|
|
||||||
const {
|
|
||||||
name,
|
|
||||||
sex,
|
|
||||||
contact,
|
|
||||||
residenceAddress,
|
|
||||||
businessLicense,
|
|
||||||
idType,
|
|
||||||
idPhoto,
|
|
||||||
idExpiryDate,
|
|
||||||
businessAddress,
|
|
||||||
businessScope,
|
|
||||||
} = this.form;
|
|
||||||
if (
|
|
||||||
name == "" ||
|
|
||||||
sex == "" ||
|
|
||||||
contact == "" ||
|
|
||||||
residenceAddress == "" ||
|
|
||||||
businessLicense.length == 0 ||
|
|
||||||
idType == "" ||
|
|
||||||
idPhoto.length == 0 ||
|
|
||||||
idExpiryDate == "" ||
|
|
||||||
businessScope.length == 0
|
|
||||||
) {
|
|
||||||
this.$refs.uToast.show({
|
|
||||||
title: "不能为空",
|
|
||||||
type: "error",
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.form.businessAddress = this.form.residenceAddress;
|
|
||||||
getMon(this.form).then((res) => {
|
|
||||||
if (res.data.code == 200) {
|
|
||||||
this.$refs.uToast.show({
|
|
||||||
title: "提交成功",
|
|
||||||
type: "success",
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.switchTab({
|
|
||||||
url: "/pages/tabbar/user/my",
|
|
||||||
});
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onUploaded(lists) {
|
|
||||||
console.log(lists); // 打印上传成功后的文件列表
|
|
||||||
lists.forEach((item) => {
|
|
||||||
this.form.businessLicense = item.response.result;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
onUploadedtwo(lists) {
|
|
||||||
let images = [];
|
|
||||||
lists.forEach((item) => {
|
|
||||||
images.push(item.response.result);
|
|
||||||
});
|
|
||||||
this.form.idPhoto = images;
|
|
||||||
},
|
|
||||||
changetime(value) {
|
|
||||||
console.log(value); // 打印选择的日期
|
|
||||||
this.form.idExpiryDate = value.result; // 将选择的日期赋值给form.idExpiryDate
|
|
||||||
},
|
|
||||||
// 选中某个复选框时,由checkbox时触发
|
|
||||||
checkboxChange(e) {
|
|
||||||
console.log(e, "[====]");
|
|
||||||
},
|
|
||||||
// 选中任一checkbox时,由checkbox-group触发
|
|
||||||
checkboxGroupChange(e) {
|
|
||||||
this.form.businessScope = e;
|
|
||||||
},
|
|
||||||
|
|
||||||
getCategoryList() {
|
|
||||||
getCategoryList(0).then((res) => {
|
|
||||||
res.data.result.forEach((item) => {
|
|
||||||
item.checked = false; // 初始化每个项目的checked属性为false
|
|
||||||
});
|
|
||||||
this.cateList = res.data.result;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
::v-deep {
|
|
||||||
.u-form-item--left__content {
|
|
||||||
width: 100px;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.u-input {
|
|
||||||
margin-left: 30px; // 可根据实际情况调整这个值
|
|
||||||
}
|
|
||||||
.u-checkbox__icon-wrap--checked{
|
|
||||||
border-color: #fe3c3c !important;
|
|
||||||
background-color: #fe3c3c !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.bunem {
|
|
||||||
width: 309px;
|
|
||||||
margin-top: 20px;
|
|
||||||
height: 41px;
|
|
||||||
font-size: 15px;
|
|
||||||
line-height: 41px;
|
|
||||||
text-align: center;
|
|
||||||
color: #ffffff;
|
|
||||||
margin-bottom: 35px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,149 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="sigin">
|
|
||||||
<div class="tui">
|
|
||||||
<div class="cnent">
|
|
||||||
<!-- <div><img :src="ImageUrl" alt="" width="60" class="round-avatar"></div> -->
|
|
||||||
<div class="tuijianm">
|
|
||||||
<div :style="{ fontsize: '24px' }">您的专属推荐码</div>
|
|
||||||
<div :style="{ marginTop: '10px' }">{{ resfn }}</div>
|
|
||||||
</div>
|
|
||||||
<div class="qian">
|
|
||||||
<h3>奖励说明:</h3>
|
|
||||||
<div>将邀请码分享给他人绑定成功且参与开店获得更多奖励</div>
|
|
||||||
</div>
|
|
||||||
<button class="btn" @click="share">分享</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="bottomc">
|
|
||||||
<!-- <button class="btn">立即推荐</button>
|
|
||||||
<button class="btn">保存海报</button> -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { mymon } from "@/api/point.js";
|
|
||||||
// import { saveImageToPhotosAlbum } from "@/utils/request.js"; // 假设该方法在 request.js 中
|
|
||||||
import config from "@/config/config.js"; // 假设 config.js 中定义了 API 接口地址
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
resfn: "",
|
|
||||||
ImageUrl: "",
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.getmy();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getmy() {
|
|
||||||
mymon().then((res) => {
|
|
||||||
this.resfn = res.data.result.code;
|
|
||||||
// this.ImageUrl= res.data.result.face;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
share() {
|
|
||||||
console.log(config.downloadLink);
|
|
||||||
|
|
||||||
// 这里添加第三方分享逻辑
|
|
||||||
uni.showActionSheet({
|
|
||||||
itemList: ['分享到微信好友', '分享到朋友圈', '分享到QQ', '分享到消息'],
|
|
||||||
success: (res) => {
|
|
||||||
const providerMap = ['weixin', 'weixin', 'qq', 'im'];
|
|
||||||
const sceneMap = ['WXSceneSession', 'WXSceneTimeline', '', ''];
|
|
||||||
// 分享到微信好友、朋友圈或QQ ------------暂定
|
|
||||||
|
|
||||||
if (providerMap[res.tapIndex] === 'im') {
|
|
||||||
uni.setClipboardData({
|
|
||||||
data:`邀请码:${this.resfn}`,
|
|
||||||
success: () => {
|
|
||||||
uni.showToast({
|
|
||||||
title: "复制成功",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
uni.switchTab({
|
|
||||||
url: "/pages/tabbar/im/index",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
fail: () => {
|
|
||||||
uni.showToast({
|
|
||||||
title: "复制失败",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.share({
|
|
||||||
provider: providerMap[res.tapIndex],
|
|
||||||
scene: sceneMap[res.tapIndex],
|
|
||||||
title: '无终街邀请专属码',
|
|
||||||
summary: '输入达人邀请码,获得更多曝光量',
|
|
||||||
imageUrl: '/static/imlogo.png',
|
|
||||||
href:config.downloadLink,
|
|
||||||
success: () => uni.showToast({ title: '分享成功' })
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.sigin {
|
|
||||||
width: 100%;
|
|
||||||
height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
background: url("@/static/abcx.png") no-repeat;
|
|
||||||
background-size: 100% 100%;
|
|
||||||
}
|
|
||||||
.tui {
|
|
||||||
padding: 0px;
|
|
||||||
height: calc(85vh - 65px);
|
|
||||||
width: 80%;
|
|
||||||
margin: 10px;
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
.cnent {
|
|
||||||
height: 80%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.round-avatar {
|
|
||||||
border-radius: 50%;
|
|
||||||
object-fit: cover; /* 确保图片填充整个圆形区域 */
|
|
||||||
width: 60px;
|
|
||||||
height: 60px;
|
|
||||||
}
|
|
||||||
.bottomc {
|
|
||||||
width: 80%;
|
|
||||||
height: 15vh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-around;
|
|
||||||
}
|
|
||||||
.qian {
|
|
||||||
width: 80%;
|
|
||||||
|
|
||||||
margin-top: 50px;
|
|
||||||
}
|
|
||||||
.btn {
|
|
||||||
width: 75%;
|
|
||||||
background: #fe3c3c;
|
|
||||||
margin-top: 56px;
|
|
||||||
}
|
|
||||||
.tuijianm {
|
|
||||||
width: 65%;
|
|
||||||
height: 5.3vh;
|
|
||||||
font-size: 20px;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
padding: 10px;
|
|
||||||
margin-top: 24vh;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,91 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="sigin">
|
|
||||||
<div class="cal">输入邀请码获取特定礼包</div>
|
|
||||||
<div class="si_input">
|
|
||||||
<u-input
|
|
||||||
v-model="inviteCode"
|
|
||||||
type="text"
|
|
||||||
aria-placeholder="
|
|
||||||
请输入推荐码"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="si_bottom">
|
|
||||||
<button class="btn" @click="head">绑定推荐码</button>
|
|
||||||
</div>
|
|
||||||
<u-toast ref="uToast" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { inviteCode } from "@/api/point.js";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
resfn: "",
|
|
||||||
ImageUrl: "",
|
|
||||||
inviteCode: "",
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
// this.getmy();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
head() {
|
|
||||||
if (this.inviteCode == "") {
|
|
||||||
this.$refs.uToast.show({
|
|
||||||
title: "请输入邀请码",
|
|
||||||
type: "error",
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
inviteCode(this.inviteCode).then((res) => {
|
|
||||||
console.log(res);
|
|
||||||
if (res.data.code == 200) {
|
|
||||||
this.$refs.uToast.show({
|
|
||||||
title: "绑定成功",
|
|
||||||
type: "success",
|
|
||||||
});
|
|
||||||
// this.$message.success('');
|
|
||||||
// this.$router.push({ path: "/home" });
|
|
||||||
} else {
|
|
||||||
this.$message.error(res.data.message);
|
|
||||||
this.$refs.uToast.show({
|
|
||||||
title: res.data.message,
|
|
||||||
type: "error",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// return false;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.sigin {
|
|
||||||
width: 100%;
|
|
||||||
height: 25vh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-evenly;
|
|
||||||
}
|
|
||||||
.si_input {
|
|
||||||
width: 70%;
|
|
||||||
margin: 0 auto;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.si_bottom {
|
|
||||||
width: 70%;
|
|
||||||
margin: 0 auto;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.cal {
|
|
||||||
width: 70%;
|
|
||||||
margin: 0 auto;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
.btn {
|
|
||||||
background: #fe3c3c;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
84654
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getPointsData } from "@/api/members.js";
|
|
||||||
import { getMemberPointSum } from "@/api/members.js";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
onLoad() {
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
||||||
@ -16,7 +16,7 @@
|
|||||||
@change="changeChecked(item)"></u-checkbox>
|
@change="changeChecked(item)"></u-checkbox>
|
||||||
</u-checkbox-group>
|
</u-checkbox-group>
|
||||||
<view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
|
<view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
|
||||||
<image :src="imgfun(item.thumbnail)"></image>
|
<image :src="item.thumbnail"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="myTracks-item-content" @click.stop="navgaiteToDetail(item)">
|
<view class="myTracks-item-content" @click.stop="navgaiteToDetail(item)">
|
||||||
<view class="myTracks-item-title">
|
<view class="myTracks-item-title">
|
||||||
|
|||||||
@ -1,269 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="distribution-container">
|
|
||||||
<!-- Header section -->
|
|
||||||
<div class="distribution-header">
|
|
||||||
<div class="total-earnings">
|
|
||||||
<div class="total">
|
|
||||||
<h2 :style="{ fontSize: '15px' }">总收益(元)</h2>
|
|
||||||
<h2 :style="{ fontSize: '15px' }" @click="show = true">
|
|
||||||
<u-icon name="question-circle" color="#fff" size="28"></u-icon>
|
|
||||||
提现规则
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
<p class="amount" :style="{ fontSize: '30px' }">1164</p>
|
|
||||||
</div>
|
|
||||||
<div class="hr"></div>
|
|
||||||
<div class="withdrawable" :style="{ padding: '10px 0px' }">
|
|
||||||
<div class="itox">可提现金额:<span class="amount">94.26元</span></div>
|
|
||||||
<div class="buto" @click="goToDepositPage">提现</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Main content card -->
|
|
||||||
<div class="distribution-card">
|
|
||||||
<!-- Stats grid -->
|
|
||||||
<div class="stats-grid">
|
|
||||||
<h2>当月数据</h2>
|
|
||||||
<div class="stats-row">
|
|
||||||
<div class="stat-item">
|
|
||||||
<div class="stat-value">197</div>
|
|
||||||
<div class="stat-label">我的邀请</div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-item">
|
|
||||||
<div class="stat-value">100.00</div>
|
|
||||||
<div class="stat-label">现金奖励</div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-item">
|
|
||||||
<div class="stat-value">200.00</div>
|
|
||||||
<div class="stat-label">待入账</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- 新增的菜单列表 -->
|
|
||||||
<div class="menu-list">
|
|
||||||
<div class="menu-item" v-for="(item, index) in menuItems" :key="index" @click="touni(item.url)">
|
|
||||||
<div class="menu-text">{{ item.name }}</div>
|
|
||||||
<u-icon name="arrow-right" color="#999" size="16"></u-icon>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Withdrawal Rules Popup -->
|
|
||||||
<u-popup
|
|
||||||
v-model="show"
|
|
||||||
mode="right"
|
|
||||||
border-radius="14"
|
|
||||||
width="500rpx"
|
|
||||||
height="100%"
|
|
||||||
>
|
|
||||||
<view class="rules-popup">
|
|
||||||
<div class="rules-header">
|
|
||||||
<h1>提现规则</h1>
|
|
||||||
</div>
|
|
||||||
<div class="rules-content">
|
|
||||||
<ol class="rules-list">
|
|
||||||
<li class="rule-item">
|
|
||||||
每次可提现10%的现金额度到余额账户,手续费从提现金额里扣除8%。
|
|
||||||
</li>
|
|
||||||
<li class="rule-item">提现后8~7天内到账</li>
|
|
||||||
<li class="rule-item">每个用户同时只能发起1笔提现订单</li>
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
</view>
|
|
||||||
</u-popup>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "MyDistribution",
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
show: false,
|
|
||||||
menuItems: [
|
|
||||||
{name:"我的用户",url:''},
|
|
||||||
{name:"消费记录",url:''},
|
|
||||||
{name:"收益明细",url:''},
|
|
||||||
{name:"提现记录",url:''},
|
|
||||||
{name:"我的邀请码",url:'/pages/mine/invite'},
|
|
||||||
]
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
touni(e){
|
|
||||||
uni.navigateTo({ url:e });
|
|
||||||
},
|
|
||||||
goToDepositPage() {
|
|
||||||
uni.navigateTo({ url: '/pages/mine/deposit/operation' });
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.menu-list {
|
|
||||||
background-color: white;
|
|
||||||
border-radius: 8px;
|
|
||||||
margin: 15px;
|
|
||||||
padding: 0 15px;
|
|
||||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
||||||
|
|
||||||
.menu-item {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 15px 0;
|
|
||||||
border-bottom: 1px solid #f5f5f5;
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-text {
|
|
||||||
font-size: 15px;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.u-icon {
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.hr {
|
|
||||||
width: 100%;
|
|
||||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.distribution-container {
|
|
||||||
font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
|
|
||||||
width: 100%;
|
|
||||||
color: #333;
|
|
||||||
|
|
||||||
.distribution-header {
|
|
||||||
background-color: #ff7d00;
|
|
||||||
color: white;
|
|
||||||
padding: 25px 20px;
|
|
||||||
|
|
||||||
.total-earnings {
|
|
||||||
margin-bottom: 15px;
|
|
||||||
|
|
||||||
.total {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.withdrawable {
|
|
||||||
font-size: 14px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.buto {
|
|
||||||
padding: 4px 12px;
|
|
||||||
border: 1px solid #fff;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.itox {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.amount {
|
|
||||||
color: #fff;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-left: 4px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.distribution-card {
|
|
||||||
background-color: white;
|
|
||||||
border-radius: 8px;
|
|
||||||
margin: -25px 15px 20px;
|
|
||||||
padding: 20px;
|
|
||||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
||||||
position: relative;
|
|
||||||
z-index: 1;
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
font-size: 16px;
|
|
||||||
margin: 0 0 15px 0;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stats-grid {
|
|
||||||
h2 {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stats-row {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
.stat-item {
|
|
||||||
flex: 1;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
.stat-value {
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-label {
|
|
||||||
font-size: 12px;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Withdrawal Rules Popup Styles */
|
|
||||||
.rules-popup {
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
background-color: #ff7d00;
|
|
||||||
.rules-header {
|
|
||||||
color: white;
|
|
||||||
padding: 15px 20px;
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
margin: 0;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.rules-content {
|
|
||||||
background-color: #ff7d00;
|
|
||||||
flex: 1;
|
|
||||||
color: white;
|
|
||||||
padding: 20px;
|
|
||||||
// background-color: #fff;
|
|
||||||
overflow-y: auto;
|
|
||||||
|
|
||||||
.rules-list {
|
|
||||||
padding-left: 20px;
|
|
||||||
margin: 0;
|
|
||||||
|
|
||||||
.rule-item {
|
|
||||||
margin-bottom: 15px;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 1.5;
|
|
||||||
// color: #333;
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,323 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="person-msg">
|
|
||||||
<u-form ref="thirdForm" :model="form" :rules="rules" :label-width="200">
|
|
||||||
<h4>基础信息</h4>
|
|
||||||
<u-form-item prop="storeName" label="店铺名称">
|
|
||||||
<u-input
|
|
||||||
type="text"
|
|
||||||
v-model="form.storeName"
|
|
||||||
placeholder="请填写店铺名称"
|
|
||||||
/>
|
|
||||||
</u-form-item>
|
|
||||||
|
|
||||||
<u-form-item prop="storeLogo" label="店铺logo">
|
|
||||||
<!-- <Upload
|
|
||||||
ref="uploadLogo"
|
|
||||||
:show-upload-list="false"
|
|
||||||
:on-success="handleSuccess"
|
|
||||||
:format="['jpg', 'jpeg', 'png', 'gif']"
|
|
||||||
:max-size="2048"
|
|
||||||
:before-upload="beforeUpload"
|
|
||||||
:on-format-error="handleFormatError"
|
|
||||||
:on-exceeded-size="handleMaxSize"
|
|
||||||
:on-error="uploadErr"
|
|
||||||
multiple
|
|
||||||
:action="action"
|
|
||||||
:headers="accessToken"
|
|
||||||
>
|
|
||||||
<Button type="info" :loading="uploadLoading">上传logo</Button>
|
|
||||||
</Upload> -->
|
|
||||||
|
|
||||||
<u-upload
|
|
||||||
:header="{ accessToken: storage.getAccessToken() }"
|
|
||||||
max-count="1"
|
|
||||||
:action="action"
|
|
||||||
@on-uploaded="onUploadedtwo"
|
|
||||||
style="margin-left: 30px"
|
|
||||||
></u-upload>
|
|
||||||
<div class="describe">请压缩图片在2M以内,格式为gif,jpg,png</div>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item prop="goodsManagementCategory" label="店铺经营类目">
|
|
||||||
<u-checkbox-group
|
|
||||||
@change="checkboxGroupChange"
|
|
||||||
style="margin-left: 30px"
|
|
||||||
>
|
|
||||||
<u-checkbox
|
|
||||||
v-model="item.checked"
|
|
||||||
v-for="(item, index) in cateList"
|
|
||||||
:key="index"
|
|
||||||
:name="item.id"
|
|
||||||
>{{ item.name }}</u-checkbox
|
|
||||||
>
|
|
||||||
</u-checkbox-group>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item prop="storeCenter" label="店铺所在地">
|
|
||||||
<u-input
|
|
||||||
v-model="form.___path"
|
|
||||||
type="select"
|
|
||||||
@click="showPicker"
|
|
||||||
placeholder="请选择所在地区"
|
|
||||||
/>
|
|
||||||
</u-form-item>
|
|
||||||
|
|
||||||
<u-form-item prop="storeAddressDetail" label="店铺详细地址">
|
|
||||||
<u-input
|
|
||||||
type="text"
|
|
||||||
v-model="form.storeAddressDetail"
|
|
||||||
placeholder="请填写店铺详细地址"
|
|
||||||
/>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item prop="storeDesc" label="店铺简介">
|
|
||||||
<u-input
|
|
||||||
type="textarea"
|
|
||||||
v-model="form.storeDesc"
|
|
||||||
maxlength="200"
|
|
||||||
show-word-limit
|
|
||||||
:rows="4"
|
|
||||||
placeholder="请输入店铺简介"
|
|
||||||
/>
|
|
||||||
</u-form-item>
|
|
||||||
|
|
||||||
<u-form-item>
|
|
||||||
<!-- <button @click="uni.navigateBack()" :style="{background:'#F50505'}">返回</button> -->
|
|
||||||
<button
|
|
||||||
type="primary"
|
|
||||||
:style="{ background: '#FE3C3C' }"
|
|
||||||
@click="next"
|
|
||||||
class="bunem"
|
|
||||||
>
|
|
||||||
提交平台审核
|
|
||||||
</button>
|
|
||||||
</u-form-item>
|
|
||||||
</u-form>
|
|
||||||
<!-- <Modal title="View Image" v-model="visible">
|
|
||||||
<img :src="previewPicture" v-if="visible" style="width: 100%" />
|
|
||||||
</Modal> -->
|
|
||||||
<!-- <lili-map ref="liliMap" @getAddress="getAddress" :useApi="false"></lili-map> -->
|
|
||||||
<m-city
|
|
||||||
:provinceData="list"
|
|
||||||
headTitle="区域选择"
|
|
||||||
ref="cityPicker"
|
|
||||||
@funcValue="getpickerParentValue"
|
|
||||||
pickerSize="4"
|
|
||||||
></m-city>
|
|
||||||
<u-toast ref="uToast" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import storage from "@/utils/storage.js";
|
|
||||||
import { upload } from "@/api/common.js";
|
|
||||||
import { applyThird } from "@/api/goods";
|
|
||||||
import gkcity from "@/components/m-city/m-city.vue";
|
|
||||||
import { getCategoryList, getMon } from "@/api/goods.js";
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
"m-city": gkcity,
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
cateList: [],
|
|
||||||
list: [
|
|
||||||
{
|
|
||||||
id: "",
|
|
||||||
localName: "请选择",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
storage: storage,
|
|
||||||
loading: false, // 加载状态
|
|
||||||
uploadLoading: false, // 上传加载状态
|
|
||||||
action: upload, // 上传地址
|
|
||||||
accessToken: {}, // 验证token
|
|
||||||
previewPicture: "", // 预览图片
|
|
||||||
address: "", // 回显地址
|
|
||||||
visible: false, // 图片预览
|
|
||||||
form: {
|
|
||||||
// 表单数据
|
|
||||||
storeLogo: [],
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
// 验证规则
|
|
||||||
goodsManagementCategory: [
|
|
||||||
{ required: true, message: "请选择店铺经营类目" },
|
|
||||||
],
|
|
||||||
storeName: [{ required: true, message: "请填写店铺名称" }],
|
|
||||||
storeLogo: [{ required: true, message: "请上传店铺logo" }],
|
|
||||||
storeDesc: [{ required: true, message: "请填写店铺简介" }],
|
|
||||||
storeCenter: [{ required: true, message: "请选择店铺位置" }],
|
|
||||||
storeAddressIdPath: [{ required: true, message: "请选择店铺位置" }],
|
|
||||||
storeAddressDetail: [{ required: true, message: "请输入店铺详细地址" }],
|
|
||||||
},
|
|
||||||
categoryList: [], // 分类数据
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
checkboxGroupChange(e) {
|
|
||||||
this.form.goodsManagementCategory = e;
|
|
||||||
this.form.goodsManagementCategory =
|
|
||||||
this.form.goodsManagementCategory.join(",");
|
|
||||||
console.log(this.form);
|
|
||||||
},
|
|
||||||
getCategoryList() {
|
|
||||||
getCategoryList(0).then((res) => {
|
|
||||||
res.data.result.forEach((item) => {
|
|
||||||
item.checked = false; // 初始化每个项目的checked属性为false
|
|
||||||
});
|
|
||||||
this.cateList = res.data.result;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
showPicker() {
|
|
||||||
this.$refs.cityPicker.show();
|
|
||||||
},
|
|
||||||
// 三级地址联动回调
|
|
||||||
getpickerParentValue(e) {
|
|
||||||
// 将需要绑定的地址设置为空,并赋值
|
|
||||||
this.form.storeAddressIdPath = [];
|
|
||||||
this.form.storeAddressPath = [];
|
|
||||||
let name = "";
|
|
||||||
|
|
||||||
e.forEach((item, index) => {
|
|
||||||
if (item.id) {
|
|
||||||
// 遍历数据
|
|
||||||
this.form.storeAddressIdPath.push(item.id);
|
|
||||||
this.form.storeAddressPath.push(item.localName);
|
|
||||||
name += item.localName;
|
|
||||||
this.form.___path = name;
|
|
||||||
}
|
|
||||||
if (index == e.length - 1) {
|
|
||||||
//如果是最后一个
|
|
||||||
let _town = item.children.filter((_child) => {
|
|
||||||
return _child.id == item.id;
|
|
||||||
});
|
|
||||||
this.$set(
|
|
||||||
this.form,
|
|
||||||
"storeCenter",
|
|
||||||
_town[0].center.split(",")[0] + "," + _town[0].center.split(",")[1]
|
|
||||||
);
|
|
||||||
this.form.storeAddressIdPath = this.form.storeAddressIdPath.join(",");
|
|
||||||
this.form.storeAddressPath = this.form.storeAddressPath.join(",");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
console.log(this.form);
|
|
||||||
},
|
|
||||||
|
|
||||||
// 店铺logo
|
|
||||||
onUploadedtwo(lists) {
|
|
||||||
lists.forEach((item) => {
|
|
||||||
this.form.storeLogo.push(item.response.result);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 下一步
|
|
||||||
next() {
|
|
||||||
this.$refs.thirdForm.validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
this.loading = true;
|
|
||||||
let params = JSON.parse(JSON.stringify(this.form));
|
|
||||||
params.storeLogo = this.form.storeLogo.toString();
|
|
||||||
params.goodsManagementCategory =
|
|
||||||
this.form.goodsManagementCategory.toString();
|
|
||||||
|
|
||||||
applyThird(params)
|
|
||||||
.then((res) => {
|
|
||||||
this.loading = false;
|
|
||||||
uni.showToast({
|
|
||||||
title: "请正确输入",
|
|
||||||
icon: "none",
|
|
||||||
duration: 1500,
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.switchTab({
|
|
||||||
url: "/pages/tabbar/user/my",
|
|
||||||
});
|
|
||||||
}, 1000);
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
uni.showToast({
|
|
||||||
title: "请正确输入",
|
|
||||||
icon: "none",
|
|
||||||
duration: 1500,
|
|
||||||
});
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: "请正确输入",
|
|
||||||
icon: "none",
|
|
||||||
duration: 1500,
|
|
||||||
});
|
|
||||||
console.log("error");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.getCategoryList();
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.person-msg {
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
h4 {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
padding: 0 10px;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 40px;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
.ivu-input-wrapper {
|
|
||||||
width: 300px;
|
|
||||||
}
|
|
||||||
.img-list {
|
|
||||||
display: inline-block;
|
|
||||||
margin: 10px;
|
|
||||||
width: 100px;
|
|
||||||
height: auto;
|
|
||||||
position: relative;
|
|
||||||
.cover {
|
|
||||||
display: none;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
background: rgba(0, 0, 0, 0.6);
|
|
||||||
width: inherit;
|
|
||||||
height: inherit;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-around;
|
|
||||||
i {
|
|
||||||
color: #fff;
|
|
||||||
font-size: 30px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&:hover .cover {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.describe {
|
|
||||||
font-size: 12px;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
.bunem {
|
|
||||||
width: 309px;
|
|
||||||
margin-top: 50px;
|
|
||||||
height: 41px;
|
|
||||||
font-size: 15px;
|
|
||||||
line-height: 41px;
|
|
||||||
text-align: center;
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
::v-deep {
|
|
||||||
.u-checkbox__icon-wrap--checked {
|
|
||||||
border-color: #fe3c3c !important;
|
|
||||||
background-color: #fe3c3c !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,431 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view style="padding: 10px">
|
|
||||||
<u-form :model="form" ref="firstForm" :rules="rules">
|
|
||||||
<h4>企业资质信息</h4>
|
|
||||||
<u-form-item prop="companyName" label="公司名称">
|
|
||||||
<u-input v-model="form.companyName" placeholder="请填写公司信息" />
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item prop="companyAddressIdPath" label="公司所在地">
|
|
||||||
<u-input
|
|
||||||
v-model="path"
|
|
||||||
type="select"
|
|
||||||
@click="showPicker"
|
|
||||||
placeholder="请选择所在地区"
|
|
||||||
/>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item prop="companyAddress" label="详细地址">
|
|
||||||
<u-input
|
|
||||||
v-model="form.companyAddress"
|
|
||||||
placeholder="请填写公司详细信息"
|
|
||||||
/>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item prop="employeeNum" label="员工总数">
|
|
||||||
<u-input v-model="form.employeeNum" placeholder="请填写公司员工总数"
|
|
||||||
><span slot="append">人</span>
|
|
||||||
</u-input>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item prop="companyPhone" label="公司电话">
|
|
||||||
<u-input
|
|
||||||
v-model="form.companyPhone"
|
|
||||||
placeholder="请填写公司电话"
|
|
||||||
></u-input>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item prop="registeredCapital" label="注册资金">
|
|
||||||
<u-input
|
|
||||||
v-model="form.registeredCapital"
|
|
||||||
placeholder="请填写注册资金(万元)"
|
|
||||||
>
|
|
||||||
<!-- <span slot="append">万元</span> -->
|
|
||||||
</u-input>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item prop="linkName" label="联系人姓名">
|
|
||||||
<u-input v-model="form.linkName" placeholder="请填写联系人姓名" />
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item prop="linkPhone" label="联系人电话">
|
|
||||||
<u-input v-model="form.linkPhone" placeholder="请填写联系人电话" />
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item prop="companyEmail" label="电子邮箱">
|
|
||||||
<u-input v-model="form.companyEmail" placeholder="请填写电子邮箱" />
|
|
||||||
</u-form-item>
|
|
||||||
<h4>营业执照信息</h4>
|
|
||||||
<u-form-item prop="licenseNum" label="营业执照号">
|
|
||||||
<u-input v-model="form.licenseNum" placeholder="请填写营业执照号" />
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item prop="scope" label="经营范围">
|
|
||||||
<u-input
|
|
||||||
type="textarea"
|
|
||||||
v-model="form.scope"
|
|
||||||
maxlength="200"
|
|
||||||
show-word-limit
|
|
||||||
:rows="4"
|
|
||||||
placeholder="请输入营业执照所示经营范围"
|
|
||||||
/>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item prop="licencePhoto" label="营业执照电子版">
|
|
||||||
<u-upload
|
|
||||||
:action="action"
|
|
||||||
:header="{ accessToken: storage.getAccessToken() }"
|
|
||||||
max-count="1"
|
|
||||||
style="margin-left: 70px"
|
|
||||||
@on-uploaded="onUploadedone"
|
|
||||||
></u-upload>
|
|
||||||
</u-form-item>
|
|
||||||
<h4>法人信息</h4>
|
|
||||||
<u-form-item prop="legalName" label="法人姓名">
|
|
||||||
<u-input
|
|
||||||
v-model="form.legalName"
|
|
||||||
maxlength="20"
|
|
||||||
placeholder="请输入法人姓名"
|
|
||||||
/>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item prop="legalId" label="法人证件号">
|
|
||||||
<u-input v-model="form.legalId" placeholder="请输入法人证件号" />
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item prop="legalPhoto" label="法人证件电子版">
|
|
||||||
<u-upload
|
|
||||||
:header="{ accessToken: storage.getAccessToken() }"
|
|
||||||
max-count="2"
|
|
||||||
:action="action"
|
|
||||||
@on-uploaded="onUploadedtwo"
|
|
||||||
style="margin-left: 70px"
|
|
||||||
></u-upload>
|
|
||||||
<div class="describe">
|
|
||||||
请压缩图片在2M以内,身份证正反面两张照片,确保图片清晰无缺角
|
|
||||||
</div>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item> </u-form-item>
|
|
||||||
</u-form>
|
|
||||||
<button
|
|
||||||
type="primary"
|
|
||||||
@click="next"
|
|
||||||
:style="{ background: '#FE3C3C' }"
|
|
||||||
class="bunem"
|
|
||||||
>
|
|
||||||
填写财务资质信息
|
|
||||||
</button>
|
|
||||||
<u-toast ref="uToast" />
|
|
||||||
<m-city
|
|
||||||
:provinceData="list"
|
|
||||||
headTitle="区域选择"
|
|
||||||
ref="cityPicker"
|
|
||||||
@funcValue="getpickerParentValue"
|
|
||||||
pickerSize="4"
|
|
||||||
>
|
|
||||||
</m-city>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import storage from "@/utils/storage.js";
|
|
||||||
import { upload } from "@/api/common.js";
|
|
||||||
import gkcity from "@/components/m-city/m-city.vue";
|
|
||||||
import { applyFirst } from "@/api/goods";
|
|
||||||
import * as RegExp from "@/plugins/Reg/RegExp.js";
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
"m-city": gkcity,
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
list: [
|
|
||||||
{
|
|
||||||
id: "",
|
|
||||||
localName: "请选择",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
action: upload,
|
|
||||||
storage: storage,
|
|
||||||
path: "",
|
|
||||||
form: {
|
|
||||||
legalPhoto: [],
|
|
||||||
licencePhoto: [],
|
|
||||||
|
|
||||||
legalId: "",
|
|
||||||
legalName: "",
|
|
||||||
companyName: "",
|
|
||||||
// companyAddressIdPath: "",
|
|
||||||
companyAddress: "",
|
|
||||||
employeeNum: "",
|
|
||||||
registeredCapital: "",
|
|
||||||
companyAddressPath: "",
|
|
||||||
linkName: "",
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
companyName: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请填写公司信息",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
companyAddressIdPath: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请选择公司所在地",
|
|
||||||
trigger: ["change"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
companyAddress: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请填写公司详细地址",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
employeeNum: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请填写公司员工总数",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
pattern: RegExp.integer,
|
|
||||||
message: "只能填写正整数",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
registeredCapital: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请填写公司注册资金",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
pattern: RegExp.integer,
|
|
||||||
message: "只能填写正整数",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
linkName: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请填写联系人姓名",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
linkPhone: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请填写联系人电话",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
pattern: RegExp.mobile,
|
|
||||||
message: "请填写正确的号码",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
companyPhone: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请填写公司电话",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
pattern: RegExp.TEL,
|
|
||||||
message: "请填写正确的号码",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
companyEmail: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请填写电子邮箱",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: "email",
|
|
||||||
message: "请输入正确的邮箱",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
licenseNum: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请填写营业执照号",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
pattern: RegExp.licenseNum,
|
|
||||||
message: "请输入正确的营业执照号",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
scope: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请填写营业执照所示经营范围",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
legalPhoto: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请上传法人身份证照片",
|
|
||||||
trigger: ["change"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
licencePhoto: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请上传营业执照",
|
|
||||||
trigger: ["change"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
legalName: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请输入法人姓名",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
legalId: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请输入法人证件号",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
pattern: RegExp.IDCard,
|
|
||||||
message: "请输入正确的证件号",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
onLoad() {
|
|
||||||
// 页面加载时可以初始化数据
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
// 页面显示时可以执行一些操作
|
|
||||||
},
|
|
||||||
mounted() {},
|
|
||||||
methods: {
|
|
||||||
// 显示三级地址联动
|
|
||||||
showPicker() {
|
|
||||||
this.$refs.cityPicker.show();
|
|
||||||
},
|
|
||||||
// 三级地址联动回调
|
|
||||||
getpickerParentValue(e) {
|
|
||||||
// 将需要绑定的地址设置为空,并赋值
|
|
||||||
this.form.consigneeAddressIdPath = [];
|
|
||||||
this.form.consigneeAddressPath = [];
|
|
||||||
let name = "";
|
|
||||||
|
|
||||||
e.forEach((item, index) => {
|
|
||||||
if (item.id) {
|
|
||||||
// 遍历数据
|
|
||||||
this.form.consigneeAddressIdPath.push(item.id);
|
|
||||||
this.form.consigneeAddressPath.push(item.localName);
|
|
||||||
name += item.localName;
|
|
||||||
this.form.companyAddressPath = name;
|
|
||||||
this.path = name;
|
|
||||||
}
|
|
||||||
if (index == e.length - 1) {
|
|
||||||
//如果是最后一个
|
|
||||||
let _town = item.children.filter((_child) => {
|
|
||||||
return _child.id == item.id;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.form.lat = _town[0].center.split(",")[1];
|
|
||||||
this.form.lon = _town[0].center.split(",")[0];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
consub() {},
|
|
||||||
|
|
||||||
onUploaded(lists) {
|
|
||||||
lists.forEach((item) => {
|
|
||||||
this.form.businessLicense = item.response.result;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 法人证件电子
|
|
||||||
onUploadedone(lists) {
|
|
||||||
lists.forEach((item) => {
|
|
||||||
this.form.licencePhoto = item.response.result;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 法人证件电子版
|
|
||||||
onUploadedtwo(lists) {
|
|
||||||
lists.forEach((item) => {
|
|
||||||
this.form.legalPhoto.push(item.response.result);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
// 下一步
|
|
||||||
next() {
|
|
||||||
this.$refs.firstForm.validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
let params = JSON.parse(JSON.stringify(this.form));
|
|
||||||
params.legalPhoto = this.form.legalPhoto.toString();
|
|
||||||
params.licencePhoto = this.form.licencePhoto.toString();
|
|
||||||
if (
|
|
||||||
this.form.legalPhoto != "" &&
|
|
||||||
this.form.legalId != "" &&
|
|
||||||
this.form.legalName != ""
|
|
||||||
) {
|
|
||||||
applyFirst(params)
|
|
||||||
.then((res) => {
|
|
||||||
if (res.data.success) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/mine/openShop/secon",
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: "请正确输入",
|
|
||||||
icon: "none",
|
|
||||||
duration: 1500,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
uni.showToast({
|
|
||||||
title: "请正确输入",
|
|
||||||
icon: "none",
|
|
||||||
duration: 1500,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: "请正确输入",
|
|
||||||
icon: "none",
|
|
||||||
duration: 1500,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$refs.uToast.show({
|
|
||||||
title: "表单校验失败,请检查输入内容",
|
|
||||||
type: "error",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
::v-deep {
|
|
||||||
.u-form-item--left__content {
|
|
||||||
width: 100px;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.bunem {
|
|
||||||
width: 309px;
|
|
||||||
margin-top: 20px;
|
|
||||||
height: 41px;
|
|
||||||
font-size: 15px;
|
|
||||||
line-height: 41px;
|
|
||||||
text-align: center;
|
|
||||||
color: #ffffff;
|
|
||||||
margin-bottom: 35px;
|
|
||||||
}
|
|
||||||
.u-input {
|
|
||||||
margin-left: 30px; // 可根据实际情况调整这个值
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,189 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="photo-msg">
|
|
||||||
<u-form ref="secondForm" :model="form" :rules="rules" :label-width="250">
|
|
||||||
<h4>财务资质信息</h4>
|
|
||||||
<u-form-item prop="settlementBankAccountName" label="银行开户名">
|
|
||||||
<u-input
|
|
||||||
type="text"
|
|
||||||
v-model="form.settlementBankAccountName"
|
|
||||||
placeholder="请填写银行开户名称"
|
|
||||||
/>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item prop="settlementBankAccountNum" label="银行账号">
|
|
||||||
<u-input
|
|
||||||
type="text"
|
|
||||||
v-model="form.settlementBankAccountNum"
|
|
||||||
placeholder="请填写银行账号"
|
|
||||||
/>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item prop="settlementBankBranchName" label="开户银行支行名称">
|
|
||||||
<u-input
|
|
||||||
type="text"
|
|
||||||
v-model="form.settlementBankBranchName"
|
|
||||||
placeholder="请填写开户银行支行名称"
|
|
||||||
/>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item prop="settlementBankJointName" label="支行联行号">
|
|
||||||
<u-input
|
|
||||||
type="text"
|
|
||||||
v-model="form.settlementBankJointName"
|
|
||||||
placeholder="请填写支行联行号"
|
|
||||||
/>
|
|
||||||
</u-form-item>
|
|
||||||
|
|
||||||
<u-form-item>
|
|
||||||
<!-- <button @click="uni.navigateBack()" :style="{background:'#F50505'}">返回</button> -->
|
|
||||||
<button type="primary" @click="next" :style="{ background: '#FE3C3C' }" class="bunem">
|
|
||||||
填写其他信息
|
|
||||||
</button>
|
|
||||||
</u-form-item>
|
|
||||||
</u-form>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import { applySecond } from "@/api/goods";
|
|
||||||
export default {
|
|
||||||
// props: {
|
|
||||||
// content: {
|
|
||||||
// default: {},
|
|
||||||
// type: Object,
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: false, // 加载状态
|
|
||||||
form: {}, // 表单数据
|
|
||||||
rules: {
|
|
||||||
// 验证规则
|
|
||||||
settlementBankAccountName: [
|
|
||||||
{ required: true, message: "请填写银行开户名称", trigger: "blur" },
|
|
||||||
{
|
|
||||||
min: 2,
|
|
||||||
max: 20,
|
|
||||||
message: "长度在 2 到 20 个字符",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
settlementBankAccountNum: [
|
|
||||||
{ required: true, message: "请填写银行账号", trigger: "blur" },
|
|
||||||
{
|
|
||||||
pattern: /^\d{16,19}$/,
|
|
||||||
message: "请输入 16 到 19 位的银行账号",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
settlementBankBranchName: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请填写开户银行支行名称",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
min: 4,
|
|
||||||
max: 50,
|
|
||||||
message: "长度在 4 到 50 个字符",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
settlementBankJointName: [
|
|
||||||
{ required: true, message: "请填写支行联行号", trigger: "blur" },
|
|
||||||
{
|
|
||||||
pattern: /^\d{12}$/,
|
|
||||||
message: "请输入 12 位的支行联行号",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
ngm() {
|
|
||||||
uni.navigateBack({
|
|
||||||
delta: 1, // 返回上一级页面
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 下一步
|
|
||||||
next() {
|
|
||||||
this.$refs.secondForm.validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
this.loading = true;
|
|
||||||
if (this.form.settlementBankJointName != "") {
|
|
||||||
applySecond(this.form)
|
|
||||||
.then((res) => {
|
|
||||||
if (res.data.success) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/mine/openShop/ThirdApply",
|
|
||||||
});
|
|
||||||
|
|
||||||
}else {
|
|
||||||
uni.showToast({
|
|
||||||
title: "请正确输入",
|
|
||||||
icon: "none",
|
|
||||||
duration: 1500,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
this.loading = false;
|
|
||||||
uni.showToast({
|
|
||||||
title: "请正确输入",
|
|
||||||
icon: "none",
|
|
||||||
duration: 1500,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
console.log("error");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
// if (this.content != {}) {
|
|
||||||
// this.form = JSON.parse(JSON.stringify(this.content));
|
|
||||||
// this.$forceUpdate();
|
|
||||||
// }
|
|
||||||
// this.$refs.secondForm.resetFields();
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
h4 {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
padding: 0 10px;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 40px;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
.ivu-input-wrapper {
|
|
||||||
width: 300px;
|
|
||||||
}
|
|
||||||
.photo-msg {
|
|
||||||
padding: 20px;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
::v-deep {
|
|
||||||
// .u-form-item--left__content {
|
|
||||||
// width: 100px;
|
|
||||||
// white-space: nowrap;
|
|
||||||
// }
|
|
||||||
.bunem{
|
|
||||||
width: 309px;
|
|
||||||
margin-top: 50px;
|
|
||||||
height: 41px;
|
|
||||||
font-size: 15px;
|
|
||||||
line-height: 41px;
|
|
||||||
text-align: center;
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
.u-input {
|
|
||||||
margin-left: 30px; // 可根据实际情况调整这个值
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -2,68 +2,36 @@
|
|||||||
<div class="feedBack">
|
<div class="feedBack">
|
||||||
<div class="feedBack-box">
|
<div class="feedBack-box">
|
||||||
<h4>猜你想问</h4>
|
<h4>猜你想问</h4>
|
||||||
<div
|
<div class="feedBack-item" :class="{'active':feedBack.type == item.value }" @click="handleClick(index)" v-for="(item,index) in list" :key="index">
|
||||||
class="feedBack-item"
|
{{item.text}}
|
||||||
:class="{ active: feedBack.type == item.value }"
|
|
||||||
@click="handleClick(index)"
|
|
||||||
v-for="(item, index) in list"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
{{ item.text }}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="feedBack-box">
|
<div class="feedBack-box">
|
||||||
<h4>
|
<h4>问题反馈 <span style="margin-left:10rpx;" v-if="feedBack.type">@{{ list.find(item=>{return item.value == feedBack.type }).text }}</span></h4>
|
||||||
问题反馈
|
<u-input class="field-input" height="500" :border-bottom="false" v-model="feedBack.context" type="textarea" placeholder="请输入反馈信息">
|
||||||
<span style="margin-left: 10rpx" v-if="feedBack.type"
|
|
||||||
>@{{
|
|
||||||
list.find((item) => {
|
|
||||||
return item.value == feedBack.type;
|
|
||||||
}).text
|
|
||||||
}}</span
|
|
||||||
>
|
|
||||||
</h4>
|
|
||||||
<u-input
|
|
||||||
class="field-input"
|
|
||||||
height="500"
|
|
||||||
:border-bottom="false"
|
|
||||||
v-model="feedBack.context"
|
|
||||||
type="textarea"
|
|
||||||
placeholder="请输入反馈信息"
|
|
||||||
>
|
|
||||||
</u-input>
|
</u-input>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 上传凭证 -->
|
<!-- 上传凭证 -->
|
||||||
<div class="feedBack-box">
|
<div class="feedBack-box">
|
||||||
<view class="opt-view">
|
<view class="opt-view">
|
||||||
<view class="img-title">上传凭证(最多1张)</view>
|
<view class="img-title">上传凭证(最多5张)</view>
|
||||||
<view class="images-view">
|
<view class="images-view">
|
||||||
<u-upload
|
<u-upload :header=" { accessToken: storage.getAccessToken() }" :action="action" width="150" @on-uploaded="onUploaded" :max-count="5" :show-progress="false"></u-upload>
|
||||||
:header="{ accessToken: storage.getAccessToken() }"
|
|
||||||
:action="action"
|
|
||||||
width="150"
|
|
||||||
@on-uploaded="onUploaded"
|
|
||||||
:max-count="1"
|
|
||||||
:show-progress="false"
|
|
||||||
></u-upload>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="feedBack-box">
|
<div class="feedBack-box">
|
||||||
<h4>手机号</h4>
|
<h4>手机号</h4>
|
||||||
<u-input
|
<u-input :border-bottom="false" v-model="feedBack.mobile" placeholder="请输入您的手机号">
|
||||||
:border-bottom="false"
|
|
||||||
v-model="feedBack.mobile"
|
|
||||||
placeholder="请输入您的手机号"
|
|
||||||
>
|
|
||||||
</u-input>
|
</u-input>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="submit" @click="submit()">提交</div>
|
<div class="submit" @click="submit()">提交</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -162,7 +130,7 @@ export default {
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
}
|
}
|
||||||
.active {
|
.active{
|
||||||
color: $light-color !important;
|
color: $light-color !important;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,320 +1,277 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="person-msg">
|
<view class="person-msg">
|
||||||
<view class="head c-content" @click="changeFace">
|
<view class="head c-content" @click="changeFace">
|
||||||
<image :src="form.face || '/static/missing-face.png'" mode=""></image>
|
<image :src="form.face || '/static/missing-face.png'" mode=""></image>
|
||||||
<view>点击修改头像</view>
|
<view>点击修改头像</view>
|
||||||
</view>
|
</view>
|
||||||
<u-form :model="form" ref="uForm" class="form">
|
<u-form :model="form" ref="uForm" class="form">
|
||||||
<u-form-item label="昵称" label-width="150">
|
<u-form-item label="昵称" label-width="150">
|
||||||
<u-input
|
<u-input v-model="form.nickName" placeholder="请输入昵称" />
|
||||||
v-model="form.nickName"
|
</u-form-item>
|
||||||
placeholder="请输入昵称"
|
<u-form-item label="性别" label-width="150">
|
||||||
maxlength="10"
|
<u-radio-group v-model="form.sex" :active-color="lightColor">
|
||||||
/>
|
<u-radio name="1">男</u-radio>
|
||||||
</u-form-item>
|
<u-radio name="0">女</u-radio>
|
||||||
<u-form-item label="二维码" label-width="150">
|
</u-radio-group>
|
||||||
<img :src="erwei" alt="" width="60" @click="showQrCodeInFullSize" />
|
</u-form-item>
|
||||||
</u-form-item>
|
|
||||||
<u-form-item label="性别" label-width="150">
|
|
||||||
<u-radio-group v-model="form.sex" :active-color="lightColor">
|
|
||||||
<u-radio name="1">男</u-radio>
|
|
||||||
<u-radio name="0">女</u-radio>
|
|
||||||
</u-radio-group>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item label="生日" label-width="150" right-icon="arrow-right">
|
|
||||||
<div style="width: 100%" @click="showBirthday = true">
|
|
||||||
{{ birthday || "请选择出生日期" }}
|
|
||||||
</div>
|
|
||||||
<u-picker
|
|
||||||
v-model="showBirthday"
|
|
||||||
mode="time"
|
|
||||||
:confirm-color="lightColor"
|
|
||||||
@confirm="selectTime"
|
|
||||||
></u-picker>
|
|
||||||
</u-form-item>
|
|
||||||
|
|
||||||
<u-form-item
|
|
||||||
label="城市"
|
|
||||||
label-width="150"
|
<u-form-item label="生日" label-width="150" right-icon="arrow-right">
|
||||||
placeholder="请选择城市"
|
<div style="width: 100%;" @click="showBirthday = true">{{ birthday || '请选择出生日期' }}</div>
|
||||||
right-icon="arrow-right"
|
<u-picker v-model="showBirthday" mode="time" :confirm-color="lightColor"
|
||||||
>
|
@confirm="selectTime"></u-picker>
|
||||||
<div style="width: 100%" @click="clickRegion">
|
</u-form-item>
|
||||||
{{ form.___path || "请选择城市" }}
|
|
||||||
</div>
|
<u-form-item label="城市" label-width="150" placeholder="请选择城市" right-icon="arrow-right">
|
||||||
</u-form-item>
|
<div style="width: 100%;" @click="clickRegion">{{ form.___path || '请选择城市' }}</div>
|
||||||
</u-form>
|
</u-form-item>
|
||||||
<div style="display: flex; justify-content: center"></div>
|
|
||||||
<div class="bottom">
|
</u-form>
|
||||||
<view class="submit" @click="submit">保存</view>
|
<div class="bottom">
|
||||||
<view class="submit light" @click="showModalDialog">退出登录</view>
|
<view class="submit" @click="submit">保存</view>
|
||||||
</div>
|
<view class="submit light" @click="showModalDialog">退出登录</view>
|
||||||
<u-modal
|
</div>
|
||||||
show-cancel-button
|
<u-modal show-cancel-button v-model="quitShow" @confirm="confirm" :confirm-color="lightColor" :async-close="true"
|
||||||
v-model="quitShow"
|
:content="userInfo.id ? '确定要退出登录么?' : '确定要返回登录么?'"></u-modal>
|
||||||
@confirm="confirm"
|
<m-city :provinceData="region" headTitle="区域选择" ref="cityPicker" @funcValue="getpickerParentValue"
|
||||||
:confirm-color="lightColor"
|
pickerSize="4"></m-city>
|
||||||
:async-close="true"
|
</view>
|
||||||
:content="userInfo.id ? '确定要退出登录么?' : '确定要返回登录么?'"
|
|
||||||
></u-modal>
|
|
||||||
<m-city
|
|
||||||
:provinceData="region"
|
|
||||||
headTitle="区域选择"
|
|
||||||
ref="cityPicker"
|
|
||||||
@funcValue="getpickerParentValue"
|
|
||||||
pickerSize="4"
|
|
||||||
></m-city>
|
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { saveUserInfo, geterwei } from "@/api/members.js";
|
import {
|
||||||
import { upload } from "@/api/common.js";
|
saveUserInfo
|
||||||
import { logout } from "@/api/login";
|
} from "@/api/members.js";
|
||||||
import storage from "@/utils/storage.js";
|
import {
|
||||||
import uFormItem from "@/uview-ui/components/u-form-item/u-form-item.vue";
|
upload
|
||||||
import gkcity from "@/components/m-city/m-city.vue";
|
} from "@/api/common.js";
|
||||||
export default {
|
import { logout } from "@/api/login";
|
||||||
components: {
|
import storage from "@/utils/storage.js";
|
||||||
uFormItem,
|
import uFormItem from "@/uview-ui/components/u-form-item/u-form-item.vue";
|
||||||
"m-city": gkcity,
|
import gkcity from "@/components/m-city/m-city.vue";
|
||||||
},
|
export default {
|
||||||
data() {
|
components: {
|
||||||
return {
|
uFormItem,
|
||||||
erwei: "",
|
"m-city": gkcity
|
||||||
quitShow: false,
|
},
|
||||||
userInfo: {},
|
data() {
|
||||||
lightColor: this.$lightColor, //高亮颜色
|
return {
|
||||||
form: {
|
quitShow:false,
|
||||||
nickName: storage.getUserInfo().nickName || "",
|
userInfo:{},
|
||||||
birthday: storage.getUserInfo().birthday || "",
|
lightColor: this.$lightColor, //高亮颜色
|
||||||
face: storage.getUserInfo().face || "/static/missing-face.png", //默认头像
|
form: {
|
||||||
regionId: [], //地址Id
|
nickName: storage.getUserInfo().nickName || "",
|
||||||
region: storage.getUserInfo().region || [], //地址
|
birthday: storage.getUserInfo().birthday || "",
|
||||||
sex: storage.getUserInfo().sex, //性别
|
face: storage.getUserInfo().face || "/static/missing-face.png", //默认头像
|
||||||
___path: storage.getUserInfo().region,
|
regionId: [], //地址Id
|
||||||
},
|
region: storage.getUserInfo().region || [], //地址
|
||||||
birthday: storage.getUserInfo().birthday || "", //生日
|
sex: storage.getUserInfo().sex, //性别
|
||||||
photo: [
|
___path: storage.getUserInfo().region,
|
||||||
{
|
},
|
||||||
text: "立即拍照",
|
birthday: storage.getUserInfo().birthday || "", //生日
|
||||||
color: this.$mainColor,
|
photo: [{
|
||||||
},
|
text: "立即拍照",
|
||||||
{
|
color: this.$mainColor
|
||||||
text: "从相册选择",
|
},
|
||||||
color: this.$mainColor,
|
{
|
||||||
},
|
text: "从相册选择",
|
||||||
],
|
color: this.$mainColor
|
||||||
region: [
|
},
|
||||||
//请求城市默认地址
|
],
|
||||||
{
|
region: [
|
||||||
id: "",
|
//请求城市默认地址
|
||||||
localName: "请选择",
|
{
|
||||||
children: [],
|
id: "",
|
||||||
},
|
localName: "请选择",
|
||||||
],
|
children: [],
|
||||||
showBirthday: false, //显示生日日期
|
},
|
||||||
};
|
],
|
||||||
},
|
showBirthday: false, //显示生日日期
|
||||||
onShow() {
|
};
|
||||||
this.userInfo = this.$options.filters.isLogin();
|
},
|
||||||
this.getgeterwei();
|
onShow() {
|
||||||
},
|
console.log('personMSg')
|
||||||
methods: {
|
this.userInfo = this.$options.filters.isLogin();
|
||||||
showQrCodeInFullSize() {
|
console.log(this.userInfo)
|
||||||
uni.previewImage({
|
},
|
||||||
urls: [this.erwei],
|
methods: {
|
||||||
current: this.erwei,
|
showModalDialog() {
|
||||||
});
|
this.quitShow = true;
|
||||||
},
|
},
|
||||||
getgeterwei() {
|
clear() {
|
||||||
geterwei().then((res) => {
|
storage.setAccessToken("");
|
||||||
this.erwei = res.data.result;
|
storage.setRefreshToken("");
|
||||||
});
|
storage.setUserInfo({});
|
||||||
},
|
// 清理vlog信息
|
||||||
showModalDialog() {
|
storage.setVlogToken("")
|
||||||
this.quitShow = true;
|
storage.setVlogUserInfo({})
|
||||||
},
|
this.$options.filters.navigateToLogin("redirectTo");
|
||||||
clear() {
|
},
|
||||||
storage.setAccessToken("");
|
/**
|
||||||
storage.setRefreshToken("");
|
* 确认退出
|
||||||
storage.setUserInfo({});
|
* 清除缓存重新登录
|
||||||
// 清理vlog信息
|
*/
|
||||||
storage.setVlogToken("");
|
async confirm() {
|
||||||
storage.setVlogUserInfo({});
|
await logout();
|
||||||
this.$options.filters.navigateToLogin("redirectTo");
|
this.clear();
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 确认退出
|
* 退出登录
|
||||||
* 清除缓存重新登录
|
*/
|
||||||
*/
|
quiteLoginOut() {
|
||||||
async confirm() {
|
console.log(this.$options)
|
||||||
await logout();
|
this.$options.filters.quiteLoginOut();
|
||||||
this.clear();
|
},
|
||||||
},
|
/**
|
||||||
/**
|
* 选择地址回调
|
||||||
* 退出登录
|
*/
|
||||||
*/
|
getpickerParentValue(e) {
|
||||||
quiteLoginOut() {
|
this.form.region = [];
|
||||||
this.$options.filters.quiteLoginOut();
|
this.form.regionId = [];
|
||||||
},
|
let name = "";
|
||||||
/**
|
|
||||||
* 选择地址回调
|
|
||||||
*/
|
|
||||||
getpickerParentValue(e) {
|
|
||||||
this.form.region = [];
|
|
||||||
this.form.regionId = [];
|
|
||||||
let name = "";
|
|
||||||
|
|
||||||
e.forEach((item, index) => {
|
e.forEach((item, index) => {
|
||||||
if (item.id) {
|
if (item.id) {
|
||||||
this.form.region.push(item.localName);
|
this.form.region.push(item.localName);
|
||||||
this.form.regionId.push(item.id);
|
this.form.regionId.push(item.id);
|
||||||
if (index == e.length - 1) {
|
if (index == e.length - 1) {
|
||||||
name += item.localName;
|
name += item.localName;
|
||||||
} else {
|
} else {
|
||||||
name += item.localName + ",";
|
name += item.localName + ",";
|
||||||
}
|
}
|
||||||
this.form.___path = name;
|
this.form.___path = name;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 点击选择地址
|
* 点击选择地址
|
||||||
*/
|
*/
|
||||||
clickRegion() {
|
clickRegion() {
|
||||||
this.$refs.cityPicker.show();
|
this.$refs.cityPicker.show();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交保存
|
* 提交保存
|
||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
delete this.form.___path;
|
delete this.form.___path;
|
||||||
let params = JSON.parse(JSON.stringify(this.form));
|
let params = JSON.parse(JSON.stringify(this.form));
|
||||||
saveUserInfo(params).then((res) => {
|
saveUserInfo(params).then((res) => {
|
||||||
if (res.statusCode == 200) {
|
if (res.statusCode == 200) {
|
||||||
storage.setUserInfo(res.data.result);
|
storage.setUserInfo(res.data.result);
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改头像
|
* 修改头像
|
||||||
*/
|
*/
|
||||||
changeFace(index) {
|
changeFace(index) {
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
success: (chooseImageRes) => {
|
success: (chooseImageRes) => {
|
||||||
const tempFilePaths = chooseImageRes.tempFilePaths;
|
const tempFilePaths = chooseImageRes.tempFilePaths;
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
url: upload,
|
url: upload,
|
||||||
filePath: tempFilePaths[0],
|
filePath: tempFilePaths[0],
|
||||||
name: "file",
|
name: "file",
|
||||||
header: {
|
header: {
|
||||||
accessToken: storage.getAccessToken(),
|
accessToken: storage.getAccessToken(),
|
||||||
},
|
},
|
||||||
success: (uploadFileRes) => {
|
success: (uploadFileRes) => {
|
||||||
let data = JSON.parse(uploadFileRes.data);
|
let data = JSON.parse(uploadFileRes.data);
|
||||||
this.form.face = data.result;
|
console.log(data)
|
||||||
},
|
this.form.face = data.result;
|
||||||
});
|
},
|
||||||
},
|
});
|
||||||
});
|
},
|
||||||
},
|
});
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择地址
|
* 选择地址
|
||||||
*/
|
*/
|
||||||
selectRegion(region) {
|
selectRegion(region) {
|
||||||
this.$set(
|
this.$set(
|
||||||
this.form,
|
this.form,
|
||||||
"address",
|
"address",
|
||||||
`${region.province.label} ${region.city.label} ${region.area.label}`
|
`${region.province.label} ${region.city.label} ${region.area.label}`
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择时间
|
* 选择时间
|
||||||
*/
|
*/
|
||||||
selectTime(time) {
|
selectTime(time) {
|
||||||
this.form.birthday = `${time.year}-${time.month}-${time.day}`;
|
this.form.birthday = `${time.year}-${time.month}-${time.day}`;
|
||||||
this.birthday = `${time.year} - ${time.month} - ${time.day}`;
|
this.birthday = `${time.year} - ${time.month} - ${time.day}`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载数据
|
* 加载数据
|
||||||
*/
|
*/
|
||||||
onLoad() {},
|
onLoad() {},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.submit {
|
.submit {
|
||||||
height: 90rpx;
|
height: 90rpx;
|
||||||
line-height: 90rpx;
|
line-height: 90rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 90rpx;
|
margin-top: 90rpx;
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
color: $main-color;
|
color: $main-color;
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.head {
|
.head {
|
||||||
height: 260rpx;
|
height: 260rpx;
|
||||||
color: $font-color-light;
|
color: $font-color-light;
|
||||||
font-size: $font-sm;
|
font-size: $font-sm;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
line-height: 2em;
|
line-height: 2em;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 144rpx;
|
width: 144rpx;
|
||||||
height: 144rpx;
|
height: 144rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .u-form {
|
/deep/ .u-form {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin-top: 30rpx;
|
margin-top: 30rpx;
|
||||||
|
|
||||||
.u-form-item {
|
.u-form-item {
|
||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
height: 110rpx;
|
height: 110rpx;
|
||||||
line-height: 110rpx;
|
line-height: 110rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.form {
|
.form {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
.bottom {
|
.bottom{
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 40px;
|
bottom: 40px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
> .submit {
|
>.submit{
|
||||||
background: $light-color;
|
background: $light-color;
|
||||||
background: #fe3c3c;
|
color: #fff;
|
||||||
color: #fff;
|
width: 40%;
|
||||||
width: 40%;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
</style>
|
||||||
::v-deep {
|
|
||||||
.u-radio__icon-wrap--checked {
|
|
||||||
// background: #FE3C3C;
|
|
||||||
// border: 1px solid #FE3C3C;
|
|
||||||
border-color: #fe3c3c !important;
|
|
||||||
background-color: #fe3c3c !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -4,15 +4,9 @@
|
|||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="circle-box">
|
<div class="circle-box">
|
||||||
<div class="cricle" @click="signIn()">
|
<div class="cricle" @click="signIn()">
|
||||||
<span v-if="!ifSign" :class="{ active: signFlag || ifSign }"
|
<span v-if="!ifSign" :class="{ active: signFlag || ifSign }">签到</span>
|
||||||
>签到</span
|
<span v-else :class="{ active: signFlag || ifSign }"
|
||||||
>
|
:style="ifSign ? 'transform: rotateY(0deg);' : ''">已签</span>
|
||||||
<span
|
|
||||||
v-else
|
|
||||||
:class="{ active: signFlag || ifSign }"
|
|
||||||
:style="ifSign ? 'transform: rotateY(0deg);' : ''"
|
|
||||||
>已签</span
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<text class="tips">坚持每天连续签到可以获多重奖励哦</text>
|
<text class="tips">坚持每天连续签到可以获多重奖励哦</text>
|
||||||
@ -22,46 +16,28 @@
|
|||||||
<view class="date-con">
|
<view class="date-con">
|
||||||
<view class="date-tit">
|
<view class="date-tit">
|
||||||
<div class="current-month">
|
<div class="current-month">
|
||||||
<div class="day">
|
<div class="day">每日记录<span> ({{ currentMonth }})</span></div>
|
||||||
每日记录<span> ({{ currentMonth }})</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
<view class="week">
|
<view class="week">
|
||||||
<text v-for="item in weekArr" :key="item.id">{{ item }}</text>
|
<text v-for="item in weekArr" :key="item.id">{{ item }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="date" v-for="obj in dataObj" :key="obj.id">
|
<view class="date" v-for="obj in dataObj" :key="obj.id">
|
||||||
<view
|
<view class="item" v-for="item in obj" :key="item.id" :class="item == '' ? 'hide' : ''"
|
||||||
class="item"
|
:animation="item == currentDay ? animationData : ''">
|
||||||
v-for="item in obj"
|
<view class="just" :class="signArr.indexOf(item) != -1 ? 'active' : ''">
|
||||||
:key="item.id"
|
|
||||||
:class="item == '' ? 'hide' : ''"
|
|
||||||
:animation="item == currentDay ? animationData : ''"
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="just"
|
|
||||||
:class="signArr.indexOf(item) != -1 ? 'active' : ''"
|
|
||||||
>
|
|
||||||
<view class="top">{{ item }} </view>
|
<view class="top">{{ item }} </view>
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<u-icon
|
<u-icon name="error" v-if="item <= currentDay" color="#999"></u-icon>
|
||||||
name="error"
|
|
||||||
v-if="item <= currentDay"
|
|
||||||
color="#999"
|
|
||||||
></u-icon>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="back" :class="signArr.indexOf(item) != -1 ? 'active' : ''" :style="
|
||||||
class="back"
|
|
||||||
:class="signArr.indexOf(item) != -1 ? 'active' : ''"
|
|
||||||
:style="
|
|
||||||
signArr.indexOf(item) != -1 && ifSign
|
signArr.indexOf(item) != -1 && ifSign
|
||||||
? 'transform: rotateY(0deg);'
|
? 'transform: rotateY(0deg);'
|
||||||
: signArr.indexOf(item) != -1 && item != currentDay
|
: signArr.indexOf(item) != -1 && item != currentDay
|
||||||
? 'transform: rotateY(0deg);'
|
? 'transform: rotateY(0deg);'
|
||||||
: ''
|
: ''
|
||||||
"
|
">
|
||||||
>
|
|
||||||
<view class="top">{{ item }}</view>
|
<view class="top">{{ item }}</view>
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<u-icon name="checkmark" :color="aiderLightColor"></u-icon>
|
<u-icon name="checkmark" :color="aiderLightColor"></u-icon>
|
||||||
@ -78,12 +54,7 @@
|
|||||||
<text class="close" @click="close">×</text>
|
<text class="close" @click="close">×</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="mask-con">
|
<view class="mask-con">
|
||||||
<u-icon
|
<u-icon size="120" style="margin: 50rpx 0" :color="aiderLightColor" name="checkmark"></u-icon>
|
||||||
size="120"
|
|
||||||
style="margin: 50rpx 0"
|
|
||||||
:color="aiderLightColor"
|
|
||||||
name="checkmark"
|
|
||||||
></u-icon>
|
|
||||||
<text class="text">连续签到可获得额外奖励哦!</text>
|
<text class="text">连续签到可获得额外奖励哦!</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -95,7 +66,7 @@ import { sign, signTime } from "@/api/point.js";
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
aiderLightColor: this.$aiderLightColor,
|
aiderLightColor:this.$aiderLightColor,
|
||||||
signFlag: false,
|
signFlag: false,
|
||||||
animationData: {},
|
animationData: {},
|
||||||
maskFlag: false, //
|
maskFlag: false, //
|
||||||
@ -322,11 +293,6 @@ page {
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
::v-deep {
|
|
||||||
.u-icon__icon{
|
|
||||||
color: #fe3c3c !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.date-card {
|
.date-card {
|
||||||
padding: 0 32rpx;
|
padding: 0 32rpx;
|
||||||
margin: 32rpx 0;
|
margin: 32rpx 0;
|
||||||
@ -343,11 +309,12 @@ page {
|
|||||||
width: 200rpx;
|
width: 200rpx;
|
||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: #fe3c3c;
|
background: $aider-light-color;
|
||||||
box-shadow: 0 4rpx 24rpx 0 #fe3c3c;
|
box-shadow: 0 4rpx 24rpx 0 rgba($color: $aider-light-color, $alpha: 1);
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center; //这个是X轴居中
|
justify-content: center; //这个是X轴居中
|
||||||
align-items: center; //这个是 Y轴居中
|
align-items: center; //这个是 Y轴居中
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.cricle {
|
.cricle {
|
||||||
@ -368,7 +335,7 @@ page {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 64rpx 32rpx;
|
padding:64rpx 32rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -86,7 +86,7 @@
|
|||||||
<div v-for="(item, index) in goodsList" :key="index" class="goods-row">
|
<div v-for="(item, index) in goodsList" :key="index" class="goods-row">
|
||||||
<div class="flex goods-col">
|
<div class="flex goods-col">
|
||||||
<div class="goods-img" @click="navigateToDetailPage(item)">
|
<div class="goods-img" @click="navigateToDetailPage(item)">
|
||||||
<u-image width="230rpx" height="230rpx" :src="imgfun(item.content.thumbnail)">
|
<u-image width="230rpx" height="230rpx" :src="item.content.thumbnail">
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
</u-image>
|
</u-image>
|
||||||
</div>
|
</div>
|
||||||
@ -151,7 +151,7 @@
|
|||||||
<view class="goods-list">
|
<view class="goods-list">
|
||||||
<view v-for="(item, index) in goodsList" :key="index" class="goods-item">
|
<view v-for="(item, index) in goodsList" :key="index" class="goods-item">
|
||||||
<view class="image-wrapper" @click="navigateToDetailPage(item)">
|
<view class="image-wrapper" @click="navigateToDetailPage(item)">
|
||||||
<image :src="imgfun(item.content.thumbnail)" mode="aspectFill"></image>
|
<image :src="item.content.thumbnail" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-detail">
|
<view class="goods-detail">
|
||||||
<div class="title clamp" @click="navigateToDetailPage(item)">{{ item.content.goodsName }}</div>
|
<div class="title clamp" @click="navigateToDetailPage(item)">{{ item.content.goodsName }}</div>
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
<view v-for="(sku, _index) in order.orderItems" :key="_index">
|
<view v-for="(sku, _index) in order.orderItems" :key="_index">
|
||||||
<view class="goods-item-view">
|
<view class="goods-item-view">
|
||||||
<view>
|
<view>
|
||||||
<u-image border-radius="6rpx" width="132rpx" height="132rpx" class="goods_img" :src="imgfun(sku.image)"
|
<u-image border-radius="6rpx" width="132rpx" height="132rpx" class="goods_img" :src="sku.image"
|
||||||
alt />
|
alt />
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-info">
|
<view class="goods-info">
|
||||||
|
|||||||
@ -307,8 +307,6 @@ import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
onLoad: function (val) {
|
onLoad: function (val) {
|
||||||
console.log(val,'======');
|
|
||||||
|
|
||||||
this.routerVal = val;
|
this.routerVal = val;
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 22 KiB |
@ -16,8 +16,6 @@
|
|||||||
},
|
},
|
||||||
onLoad (e) {
|
onLoad (e) {
|
||||||
const params = JSON.parse((decodeURIComponent(e.params)))
|
const params = JSON.parse((decodeURIComponent(e.params)))
|
||||||
console.log(params,'=============');
|
|
||||||
|
|
||||||
chat.init({
|
chat.init({
|
||||||
sign: params.mpSign, //必传,公司渠道唯一标识,腾讯云智服后台系统创建「小程序插件」渠道后,在「渠道管理」获取
|
sign: params.mpSign, //必传,公司渠道唯一标识,腾讯云智服后台系统创建「小程序插件」渠道后,在「渠道管理」获取
|
||||||
token: params.token, //非必填
|
token: params.token, //非必填
|
||||||
|
|||||||
@ -18,7 +18,6 @@
|
|||||||
"
|
"
|
||||||
:thumbnail="goodsDetail.thumbnail"
|
:thumbnail="goodsDetail.thumbnail"
|
||||||
:goodsName="goodsDetail.goodsName"
|
:goodsName="goodsDetail.goodsName"
|
||||||
:price="goodsDetail.goodsName"
|
|
||||||
type="goods"
|
type="goods"
|
||||||
@close="shareFlage = false"
|
@close="shareFlage = false"
|
||||||
/>
|
/>
|
||||||
@ -39,11 +38,7 @@
|
|||||||
>
|
>
|
||||||
<div class="headerRow">
|
<div class="headerRow">
|
||||||
<div class="backs">
|
<div class="backs">
|
||||||
<u-icon
|
<u-icon @click="back()" name="arrow-left" class="icon-back"></u-icon>
|
||||||
@click="back()"
|
|
||||||
name="arrow-left"
|
|
||||||
class="icon-back"
|
|
||||||
></u-icon>
|
|
||||||
|
|
||||||
<u-icon
|
<u-icon
|
||||||
name="list"
|
name="list"
|
||||||
@ -51,10 +46,7 @@
|
|||||||
class="icon-list"
|
class="icon-list"
|
||||||
></u-icon>
|
></u-icon>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="headerList" :class="headerFlag ? 'tab-bar' : 'tab-bar scroll-hide'">
|
||||||
class="headerList"
|
|
||||||
:class="headerFlag ? 'tab-bar' : 'tab-bar scroll-hide'"
|
|
||||||
>
|
|
||||||
<div class="headerRow">
|
<div class="headerRow">
|
||||||
<div
|
<div
|
||||||
class="nav-item"
|
class="nav-item"
|
||||||
@ -151,10 +143,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<view class="-goods-flex">
|
<view class="-goods-flex">
|
||||||
<!-- 如果有积分显示积分 -->
|
<!-- 如果有积分显示积分 -->
|
||||||
<view
|
<view class="-goods-price" v-if="goodsDetail.price != undefined">
|
||||||
class="-goods-price"
|
|
||||||
v-if="goodsDetail.price != undefined"
|
|
||||||
>
|
|
||||||
<span v-if="pointDetail.points">
|
<span v-if="pointDetail.points">
|
||||||
<span class="price">{{ pointDetail.points }}</span>
|
<span class="price">{{ pointDetail.points }}</span>
|
||||||
<span>积分</span>
|
<span>积分</span>
|
||||||
@ -162,9 +151,7 @@
|
|||||||
|
|
||||||
<span v-else>
|
<span v-else>
|
||||||
<span>¥</span
|
<span>¥</span
|
||||||
><span class="price">{{
|
><span class="price">{{ formatPrice(goodsDetail.price)[0] }}</span
|
||||||
formatPrice(goodsDetail.price)[0]
|
|
||||||
}}</span
|
|
||||||
>.{{ formatPrice(goodsDetail.price)[1] }}
|
>.{{ formatPrice(goodsDetail.price)[1] }}
|
||||||
</span>
|
</span>
|
||||||
</view>
|
</view>
|
||||||
@ -182,10 +169,9 @@
|
|||||||
:color="favorite ? '#f2270c' : '#262626'"
|
:color="favorite ? '#f2270c' : '#262626'"
|
||||||
:name="favorite ? 'heart-fill' : 'heart'"
|
:name="favorite ? 'heart-fill' : 'heart'"
|
||||||
></u-icon>
|
></u-icon>
|
||||||
<view
|
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{
|
||||||
:style="{ color: favorite ? '#f2270c' : '#262626' }"
|
favorite ? "已收藏" : "收藏"
|
||||||
>{{ favorite ? "已收藏" : "收藏" }}</view
|
}}</view>
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="-goods-name desc-bold">
|
<view class="-goods-name desc-bold">
|
||||||
@ -202,14 +188,8 @@
|
|||||||
<view class="card-flex" @click="shutMask(1)">
|
<view class="card-flex" @click="shutMask(1)">
|
||||||
<view class="card-title"> 促销 </view>
|
<view class="card-title"> 促销 </view>
|
||||||
<view class="card-content">
|
<view class="card-content">
|
||||||
<span v-if="PromotionList && emptyPromotion()"
|
<span v-if="PromotionList && emptyPromotion()">暂无促销信息</span>
|
||||||
>暂无促销信息</span
|
<PromotionLayout v-else @shutMasks="shutMask" :res="PromotionList" />
|
||||||
>
|
|
||||||
<PromotionLayout
|
|
||||||
v-else
|
|
||||||
@shutMasks="shutMask"
|
|
||||||
:res="PromotionList"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="card-bottom">
|
<view class="card-bottom">
|
||||||
<u-icon name="more-dot-fill"></u-icon>
|
<u-icon name="more-dot-fill"></u-icon>
|
||||||
@ -225,10 +205,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 配置地址 如果是虚拟产品的时候不展示 -->
|
<!-- 配置地址 如果是虚拟产品的时候不展示 -->
|
||||||
<view
|
<view class="card-box" v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'">
|
||||||
class="card-box"
|
|
||||||
v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'"
|
|
||||||
>
|
|
||||||
<view class="card-flex" @click="shutMask(4)">
|
<view class="card-flex" @click="shutMask(4)">
|
||||||
<view class="card-title"> 已选 </view>
|
<view class="card-title"> 已选 </view>
|
||||||
<view class="card-content">
|
<view class="card-content">
|
||||||
@ -243,25 +220,14 @@
|
|||||||
<u-icon name="more-dot-fill"></u-icon>
|
<u-icon name="more-dot-fill"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="card-flex" @click="shutMask(3)" v-if="ste==1">
|
<view class="card-flex" @click="shutMask(3)">
|
||||||
<view class="card-title"> 送至</view>
|
<view class="card-title"> 送至</view>
|
||||||
<view class="card-content" >
|
<view class="card-content">
|
||||||
<span v-if="delivery">{{
|
<span v-if="delivery">{{
|
||||||
delivery.consigneeAddressPath | clearStrComma
|
delivery.consigneeAddressPath | clearStrComma
|
||||||
}}</span>
|
}}</span>
|
||||||
<span v-else>暂无地址信息</span>
|
<span v-else>暂无地址信息</span>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="card-bottom">
|
|
||||||
<u-icon name="more-dot-fill"></u-icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="card-flex" v-else>
|
|
||||||
<view class="card-title"> 店铺位置</view>
|
|
||||||
<view class="card-content" >
|
|
||||||
{{ addren }}
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="card-bottom">
|
<view class="card-bottom">
|
||||||
<u-icon name="more-dot-fill"></u-icon>
|
<u-icon name="more-dot-fill"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
@ -279,14 +245,14 @@
|
|||||||
:res="recommendList"
|
:res="recommendList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 宝贝详情
|
<!-- 宝贝详情 -->
|
||||||
<GoodsIntro
|
<GoodsIntro
|
||||||
id="main9"
|
id="main9"
|
||||||
:res="goodsDetail"
|
:res="goodsDetail"
|
||||||
:goodsParams="goodsParams"
|
:goodsParams="goodsParams"
|
||||||
:goodsId="goodsDetail.goodsId"
|
:goodsId="goodsDetail.goodsId"
|
||||||
v-if="goodsDetail.id"
|
v-if="goodsDetail.id"
|
||||||
/> -->
|
/>
|
||||||
|
|
||||||
<!-- 宝贝推荐 -->
|
<!-- 宝贝推荐 -->
|
||||||
<GoodsRecommend id="main11" :res="likeGoodsList" />
|
<GoodsRecommend id="main11" :res="likeGoodsList" />
|
||||||
@ -295,10 +261,7 @@
|
|||||||
|
|
||||||
<view class="page-bottom mp-iphonex-bottom" id="pageBottom">
|
<view class="page-bottom mp-iphonex-bottom" id="pageBottom">
|
||||||
<view class="icon-btn">
|
<view class="icon-btn">
|
||||||
<view
|
<view class="icon-btn-item" @click="navigateToStore(goodsDetail.storeId)">
|
||||||
class="icon-btn-item"
|
|
||||||
@click="navigateToStore(goodsDetail.storeId)"
|
|
||||||
>
|
|
||||||
<u-icon size="34" class="red" name="home-fill"></u-icon>
|
<u-icon size="34" class="red" name="home-fill"></u-icon>
|
||||||
<view class="red icon-btn-name">店铺</view>
|
<view class="red icon-btn-name">店铺</view>
|
||||||
</view>
|
</view>
|
||||||
@ -316,24 +279,17 @@
|
|||||||
<view class="detail-btn" v-if="!isGroup">
|
<view class="detail-btn" v-if="!isGroup">
|
||||||
<view
|
<view
|
||||||
class="to-store-car to-store-btn"
|
class="to-store-car to-store-btn"
|
||||||
v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS' && ste==1 "
|
v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'"
|
||||||
@click="shutMask(4)"
|
@click="shutMask(4)"
|
||||||
>
|
>
|
||||||
加入购物车</view
|
加入购物车</view
|
||||||
>
|
>
|
||||||
<view class="to-buy to-store-btn" @click="shutMask(4, 'buy')"
|
<view class="to-buy to-store-btn" @click="shutMask(4, 'buy')">立即购买</view>
|
||||||
>立即购买</view
|
<view class="to-store-car to-store-btn" v-if="startTimer">暂未开始</view>
|
||||||
>
|
|
||||||
<view class="to-store-car to-store-btn" v-if="startTimer"
|
|
||||||
>暂未开始</view
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 拼团结算 -->
|
<!-- 拼团结算 -->
|
||||||
<view class="detail-btn" v-else>
|
<view class="detail-btn" v-else>
|
||||||
<view
|
<view class="to-store-car pt-buy to-store-btn" @click="shutMask(4, 'buy')">
|
||||||
class="to-store-car pt-buy to-store-btn"
|
|
||||||
@click="shutMask(4, 'buy')"
|
|
||||||
>
|
|
||||||
<view>¥{{ goodsDetail.price | unitPrice }}</view>
|
<view>¥{{ goodsDetail.price | unitPrice }}</view>
|
||||||
<view>单独购买</view>
|
<view>单独购买</view>
|
||||||
</view>
|
</view>
|
||||||
@ -402,12 +358,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
/************接口API***************/
|
/************接口API***************/
|
||||||
import {
|
import { getGoods, getGoodsList, getMpScene, getGoodsDistribution } from "@/api/goods.js";
|
||||||
getGoods,
|
|
||||||
getGoodsList,
|
|
||||||
getMpScene,
|
|
||||||
getGoodsDistribution,
|
|
||||||
} from "@/api/goods.js";
|
|
||||||
import * as API_trade from "@/api/trade.js";
|
import * as API_trade from "@/api/trade.js";
|
||||||
import * as API_Members from "@/api/members.js";
|
import * as API_Members from "@/api/members.js";
|
||||||
import * as API_store from "@/api/store.js";
|
import * as API_store from "@/api/store.js";
|
||||||
@ -431,11 +382,8 @@ import popupGoods from "@/components/m-buy/goods"; //购物车商品的模块
|
|||||||
import popupAddress from "./product/popup/address"; //地址选择模块
|
import popupAddress from "./product/popup/address"; //地址选择模块
|
||||||
import shares from "@/components/m-share/index"; //分享
|
import shares from "@/components/m-share/index"; //分享
|
||||||
import popups from "@/components/popups/popups"; //气泡框
|
import popups from "@/components/popups/popups"; //气泡框
|
||||||
import { TUILogin } from "@tencentcloud/tui-core";
|
|
||||||
import { TUIChatKit } from "@/TUIKit";
|
|
||||||
import { getUserimInfo } from "@/api/members";
|
|
||||||
import setup from "./product/popup/popup";
|
import setup from "./product/popup/popup";
|
||||||
TUIChatKit.init();
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
popups,
|
popups,
|
||||||
@ -452,11 +400,9 @@ export default {
|
|||||||
GoodsSwiper,
|
GoodsSwiper,
|
||||||
popupGoods,
|
popupGoods,
|
||||||
popupAddress,
|
popupAddress,
|
||||||
TUIChatKit
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
addren:"",
|
|
||||||
setup,
|
setup,
|
||||||
promotionShow: false, //弹窗开关
|
promotionShow: false, //弹窗开关
|
||||||
promotionFlag: true, //活动开关
|
promotionFlag: true, //活动开关
|
||||||
@ -578,7 +524,6 @@ export default {
|
|||||||
|
|
||||||
routerVal: "",
|
routerVal: "",
|
||||||
IMLink: "", // IM地址
|
IMLink: "", // IM地址
|
||||||
ste:1
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -604,7 +549,6 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.ste=uni.getStorageSync('ste')
|
|
||||||
const { windowHeight } = uni.getSystemInfoSync();
|
const { windowHeight } = uni.getSystemInfoSync();
|
||||||
let bottomHeight = 0;
|
let bottomHeight = 0;
|
||||||
let topHeight = 0;
|
let topHeight = 0;
|
||||||
@ -655,11 +599,7 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.init(
|
this.init(this.routerVal.id, this.routerVal.goodsId, this.routerVal.distributionId);
|
||||||
this.routerVal.id,
|
|
||||||
this.routerVal.goodsId,
|
|
||||||
this.routerVal.distributionId
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
@ -721,8 +661,6 @@ export default {
|
|||||||
}
|
}
|
||||||
/**商品信息以及规格信息存储 */
|
/**商品信息以及规格信息存储 */
|
||||||
this.goodsDetail = response.data.result.data;
|
this.goodsDetail = response.data.result.data;
|
||||||
this.addren= response.data.result.storeAddressPath;
|
|
||||||
|
|
||||||
this.goodsSpec = response.data.result.specs;
|
this.goodsSpec = response.data.result.specs;
|
||||||
this.PromotionList = response.data.result.promotionMap;
|
this.PromotionList = response.data.result.promotionMap;
|
||||||
this.goodsParams = response.data.result.goodsParamsDTOList || [];
|
this.goodsParams = response.data.result.goodsParamsDTOList || [];
|
||||||
@ -759,7 +697,7 @@ export default {
|
|||||||
this.getGoodsCollectionFun(this.goodsDetail.id);
|
this.getGoodsCollectionFun(this.goodsDetail.id);
|
||||||
}
|
}
|
||||||
// 获取IM 需要的话使用
|
// 获取IM 需要的话使用
|
||||||
this.getIMDetailMethods();
|
// this.getIMDetailMethods();
|
||||||
},
|
},
|
||||||
|
|
||||||
async getIMDetailMethods() {
|
async getIMDetailMethods() {
|
||||||
@ -770,38 +708,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
linkMsgDetail() {
|
linkMsgDetail() {
|
||||||
// storage.getUserInfo
|
|
||||||
getUserimInfo()
|
|
||||||
.then(({ data }) => {
|
|
||||||
if (data.success ) {
|
|
||||||
const par = data.result;
|
|
||||||
TUILogin.login({
|
|
||||||
SDKAppID: par.sdkAppId,
|
|
||||||
userID: par.userID,
|
|
||||||
userSig: par.userSig,
|
|
||||||
useUploadPlugin: true, // If you need to send rich media messages, please set to true.
|
|
||||||
framework: `vue2`, // framework used vue2 / vue3
|
|
||||||
}).then(() => {
|
|
||||||
const conversationID = `C2C${this.goodsDetail.createBy}`;
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/TUIKit/components/TUIChat/index?conversationID=${conversationID}`,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// 接口返回非 200 状态码,跳转登录页面
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/passport/login",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
// 请求失败,跳转登录页面
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/passport/login",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
return;
|
|
||||||
if (this.storeDetail.merchantEuid) {
|
if (this.storeDetail.merchantEuid) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/tabbar/home/web-view?src=${this.IM}`,
|
url: `/pages/tabbar/home/web-view?src=${this.IM}`,
|
||||||
@ -842,7 +748,6 @@ export default {
|
|||||||
if (typeof val == "undefined") {
|
if (typeof val == "undefined") {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
return val.toFixed(2).split(".");
|
return val.toFixed(2).split(".");
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -975,7 +880,6 @@ export default {
|
|||||||
keyword: this.goodsDetail.name,
|
keyword: this.goodsDetail.name,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.likeGoodsList = res.data.result.content;
|
this.likeGoodsList = res.data.result.content;
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
:fade="true"
|
:fade="true"
|
||||||
duration="450"
|
duration="450"
|
||||||
:lazy-load="true"
|
:lazy-load="true"
|
||||||
:src="imgfun(item.content.thumbnail)"
|
:src="item.content.thumbnail"
|
||||||
width="330rpx"
|
width="330rpx"
|
||||||
height="330rpx"
|
height="330rpx"
|
||||||
class="like-goods-uimage"
|
class="like-goods-uimage"
|
||||||
@ -40,9 +40,6 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: ["res"],
|
props: ["res"],
|
||||||
mounted() {
|
|
||||||
console.log(this.res);
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
// 点击店铺推荐
|
// 点击店铺推荐
|
||||||
clickGoods(val) {
|
clickGoods(val) {
|
||||||
|
|||||||
@ -3,12 +3,7 @@
|
|||||||
<!-- 商店信息 -->
|
<!-- 商店信息 -->
|
||||||
<view class="store-info">
|
<view class="store-info">
|
||||||
<view class="logo">
|
<view class="logo">
|
||||||
<u-image
|
<u-image width="120rpx" mode="aspectFit" height="120rpx" :src="storeDetail.storeLogo"></u-image>
|
||||||
width="120rpx"
|
|
||||||
mode="aspectFit"
|
|
||||||
height="120rpx"
|
|
||||||
:src="storeDetail.storeLogo"
|
|
||||||
></u-image>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="name-star star-con">
|
<view class="name-star star-con">
|
||||||
<div class="name">
|
<div class="name">
|
||||||
@ -16,9 +11,7 @@
|
|||||||
<span v-if="storeDetail.selfOperated == 1" class="shopTag">自营</span>
|
<span v-if="storeDetail.selfOperated == 1" class="shopTag">自营</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="store-row">
|
<div class="store-row">
|
||||||
<div class="collectionNum">
|
<div class="collectionNum">{{ storeDetail.collectionNum || 0 }}人关注</div>
|
||||||
{{ storeDetail.collectionNum || 0 }}人关注
|
|
||||||
</div>
|
|
||||||
<div class="goodsNum">{{ storeDetail.goodsNum || 0 }}件商品</div>
|
<div class="goodsNum">{{ storeDetail.goodsNum || 0 }}件商品</div>
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
@ -30,31 +23,16 @@
|
|||||||
<view class="store-recommend">
|
<view class="store-recommend">
|
||||||
<view class="store-recommend-title">商品推荐</view>
|
<view class="store-recommend-title">商品推荐</view>
|
||||||
<view class="recommend-list">
|
<view class="recommend-list">
|
||||||
<view
|
<view class="recommend-item" @click="clickGoods(item)" v-for="(item, index) in res" :key="index">
|
||||||
class="recommend-item"
|
<u-image class="recommend-item-img" :fade="true" duration="450" :lazy-load="true" :src="item.content.thumbnail" height="218rpx">
|
||||||
@click="clickGoods(item)"
|
|
||||||
v-for="(item, index) in res"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<u-image
|
|
||||||
class="recommend-item-img"
|
|
||||||
:fade="true"
|
|
||||||
duration="450"
|
|
||||||
:lazy-load="true"
|
|
||||||
:src="imgfun(item.content.thumbnail)"
|
|
||||||
height="218rpx"
|
|
||||||
>
|
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
<view slot="error" style="font-size: 24rpx">加载失败</view>
|
<view slot="error" style="font-size: 24rpx; ">加载失败</view>
|
||||||
</u-image>
|
</u-image>
|
||||||
<view class="recommend-item-name">
|
<view class="recommend-item-name">
|
||||||
{{ item.content.goodsName }}
|
{{ item.content.goodsName }}
|
||||||
</view>
|
</view>
|
||||||
<view class="item-price" v-if="item.price != undefined">
|
<view class="item-price" v-if="item.price != undefined">
|
||||||
¥<span class="item-price-blod">{{
|
¥<span class="item-price-blod">{{ formatPrice(item.content.price)[0] }}</span>.{{ formatPrice(item.content.price)[1] }}
|
||||||
formatPrice(item.content.price)[0]
|
|
||||||
}}</span
|
|
||||||
>.{{ formatPrice(item.content.price)[1] }}
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -36,11 +36,10 @@ page {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
> .to-buy {
|
> .to-buy {
|
||||||
background-color: #fe3c3c;
|
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
|
||||||
|
|
||||||
}
|
}
|
||||||
> .to-store-car {
|
> .to-store-car {
|
||||||
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
|
background-image: linear-gradient(135deg, #f2140c, #f2270c 70%, #f24d0c);
|
||||||
}
|
}
|
||||||
> .to-store-btn {
|
> .to-store-btn {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|||||||
@ -1,49 +1,30 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<u-navbar :border-bottom="false">
|
<u-navbar :border-bottom="false">
|
||||||
<u-search
|
<u-search v-model="keyword" @search="search" @click="search" placeholder="请输入搜索"></u-search>
|
||||||
v-model="keyword"
|
|
||||||
@search="search"
|
|
||||||
@click="search"
|
|
||||||
placeholder="请输入搜索"
|
|
||||||
></u-search>
|
|
||||||
</u-navbar>
|
</u-navbar>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<!-- 店铺信息模块 -->
|
<!-- 店铺信息模块 -->
|
||||||
<div class="store flex">
|
<div class="store flex">
|
||||||
<u-image
|
<u-image border-radius="10" width="150" height="150" :src="storeInfo.storeLogo || config.logo" mode="aspectFit">
|
||||||
border-radius="10"
|
|
||||||
width="150"
|
|
||||||
height="150"
|
|
||||||
:src="storeInfo.storeLogo || config.logo"
|
|
||||||
mode="aspectFit"
|
|
||||||
>
|
|
||||||
</u-image>
|
</u-image>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="store-name" @click="getStoreLicencePhoto">
|
<div class="store-name" @click="getStoreLicencePhoto">
|
||||||
{{ storeInfo.storeName || "" }}
|
{{ storeInfo.storeName || ''}}
|
||||||
<u-icon style="margin-left: 10rpx" name="arrow-right"></u-icon>
|
<u-icon style="margin-left:10rpx;" name="arrow-right"></u-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex store-message">
|
<div class="flex store-message">
|
||||||
<div>
|
<div> <span>{{ storeInfo.collectionNum || 0 }}</span>关注 </div>
|
||||||
<span>{{ storeInfo.collectionNum || 0 }}</span
|
<div> <span>{{ storeInfo.goodsNum || 0 }}</span>件商品 </div>
|
||||||
>关注
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span>{{ storeInfo.goodsNum || 0 }}</span
|
|
||||||
>件商品
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="collection">
|
<div class="collection">
|
||||||
<div class="collection-btn" @click="whetherCollection">
|
<div class="collection-btn" @click="whetherCollection"> {{ isCollection ? '已关注' : '+ 关注' }}</div>
|
||||||
{{ isCollection ? "已关注" : "+ 关注" }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 店铺简介 -->
|
<!-- 店铺简介 -->
|
||||||
<div class="store-desc wes-2">
|
<div class="store-desc wes-2">
|
||||||
{{ storeInfo.storeDesc }}
|
{{storeInfo.storeDesc}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 联系客服 -->
|
<!-- 联系客服 -->
|
||||||
@ -53,25 +34,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 优惠券 -->
|
<!-- 优惠券 -->
|
||||||
<scroll-view
|
<scroll-view scroll-x="true" show-scrollbar="false" class="discount" v-if="couponList.length > 0">
|
||||||
scroll-x="true"
|
|
||||||
show-scrollbar="false"
|
|
||||||
class="discount"
|
|
||||||
v-if="couponList.length > 0"
|
|
||||||
>
|
|
||||||
<view class="card-box" v-for="(item, index) in couponList" :key="index">
|
<view class="card-box" v-for="(item, index) in couponList" :key="index">
|
||||||
<view class="card" @click="getCoupon(item)">
|
<view class="card" @click="getCoupon(item)">
|
||||||
<view class="money">
|
<view class="money">
|
||||||
<view>
|
<view>
|
||||||
<span v-if="item.couponType == 'DISCOUNT'"
|
<span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}折</span>
|
||||||
>{{ item.couponDiscount }}折</span
|
|
||||||
>
|
|
||||||
<span v-else>{{ item.price }}元</span>
|
<span v-else>{{ item.price }}元</span>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="xian"></view>
|
<view class="xian"></view>
|
||||||
<view class="text">
|
<view class="text">
|
||||||
<text>{{ "领取优惠券" }}</text>
|
<text>{{'领取优惠券'}}</text>
|
||||||
<text>满{{ item.consumeThreshold | unitPrice }}元可用</text>
|
<text>满{{ item.consumeThreshold | unitPrice }}元可用</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -79,31 +54,14 @@
|
|||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
||||||
<!-- tab -->
|
<!-- tab -->
|
||||||
<u-tabs
|
<u-tabs :list="tabs" :active-color="mainColor" :is-scroll="false" :current="current" @change="changeTab"></u-tabs>
|
||||||
:list="tabs"
|
|
||||||
:active-color="mainColor"
|
|
||||||
:is-scroll="false"
|
|
||||||
:current="current"
|
|
||||||
@change="changeTab"
|
|
||||||
></u-tabs>
|
|
||||||
<!-- menu -->
|
<!-- menu -->
|
||||||
|
|
||||||
<!-- 商品 -->
|
<!-- 商品 -->
|
||||||
<div class="contant" v-if="current == 0">
|
<div class="contant" v-if="current == 0">
|
||||||
<view v-if="!goodsList.length" class="empty">暂无商品信息</view>
|
<view v-if="!goodsList.length" class="empty">暂无商品信息</view>
|
||||||
<view
|
<view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)">
|
||||||
v-else
|
<u-image width="100%" height="330rpx" mode="aspectFit" :src="item.content.thumbnail">
|
||||||
class="item"
|
|
||||||
v-for="(item, index) in goodsList"
|
|
||||||
:key="index"
|
|
||||||
@click="navigateToGoodsDetail(item)"
|
|
||||||
>
|
|
||||||
<u-image
|
|
||||||
width="100%"
|
|
||||||
height="330rpx"
|
|
||||||
mode="aspectFit"
|
|
||||||
:src="imgfun(item.content.thumbnail)"
|
|
||||||
>
|
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
</u-image>
|
</u-image>
|
||||||
<div class="name wes-2">{{ item.content.goodsName }}</div>
|
<div class="name wes-2">{{ item.content.goodsName }}</div>
|
||||||
@ -117,28 +75,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 全部分类 -->
|
<!-- 全部分类 -->
|
||||||
<div class="category" v-if="current == 1">
|
<div class="category" v-if="current == 1">
|
||||||
<div
|
<div class="category-item" v-for="(item,index) in categoryList" :key="index">
|
||||||
class="category-item"
|
|
||||||
v-for="(item, index) in categoryList"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<div class="flex" @click="getCategoryGoodsList(item)">
|
<div class="flex" @click="getCategoryGoodsList(item)">
|
||||||
<div>{{ item.labelName }}</div>
|
<div>{{item.labelName}}</div>
|
||||||
<div>
|
<div>
|
||||||
<u-icon color="#999" name="arrow-right"></u-icon>
|
<u-icon color="#999" name="arrow-right"></u-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 分类子级 -->
|
<!-- 分类子级 -->
|
||||||
<div
|
<div class="child-list" v-if="item.children && item.children.length!=0">
|
||||||
class="child-list"
|
<div class="child" @click="getCategoryGoodsList(child)" v-for="(child,i) in item.children">{{child.labelName}}
|
||||||
v-if="item.children && item.children.length != 0"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="child"
|
|
||||||
@click="getCategoryGoodsList(child)"
|
|
||||||
v-for="(child, i) in item.children"
|
|
||||||
>
|
|
||||||
{{ child.labelName }}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -155,15 +101,10 @@ import {
|
|||||||
collectionGoods,
|
collectionGoods,
|
||||||
getGoodsIsCollect,
|
getGoodsIsCollect,
|
||||||
} from "@/api/members.js";
|
} from "@/api/members.js";
|
||||||
import { TUILogin } from "@tencentcloud/tui-core";
|
|
||||||
import { TUIChatKit } from "@/TUIKit";
|
|
||||||
import { getUserimInfo } from "@/api/members";
|
|
||||||
import config from "@/config/config";
|
import config from "@/config/config";
|
||||||
import storage from "@/utils/storage";
|
import storage from "@/utils/storage";
|
||||||
import { getGoodsList } from "@/api/goods.js";
|
import { getGoodsList } from "@/api/goods.js";
|
||||||
import { getAllCoupons } from "@/api/promotions.js";
|
import { getAllCoupons } from "@/api/promotions.js";
|
||||||
import setup from "./product/popup/popup";
|
|
||||||
TUIChatKit.init();
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -185,12 +126,7 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
current(val) {
|
current(val) {
|
||||||
val == 0
|
val == 0 ? ()=>{ this.goodsList = []; this.getGoodsData()} : this.getCategoryData();
|
||||||
? () => {
|
|
||||||
this.goodsList = [];
|
|
||||||
this.getGoodsData();
|
|
||||||
}
|
|
||||||
: this.getCategoryData();
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -252,61 +188,30 @@ export default {
|
|||||||
* 联系客服
|
* 联系客服
|
||||||
*/
|
*/
|
||||||
linkKefuDetail() {
|
linkKefuDetail() {
|
||||||
getUserimInfo()
|
// 客服
|
||||||
.then(({ data }) => {
|
// #ifdef MP-WEIXIN
|
||||||
console.log("data", data);
|
|
||||||
if (data.success) {
|
|
||||||
const par = data.result;
|
|
||||||
TUILogin.login({
|
|
||||||
SDKAppID: par.sdkAppId,
|
|
||||||
userID: par.userID,
|
|
||||||
userSig: par.userSig,
|
|
||||||
useUploadPlugin: true, // If you need to send rich media messages, please set to true.
|
|
||||||
framework: `vue2`, // framework used vue2 / vue3
|
|
||||||
}).then(() => {
|
|
||||||
const conversationID = `C2C${this.storeInfo.memberMobile}`;
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/TUIKit/components/TUIChat/index?conversationID=${conversationID}`,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// 接口返回非 200 状态码,跳转登录页面
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/passport/login",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.log("err---------", err);
|
|
||||||
// 请求失败,跳转登录页面
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/passport/login",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
// // 客服
|
|
||||||
// // #ifdef MP-WEIXIN
|
|
||||||
|
|
||||||
// const params = {
|
const params = {
|
||||||
// // originalPrice: this.goodsDetail.original || this.goodsDetail.price,
|
// originalPrice: this.goodsDetail.original || this.goodsDetail.price,
|
||||||
// uuid: storage.getUuid(),
|
uuid: storage.getUuid(),
|
||||||
// token: storage.getAccessToken(),
|
token: storage.getAccessToken(),
|
||||||
// sign: this.storeInfo.yzfSign,
|
sign: this.storeInfo.yzfSign,
|
||||||
// mpSign: this.storeInfo.yzfMpSign,
|
mpSign: this.storeInfo.yzfMpSign,
|
||||||
// };
|
};
|
||||||
// uni.navigateTo({
|
uni.navigateTo({
|
||||||
// url:
|
url:
|
||||||
// "/pages/product/customerservice/index?params=" +
|
"/pages/product/customerservice/index?params=" +
|
||||||
// encodeURIComponent(JSON.stringify(params)),
|
encodeURIComponent(JSON.stringify(params)),
|
||||||
// });
|
});
|
||||||
// // #endif
|
// #endif
|
||||||
// // #ifndef MP-WEIXIN
|
// #ifndef MP-WEIXIN
|
||||||
// const sign = this.storeInfo.yzfSign;
|
const sign = this.storeInfo.yzfSign;
|
||||||
// uni.navigateTo({
|
uni.navigateTo({
|
||||||
// url:
|
url:
|
||||||
// "/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
|
"/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
|
||||||
// sign,
|
sign,
|
||||||
// });
|
});
|
||||||
// // #endif
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 获取店铺分类 */
|
/** 获取店铺分类 */
|
||||||
@ -642,4 +547,4 @@ export default {
|
|||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -5,7 +5,7 @@
|
|||||||
<div class="contant">
|
<div class="contant">
|
||||||
<view v-if="!goodsList.length" class="empty">暂无商品信息</view>
|
<view v-if="!goodsList.length" class="empty">暂无商品信息</view>
|
||||||
<view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)">
|
<view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)">
|
||||||
<u-image width="100%" mode="aspectFit" height="324rpx" :src="imgfun(item.content.thumbnail)">
|
<u-image width="100%" mode="aspectFit" height="324rpx" :src="item.content.thumbnail">
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
</u-image>
|
</u-image>
|
||||||
<div class="name">{{ item.content.goodsName }}</div>
|
<div class="name">{{ item.content.goodsName }}</div>
|
||||||
|
|||||||
@ -1,50 +1,31 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<!-- 楼层装修组件 -->
|
<!-- 楼层装修组件 -->
|
||||||
<!-- <u-navbar class="navbar" :is-back="false" :is-fixed="false">
|
<u-navbar class="navbar" :is-back="false" :is-fixed="false">
|
||||||
<div class="tab-container">
|
<div class="tab-container">
|
||||||
<div
|
<div
|
||||||
v-for="(item, index) in list1"
|
v-for="(item, index) in list1"
|
||||||
:key="index"
|
:key="index"
|
||||||
:class="{ active: currentTabIndex === index }"
|
:class="{ active: currentTabIndex === index }"
|
||||||
@click="click(item)"
|
@click="click(item)"
|
||||||
>
|
>
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</u-navbar> -->
|
</div>
|
||||||
<!-- <u-tabs-swiper ref="tabs" :list="list" :is-scroll="true" current="0"></u-tabs-swiper> -->
|
</u-navbar>
|
||||||
<u-tabs
|
|
||||||
name="cate_name"
|
|
||||||
count="cate_count"
|
|
||||||
:list="list"
|
|
||||||
:is-scroll="false"
|
|
||||||
:current="current"
|
|
||||||
@change="change"
|
|
||||||
></u-tabs>
|
|
||||||
|
|
||||||
<!-- 商城 -->
|
<!-- 商城 -->
|
||||||
<tpl ref="tpl" v-if="currentTabIndex == 1" :ste="1" />
|
<tpl ref="tpl" v-if="currentTabIndex == 1" :ste="1" />
|
||||||
<!-- 本地生活 -->
|
<!-- 本地生活 -->
|
||||||
<tpl ref="childComp" v-if="currentTabIndex == 0" :loadMore="loadMore" :ste="0" />
|
<tpl ref="tpl" v-if="currentTabIndex == 0" :ste="0" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import tpl from "@/pages/tabbar/home/views.vue";
|
import tpl from "@/pages/tabbar/home/views.vue";
|
||||||
import Views from "./views.vue";
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [
|
|
||||||
{
|
|
||||||
name: "本地生活",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "商城",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
current: 0,
|
|
||||||
|
|
||||||
background: {
|
background: {
|
||||||
backgroundColor: "#fff",
|
backgroundColor: "#fff",
|
||||||
},
|
},
|
||||||
@ -57,49 +38,46 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
currentTabIndex: 0,
|
currentTabIndex: 0,
|
||||||
current: 0, // tabs组件的current值,表示当前活动的tab选项
|
|
||||||
swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
|
|
||||||
loadMore: false, // 本地触底加载更多
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
tpl,
|
tpl,
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
|
||||||
console.log("触底了");
|
|
||||||
this.loadMore = !this.loadMore;
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
change(index) {
|
click(item) {
|
||||||
this.current = index;
|
this.currentTabIndex = this.list1.indexOf(item);
|
||||||
this.currentTabIndex = index;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.$refs.tpl.init();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.tab-container {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
// background-color: #f0f0f0;
|
||||||
|
// padding: 0 16rpx 0 0;
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
.tab-container div {
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 5px 10px;
|
||||||
|
}
|
||||||
.tab-container div.active {
|
.tab-container div.active {
|
||||||
border-bottom: 2px solid #f50505;
|
border-bottom: 2px solid #F50505;
|
||||||
color: #f50505;
|
color:#F50505;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
.wrapper {
|
.wrapper {
|
||||||
// background: red;
|
// background: red;
|
||||||
}
|
}
|
||||||
.navbar {
|
.navbar{
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
::v-deep {
|
|
||||||
.u-tabs {
|
|
||||||
padding: 25px 20px 0px 20px;
|
|
||||||
}
|
|
||||||
.u-tab-item {
|
|
||||||
color: $main-color !important;
|
|
||||||
}
|
|
||||||
.u-tab-bar {
|
|
||||||
background-color: $light-color !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
<div class="menu-list" style="overflow-x: auto; white-space: nowrap; scrollbar-width: none; -ms-overflow-style: none;">
|
<div class="menu-list" style="overflow-x: auto; white-space: nowrap; scrollbar-width: none; -ms-overflow-style: none;">
|
||||||
<div class="menu-item" v-for="(item, index) in res.list" :key="index">
|
<div class="menu-item" v-for="(item, index) in res.list" :key="index">
|
||||||
<div>
|
<div>
|
||||||
<img class="menu-img" :src="item.img" alt="" @click="modelNavigateTo(item)" />
|
<img class="menu-img" :src="item.img" alt="" @click="tostorePage(item)" />
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="menu-title">{{ item.title }}</div> -->
|
<!-- <div class="menu-title">{{ item.title }}</div> -->
|
||||||
</div>
|
</div>
|
||||||
@ -22,11 +22,6 @@
|
|||||||
import { modelNavigateTo } from "./tpl";
|
import { modelNavigateTo } from "./tpl";
|
||||||
export default {
|
export default {
|
||||||
title: "达人店",
|
title: "达人店",
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
modelNavigateTo,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: ["res","model"],
|
props: ["res","model"],
|
||||||
watch: {
|
watch: {
|
||||||
res: {
|
res: {
|
||||||
@ -39,8 +34,6 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
//跳转个人店铺
|
//跳转个人店铺
|
||||||
tostorePage(val) {
|
tostorePage(val) {
|
||||||
console.log(val);
|
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/product/shopPage?id=" + val.url.id,
|
url: "/pages/product/shopPage?id=" + val.url.id,
|
||||||
});
|
});
|
||||||
@ -98,8 +91,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.menu-img {
|
.menu-img {
|
||||||
width: 80px;
|
width: 60px;
|
||||||
height: 80px;
|
height: 60px;
|
||||||
}
|
}
|
||||||
.menu-title {
|
.menu-title {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
|||||||
@ -1,31 +0,0 @@
|
|||||||
.image-mode {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
display: block;
|
|
||||||
padding: 2rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.layout {
|
|
||||||
padding: 16rpx 0rpx 16rpx 0rpx;
|
|
||||||
margin: 8rpx 0;
|
|
||||||
background: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.layout,
|
|
||||||
.view-height-75,
|
|
||||||
.view-height-150 {
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.view-width-100 {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.view-height-150 {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.view-height-85 {
|
|
||||||
height: 170rpx;
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
@ -5,7 +5,7 @@
|
|||||||
padding: 2rpx;
|
padding: 2rpx;
|
||||||
}
|
}
|
||||||
.layout {
|
.layout {
|
||||||
padding: 16rpx 0rpx 16rpx 0rpx;
|
padding: 16rpx;
|
||||||
margin: 8rpx 0;
|
margin: 8rpx 0;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<div class="addres" @click="showPicker" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
|
<div class="addres" @click="showPicker" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
|
||||||
{{ cityOrCounty == "" ? "请选择" : cityOrCounty }}
|
{{ cityOrCounty == "" ? "请选择" : cityOrCounty }}
|
||||||
</div>
|
</div>
|
||||||
<div class="search" @click="handleSearch">{{ res.list[0].title }}</div>
|
<div class="search">{{ res.list[0].title }}</div>
|
||||||
<div class="shop" @click="toshop"></div>
|
<div class="shop" @click="toshop"></div>
|
||||||
<m-city
|
<m-city
|
||||||
:provinceData="list"
|
:provinceData="list"
|
||||||
|
|||||||
@ -1,13 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="layout">
|
<div class="layout">
|
||||||
<div
|
<div v-for="item in list" :key="item.id" class="shop" @click="handleClick(item)">
|
||||||
v-for="item in list"
|
|
||||||
:key="item.id"
|
|
||||||
class="shop"
|
|
||||||
@click="handleClick(item)"
|
|
||||||
>
|
|
||||||
<div class="pl_img">
|
<div class="pl_img">
|
||||||
<img :src="imgfun(item.thumbnail)" alt="" />
|
<img :src="item.thumbnail" alt="" />
|
||||||
<div class="price" style="font-size: 20px">
|
<div class="price" style="font-size: 20px">
|
||||||
<div>价格:{{ item.price }}¥</div>
|
<div>价格:{{ item.price }}¥</div>
|
||||||
<div>限量:{{ item.geQuantity }}</div>
|
<div>限量:{{ item.geQuantity }}</div>
|
||||||
@ -26,7 +21,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import * as API_home from "@/api/home";
|
import * as API_home from "@/api/home";
|
||||||
export default {
|
export default {
|
||||||
props: ["res","loadMore"],
|
props: ["res"],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [],
|
list: [],
|
||||||
@ -36,25 +31,12 @@ export default {
|
|||||||
loadMoreStatus: "more", // 加载更多状态
|
loadMoreStatus: "more", // 加载更多状态
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
|
||||||
console.log("触底了");
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
loadMore: {
|
|
||||||
handler(val) {
|
|
||||||
// this.loadMon()
|
|
||||||
},
|
|
||||||
deep: true
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getlist();
|
this.getlist();
|
||||||
// 移除原有的滚动监听
|
window.addEventListener("scroll", this.handleScroll);
|
||||||
// window.addEventListener('scroll', this.handleScroll);
|
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
// 移除原有的滚动监听
|
window.removeEventListener("scroll", this.handleScroll);
|
||||||
// window.removeEventListener('scroll', this.handleScroll);
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getlist() {
|
getlist() {
|
||||||
@ -92,15 +74,6 @@ export default {
|
|||||||
this.getlist();
|
this.getlist();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loadMon() {
|
|
||||||
if (this.total == this.list.length) {
|
|
||||||
this.loadMoreStatus = "noMore";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.loadMoreStatus = "loading";
|
|
||||||
this.pageNumber++;
|
|
||||||
this.getlist();
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,42 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<!-- uni 中不能使用 vue component 所以用if判断每个组件 -->
|
<!-- uni 中不能使用 vue component 所以用if判断每个组件 -->
|
||||||
<div v-for="(item, index) in pageData.list" :key="index">
|
<div v-for="(item,index) in pageData.list" :key="index">
|
||||||
<!-- 搜索栏,如果在楼层装修顶部则会自动浮动,否则不浮动 -->
|
<!-- 搜索栏,如果在楼层装修顶部则会自动浮动,否则不浮动 -->
|
||||||
<div
|
<div class="navbar" v-if="item.type == 'search'" :is-back="false" :is-fixed="false">
|
||||||
class="navbar"
|
<search style="width:100%" :res="item.options" />
|
||||||
v-if="item.type == 'search'"
|
|
||||||
:is-back="false"
|
|
||||||
:is-fixed="false"
|
|
||||||
>
|
|
||||||
<search style="width: 100%" :res="item.options" />
|
|
||||||
<!-- #ifndef H5 -->
|
<!-- #ifndef H5 -->
|
||||||
<!-- 扫码功能 不兼容h5 详情文档: https://uniapp.dcloud.io/api/system/barcode?id=scancode -->
|
<!-- 扫码功能 不兼容h5 详情文档: https://uniapp.dcloud.io/api/system/barcode?id=scancode -->
|
||||||
<!-- <div slot="right" class="navbar-right">
|
<div slot="right" class="navbar-right">
|
||||||
<u-icon name="scan" @click="scan()" color="#666" size="50"></u-icon>
|
<u-icon name="scan" @click="scan()" color="#666" size="50"></u-icon>
|
||||||
</div> -->
|
</div>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</div>
|
</div>
|
||||||
<carousel v-if="item.type == 'carousel'" :res="item.options" />
|
<carousel v-if="item.type == 'carousel'" :res="item.options" />
|
||||||
<titleLayout v-if="item.type == 'title'" :res="item.options" />
|
<titleLayout v-if="item.type == 'title'" :res="item.options" />
|
||||||
<leftOneRightTwo
|
<leftOneRightTwo v-if="item.type == 'leftOneRightTwo'" :res="item.options" />
|
||||||
v-if="item.type == 'leftOneRightTwo'"
|
<leftTwoRightOne v-if="item.type == 'leftTwoRightOne'" :res="item.options" />
|
||||||
:res="item.options"
|
<topOneBottomTwo v-if="item.type == 'topOneBottomTwo'" :res="item.options" />
|
||||||
/>
|
<topTwoBottomOne v-if="item.type == 'topTwoBottomOne'" :res="item.options" />
|
||||||
<leftTwoRightOne
|
|
||||||
v-if="item.type == 'leftTwoRightOne'"
|
|
||||||
:res="item.options"
|
|
||||||
/>
|
|
||||||
<topOneBottomTwo
|
|
||||||
v-if="item.type == 'topOneBottomTwo'"
|
|
||||||
:res="item.options"
|
|
||||||
/>
|
|
||||||
<topTwoBottomOne
|
|
||||||
v-if="item.type == 'topTwoBottomOne'"
|
|
||||||
:res="item.options"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<flexThree v-if="item.type == 'flexThree'" :res="item.options" />
|
<flexThree v-if="item.type == 'flexThree'" :res="item.options" />
|
||||||
<flexFive v-if="item.type == 'flexFive'" :res="item.options" />
|
<flexFive v-if="item.type == 'flexFive'" :res="item.options" />
|
||||||
<flexFour v-if="item.type == 'flexFour'" :res="item.options" />
|
<flexFour v-if="item.type == 'flexFour'" :res="item.options" />
|
||||||
<flexTwo v-if="item.type == 'flexTwo'" :res="item.options" />
|
<flexTwo v-if="item.type == 'flexTwo'" :res="item.options" />
|
||||||
@ -46,11 +31,12 @@
|
|||||||
<activity v-if="item.type == 'activity'" :res="item.options" />
|
<activity v-if="item.type == 'activity'" :res="item.options" />
|
||||||
<Talent v-if="item.type == 'talent'" :res="item.options" :model="item" />
|
<Talent v-if="item.type == 'talent'" :res="item.options" :model="item" />
|
||||||
<goods v-if="item.type == 'goods'" :res="item.options" />
|
<goods v-if="item.type == 'goods'" :res="item.options" />
|
||||||
<shop v-if="item.type == 'shop'" :loadMore="loadMore" :res="item.options" />
|
<shop v-if="item.type == 'shop'" :res="item.options" />
|
||||||
<group v-if="item.type == 'group'" :res="item.options" />
|
<group v-if="item.type == 'group'" :res="item.options" />
|
||||||
<!-- <joinGroup v-if="item.type == 'joinGroup'" :res="item.options" /> -->
|
<!-- <joinGroup v-if="item.type == 'joinGroup'" :res="item.options" /> -->
|
||||||
<!-- <integral v-if="item.type == 'integral'" :res="item.options" /> -->
|
<!-- <integral v-if="item.type == 'integral'" :res="item.options" /> -->
|
||||||
<!-- <spike v-if="item.type == 'spike'" :res="item.options" /> -->
|
<!-- <spike v-if="item.type == 'spike'" :res="item.options" /> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<u-no-network></u-no-network>
|
<u-no-network></u-no-network>
|
||||||
</div>
|
</div>
|
||||||
@ -78,10 +64,9 @@ import Talent from "@/pages/tabbar/home/template/Talent"; //达人店
|
|||||||
import tpl_activity from "@/pages/tabbar/home/template/tpl_activity"; //活动
|
import tpl_activity from "@/pages/tabbar/home/template/tpl_activity"; //活动
|
||||||
import tpl_shop from "@/pages/tabbar/home/template/tpl_shop"; //活动
|
import tpl_shop from "@/pages/tabbar/home/template/tpl_shop"; //活动
|
||||||
// 结束引用组件
|
// 结束引用组件
|
||||||
import { getFloorData, getFloorgetBendi } from "@/api/home"; //获取楼层装修接口
|
import { getFloorData ,getFloorgetBendi} from "@/api/home"; //获取楼层装修接口
|
||||||
import permision from "@/js_sdk/wa-permission/permission.js"; //权限工具类
|
import permision from "@/js_sdk/wa-permission/permission.js"; //权限工具类
|
||||||
import config from "@/config/config";
|
import config from "@/config/config";
|
||||||
import { nextTick } from "vue";
|
|
||||||
// TODO 后续开发
|
// TODO 后续开发
|
||||||
// import tpl_join_group from "@/pages/tabbar/home/template/tpl_join_group";
|
// import tpl_join_group from "@/pages/tabbar/home/template/tpl_join_group";
|
||||||
// import tpl_integral from "@/pages/tabbar/home/template/tpl_integral";
|
// import tpl_integral from "@/pages/tabbar/home/template/tpl_integral";
|
||||||
@ -114,7 +99,7 @@ export default {
|
|||||||
group: tpl_group,
|
group: tpl_group,
|
||||||
Talent,
|
Talent,
|
||||||
activity: tpl_activity,
|
activity: tpl_activity,
|
||||||
shop: tpl_shop,
|
shop:tpl_shop
|
||||||
// spike: tpl_spike,
|
// spike: tpl_spike,
|
||||||
// joinGroup: tpl_join_group,
|
// joinGroup: tpl_join_group,
|
||||||
// integral: tpl_integral,
|
// integral: tpl_integral,
|
||||||
@ -123,20 +108,15 @@ export default {
|
|||||||
ste: {
|
ste: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
loadMore: {
|
|
||||||
type: Boolean,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
ste(val) {
|
ste(val) {
|
||||||
this.init();
|
this.init();
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
// 小程序默认分享
|
// 小程序默认分享
|
||||||
uni.showShareMenu({ withShareTicket: true });
|
uni.showShareMenu({ withShareTicket: true });
|
||||||
@ -145,29 +125,29 @@ export default {
|
|||||||
// provide() {
|
// provide() {
|
||||||
// return {
|
// return {
|
||||||
// ste: this.ste,
|
// ste: this.ste,
|
||||||
// };
|
// };
|
||||||
// },
|
// },
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* 实例化首页数据楼层
|
* 实例化首页数据楼层
|
||||||
*/
|
*/
|
||||||
init() {
|
init() {
|
||||||
uni.setStorageSync("ste", this.ste); // 存储 ste 的值
|
uni.setStorageSync('ste', this.ste); // 存储 ste 的值
|
||||||
this.pageData = "";
|
this.pageData = "";
|
||||||
if (this.ste == 1) {
|
if (this.ste == 1) {
|
||||||
getFloorData().then((res) => {
|
getFloorData().then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.pageData = JSON.parse(res.data.result.pageData);
|
this.pageData = JSON.parse(res.data.result.pageData);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
}else{
|
||||||
getFloorgetBendi().then((res) => {
|
getFloorgetBendi().then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.pageData = JSON.parse(res.data.result.pageData);
|
this.pageData = JSON.parse(res.data.result.pageData);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -184,7 +164,7 @@ export default {
|
|||||||
let path = encodeURIComponent(res.result);
|
let path = encodeURIComponent(res.result);
|
||||||
// WX_CODE 为小程序码
|
// WX_CODE 为小程序码
|
||||||
if (res.scanType == "WX_CODE") {
|
if (res.scanType == "WX_CODE") {
|
||||||
console.log(res);
|
console.log(res)
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/${res.path}`,
|
url: `/${res.path}`,
|
||||||
});
|
});
|
||||||
@ -261,26 +241,26 @@ export default {
|
|||||||
this.seacnCode();
|
this.seacnCode();
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.wrapper {
|
.wrapper{
|
||||||
width: 100%;
|
height: 100%;
|
||||||
height: 100%;
|
|
||||||
}
|
}
|
||||||
.navbar {
|
.navbar{
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
background: white;
|
background:white;
|
||||||
// padding-right: 10px;
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
.navbar-right {
|
.navbar-right {
|
||||||
// padding: 0 16rpx 0 0;
|
// padding: 0 16rpx 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -18,7 +18,6 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad(params) {
|
onLoad(params) {
|
||||||
this.src = decodeURIComponent(params.src);
|
this.src = decodeURIComponent(params.src);
|
||||||
console.log( this.src,this.webviewStyles,'====');
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -23,68 +23,77 @@
|
|||||||
<div class="tiole">{{ tole }}</div>
|
<div class="tiole">{{ tole }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
@click="hui(1)"
|
@click="hui(1)"
|
||||||
class="jolkp_h"
|
class="jolkp_h"
|
||||||
v-if="statue == 0 || 6"
|
v-if="statue == 0 || 6"
|
||||||
:style="{ marginTop: '35px' }"
|
:style="{ marginTop: '35px' }"
|
||||||
></div>
|
></div>
|
||||||
<div
|
<div
|
||||||
@click="fnkiopl"
|
@click="fnkiopl"
|
||||||
class="jolkp_l"
|
class="jolkp_l"
|
||||||
:style="{ marginTop: '35px' }"
|
:style="{ marginTop: '35px' }"
|
||||||
></div>
|
></div>
|
||||||
<!-- 弹出框 -->
|
<!-- 弹出框 -->
|
||||||
<div v-if="isPopupVisible" class="popup" ref="popup">
|
<div
|
||||||
<ul>
|
v-if="isPopupVisible"
|
||||||
<li @click="handleAddFriend">添加好友/群聊</li>
|
class="popup"
|
||||||
<li @click="handleMenu()">发起群聊</li>
|
ref="popup"
|
||||||
<li @click="handleScan">扫一扫</li>
|
>
|
||||||
</ul>
|
<ul>
|
||||||
</div>
|
<li @click="handleAddFriend">添加好友/群聊</li>
|
||||||
</div>
|
<li @click="handleMenu()">发起群聊</li>
|
||||||
<!-- 搜索添加 -->
|
<li @click="handleScan">扫一扫</li>
|
||||||
<TUIContactsea v-if="statue == 2" @switchConversation="hui" />
|
</ul>
|
||||||
<!-- 联系人 -->
|
</div>
|
||||||
<TUIContact v-else-if="statue == 1" style="height: 100%" />
|
</div>
|
||||||
<!-- 群选择的 -->
|
<!-- 搜索添加 -->
|
||||||
<SelectFriend
|
<TUIContactsea
|
||||||
v-else-if="statue == 3"
|
v-if="statue == 2"
|
||||||
@con="hui"
|
@switchConversation="hui"
|
||||||
:style="{ marginTop: '20px', heigth: '80%' }"
|
/>
|
||||||
/>
|
<!-- 联系人 -->
|
||||||
<!-- 群类型 -->
|
<TUIContact
|
||||||
<CreateGroup v-else-if="statue == 10" @con="confn" />
|
v-else-if="statue == 1"
|
||||||
<SelectFriendqlioa v-else-if="statue == 4" @concen="concen" />
|
style="height: 100%"
|
||||||
<!-- 站内信数据 -->
|
/>
|
||||||
<!-- <div > -->
|
<SelectFriend
|
||||||
<scroll-view
|
v-else-if="statue == 3"
|
||||||
@scrolltolower="lowerBottom"
|
@con="confn"
|
||||||
scroll-y="true"
|
/>
|
||||||
v-else-if="statue == 6"
|
<SelectFriendqlioa
|
||||||
class="znx"
|
v-else-if="statue == 4"
|
||||||
>
|
@concen="concen"
|
||||||
<div
|
/>
|
||||||
@touchstart="startLongPress(item, index)"
|
<!-- 站内信数据 -->
|
||||||
@touchend="endLongPress(item, index)"
|
<!-- <div > -->
|
||||||
@click="torut(item)"
|
<scroll-view
|
||||||
v-for="(item, index) in meList"
|
@scrolltolower="lowerBottom"
|
||||||
:key="item.id"
|
scroll-y="true"
|
||||||
class="tui-conversation-item"
|
v-else-if="statue == 6"
|
||||||
>
|
class="znx"
|
||||||
<div :style="{ transform: 'translateX(' + swipeStates[index] + 'px)' }">
|
>
|
||||||
{{ item.title }}
|
<div
|
||||||
</div>
|
@touchstart="startLongPress(item, index)"
|
||||||
<div class="content">{{ item.createTime }}</div>
|
@touchend="endLongPress(item, index)"
|
||||||
<div
|
@click="torut(item)"
|
||||||
class="delete-button"
|
v-for="(item, index) in meList"
|
||||||
@click="deleteMessage(index)"
|
:key="item.id"
|
||||||
v-if="swipeStates[index] <= -50"
|
class="tui-conversation-item"
|
||||||
>
|
>
|
||||||
删除
|
<div :style="{ transform: 'translateX(' + swipeStates[index] + 'px)' }">
|
||||||
</div>
|
{{ item.title }}
|
||||||
</div>
|
</div>
|
||||||
</scroll-view>
|
<div class="content">{{ item.createTime }}</div>
|
||||||
|
<div
|
||||||
|
class="delete-button"
|
||||||
|
@click="deleteMessage(index)"
|
||||||
|
v-if="swipeStates[index] <= -50"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</scroll-view>
|
||||||
|
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
<!-- 会话 -->
|
<!-- 会话 -->
|
||||||
@ -97,270 +106,253 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
// 导入组件
|
// 导入组件
|
||||||
import TUIConversation from "@/TUIKit/components/TUIConversation/index";
|
import TUIConversation from '@/TUIKit/components/TUIConversation/index';
|
||||||
import TUIContact from "@/TUIKit/components/TUIContact/index";
|
import TUIContact from '@/TUIKit/components/TUIContact/index';
|
||||||
import TUIContactsea from "@/TUIKit/components/TUIContact/indexsea";
|
import TUIContactsea from '@/TUIKit/components/TUIContact/indexsea';
|
||||||
import { TUILogin } from "@tencentcloud/tui-core";
|
import { TUILogin } from '@tencentcloud/tui-core';
|
||||||
import ContactSearch from "@/TUIKit/components/TUIContact/contact-search/index.vue";
|
import ContactSearch from '@/TUIKit/components/TUIContact/contact-search/index.vue';
|
||||||
import CreateGroup from "@/TUIKit/components/TUIGroup/create-group/index.vue";
|
import { TUIChatKit } from '@/TUIKit';
|
||||||
import { TUIChatKit } from "@/TUIKit";
|
import SelectFriend from '@/TUIKit/components/TUIContact/select-friend/index.vue';
|
||||||
import SelectFriend from "@/TUIKit/components/TUIContact/select-friend/index.vue";
|
import SelectFriendqlioa from '@/TUIKit/components/TUIGroup/index.vue';
|
||||||
import SelectFriendqlioa from "@/TUIKit/components/TUIGroup/index.vue";
|
import TUICore, { ExtensionInfo, TUIConstants } from '@tencentcloud/tui-core';
|
||||||
|
import storage from '@/utils/storage.js';
|
||||||
|
import { getUserimInfo, getMember, getMemberstate, getMemberdelete } from '@/api/members';
|
||||||
|
|
||||||
|
// push
|
||||||
|
import { TUIConversationService } from '@tencentcloud/chat-uikit-engine';
|
||||||
|
import * as Push from '@/uni_modules/TencentCloud-Push';
|
||||||
|
|
||||||
import TUICore, { ExtensionInfo, TUIConstants } from "@tencentcloud/tui-core";
|
|
||||||
import storage from "@/utils/storage.js";
|
|
||||||
import {
|
|
||||||
getUserimInfo,
|
|
||||||
getMember,
|
|
||||||
getMemberstate,
|
|
||||||
getMemberdelete,
|
|
||||||
geterweijki,
|
|
||||||
} from "@/api/members";
|
|
||||||
TUIChatKit.init();
|
TUIChatKit.init();
|
||||||
let vueVersion = 2;
|
let vueVersion = 2;
|
||||||
// vueVersion = 3;
|
// vueVersion = 3;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// 注册组件
|
// 注册组件
|
||||||
components: {
|
components: {
|
||||||
TUIConversation,
|
TUIConversation,
|
||||||
TUIContact,
|
TUIContact,
|
||||||
TUIContactsea,
|
TUIContactsea,
|
||||||
ContactSearch,
|
ContactSearch,
|
||||||
SelectFriend,
|
SelectFriend,
|
||||||
SelectFriendqlioa,
|
SelectFriendqlioa,
|
||||||
TUIChatKit,
|
TUIChatKit
|
||||||
CreateGroup,
|
},
|
||||||
},
|
data() {
|
||||||
data() {
|
return {
|
||||||
return {
|
statue: 0, // 0对话记录 1联系人 2添加好友/群聊 3建群 4群名称 6站内信
|
||||||
statue: 0, // 0对话记录 1联系人 2添加好友/群聊 3建群 4群名称 6站内信
|
isPopupVisible: false, // 控制弹出框的显示与隐藏
|
||||||
isPopupVisible: false, // 控制弹出框的显示与隐藏
|
isq: false,
|
||||||
isq: false,
|
popupRef: null, // 新增,用于保存弹窗的引用
|
||||||
popupRef: null, // 新增,用于保存弹窗的引用
|
meList: [],
|
||||||
meList: [],
|
swipeStates: [],
|
||||||
swipeStates: [],
|
startX: 0,
|
||||||
startX: 0,
|
tole: 0, //已读未读
|
||||||
tole: 0, //已读未读
|
cleartime: null,
|
||||||
cleartime: null,
|
pageSize: 20,
|
||||||
pageSize: 20,
|
pageNumber: 1,
|
||||||
pageNumber: 1,
|
total: 0,
|
||||||
total: 0,
|
loadMoreStatus: 'more' // 加载更多状态
|
||||||
loadMoreStatus: "more", // 加载更多状态
|
};
|
||||||
};
|
},
|
||||||
},
|
created() {},
|
||||||
created() {},
|
onShow() {
|
||||||
onShow() {
|
// 每次进入页面时调用的方法
|
||||||
// 每次进入页面时调用的方法
|
//获取用户信息
|
||||||
//获取用户信息
|
getUserimInfo()
|
||||||
getUserimInfo()
|
.then(({ data }) => {
|
||||||
.then(({ data }) => {
|
if (data.code == 200) {
|
||||||
if (data.code == 200) {
|
const par = data.result;
|
||||||
const par = data.result;
|
TUILogin.login({
|
||||||
TUILogin.login({
|
SDKAppID: par.sdkAppId,
|
||||||
SDKAppID: par.sdkAppId,
|
userID: par.userID,
|
||||||
userID: par.userID,
|
userSig: par.userSig,
|
||||||
userSig: par.userSig,
|
useUploadPlugin: true,
|
||||||
useUploadPlugin: true, // If you need to send rich media messages, please set to true.
|
framework: `vue${vueVersion}`
|
||||||
framework: `vue${vueVersion}`, // framework used vue2 / vue3
|
}).then(() => {
|
||||||
}).then(()=>{
|
Push.setRegistrationID(par.userID, () => {
|
||||||
Push.setRegistrationID(par.userID, () => {
|
console.log('设置id设置id设置id设置id设置id设置id设置id设置id设置id设置id', par.userID);
|
||||||
console.log('设置id设置id设置id设置id设置id设置id设置id设置id设置id设置id', par.userID);
|
|
||||||
|
|
||||||
Push.registerPush(
|
Push.registerPush(
|
||||||
par.sdkAppId,
|
par.sdkAppId,
|
||||||
'vkFpe55aYqfV7Sk5uGaoxhEstJ3tcI9dquk7JwG1GloDSLD2HeMWeQweWWXgNlhC',
|
'vkFpe55aYqfV7Sk5uGaoxhEstJ3tcI9dquk7JwG1GloDSLD2HeMWeQweWWXgNlhC',
|
||||||
(data) => {
|
(data) => {
|
||||||
console.log('registerPush ok', data);
|
console.log('registerPush ok', data);
|
||||||
Push.getRegistrationID((registrationID) => {
|
Push.getRegistrationID((registrationID) => {
|
||||||
console.log('getRegistrationID ok', registrationID);
|
console.log('getRegistrationID ok', registrationID);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
(errCode, errMsg) => {
|
(errCode, errMsg) => {
|
||||||
console.error('registerPush failed', errCode, errMsg);
|
console.error('registerPush failed', errCode, errMsg);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
});
|
||||||
|
// 监听通知栏点击事件,获取推送扩展信息
|
||||||
|
Push.addPushListener(Push.EVENT.NOTIFICATION_CLICKED, (res) => {
|
||||||
|
console.log('notification clicked', res);
|
||||||
|
// 解析扩展信息,跳转到相应的会话(代码仅供参考,发布前需要完善)
|
||||||
|
try {
|
||||||
|
const data = JSON.parse(res.data);
|
||||||
|
const conv_type = data?.entity?.chatType === 1 ? 'C2C' : 'GROUP';
|
||||||
|
// 根据推送信息拼的 conversationID
|
||||||
|
const conversationID = `${conv_type}${data.entity.sender}`;
|
||||||
|
// 切换会话
|
||||||
|
TUIConversationService.switchConversation(conversationID);
|
||||||
|
const chatPath = '/TUIKit/components/TUIChat/index';
|
||||||
|
uni.navigateTo({ url: chatPath });
|
||||||
|
} catch (error) {
|
||||||
|
console.log('error', error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 监听在线推送
|
||||||
|
Push.addPushListener(Push.EVENT.MESSAGE_RECEIVED, (res) => {
|
||||||
|
// res 为消息内容
|
||||||
|
console.log('message received', res);
|
||||||
|
});
|
||||||
|
// 监听在线推送被撤回
|
||||||
|
Push.addPushListener(Push.EVENT.MESSAGE_REVOKED, (res) => {
|
||||||
|
// res 为被撤回的消息 ID
|
||||||
|
console.log('message revoked', res);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 接口返回非 200 状态码,跳转登录页面
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/passport/login'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
// 请求失败,跳转登录页面
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/passport/login'
|
||||||
});
|
});
|
||||||
// 监听通知栏点击事件,获取推送扩展信息
|
});
|
||||||
Push.addPushListener(Push.EVENT.NOTIFICATION_CLICKED, (res) => {
|
},
|
||||||
console.log('notification clicked', res);
|
mounted() {
|
||||||
// 解析扩展信息,跳转到相应的会话(代码仅供参考,发布前需要完善)
|
this.getMembermethod();
|
||||||
try {
|
this.setTime();
|
||||||
const data = JSON.parse(res.data);
|
// 监听全局点击事件
|
||||||
const conv_type = data?.entity?.chatType === 1 ? 'C2C' : 'GROUP';
|
document.addEventListener('click', (event) => this.handleGlobalClick(event));
|
||||||
// 根据推送信息拼的 conversationID
|
// 监听滚动事件
|
||||||
const conversationID = `${conv_type}${data.entity.sender}`;
|
},
|
||||||
// 切换会话
|
beforeDestroy() {
|
||||||
TUIConversationService.switchConversation(conversationID);
|
// 移除全局点击事件
|
||||||
const chatPath = '/TUIKit/components/TUIChat/index';
|
document.removeEventListener('click', this.handleGlobalClick);
|
||||||
uni.navigateTo({ url: chatPath });
|
// 清除定时器
|
||||||
} catch (error) {
|
clearTimeout(this.cleartime);
|
||||||
console.log('error', error);
|
// 移除滚动事件监听
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
lowerBottom() {
|
||||||
|
if (this.total >= this.meList.length) {
|
||||||
|
this.pageSize += 10;
|
||||||
|
this.getMembermethod();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setTime() {
|
||||||
|
const th = this;
|
||||||
|
this.cleartime = setTimeout(() => {
|
||||||
|
this.getMembermethod();
|
||||||
|
th.setTime(); //递归调用setTime函数,实现每10秒执行一次getMembermethod函数的效果
|
||||||
|
}, 10000);
|
||||||
|
},
|
||||||
|
torut(item) {
|
||||||
|
// 将 item 对象转换为 JSON 字符串,以便在 URL 中传递
|
||||||
|
const itemJson = encodeURIComponent(JSON.stringify(item));
|
||||||
|
// 使用 uni.navigateTo 方法跳转到详情页,并传递信息
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/tabbar/im/details/index?item=${itemJson}`
|
||||||
|
});
|
||||||
|
getMemberstate({ messageId: item.messageId }).then((res) => {
|
||||||
|
this.getMembermethod();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//完成跳转群名
|
||||||
|
confn() {
|
||||||
|
// this.statue = 0;
|
||||||
|
this.isPopupVisible = false;
|
||||||
|
},
|
||||||
|
concen() {
|
||||||
|
this.statue = 0;
|
||||||
|
},
|
||||||
|
hui(index) {
|
||||||
|
this.statue = index;
|
||||||
|
},
|
||||||
|
fnkiopl() {
|
||||||
|
this.isPopupVisible = !this.isPopupVisible;
|
||||||
|
this.popupRef = this.$refs.popup;
|
||||||
|
},
|
||||||
|
handleGlobalClick(event) {
|
||||||
|
if (this.isPopupVisible && event.target._prevClass != 'jolkp_l') {
|
||||||
|
this.isPopupVisible = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
getMembermethod() {
|
||||||
|
const param = {
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNumber: this.pageNumber
|
||||||
|
};
|
||||||
|
getMember(param).then((res) => {
|
||||||
|
this.total = res.data.result.total;
|
||||||
|
if (this.pageNumber === 1) {
|
||||||
|
this.meList = res.data.result.records;
|
||||||
|
} else {
|
||||||
|
this.meList = this.meList.concat(res.data.result.records);
|
||||||
|
}
|
||||||
|
this.swipeStates = new Array(this.meList.length).fill(0);
|
||||||
|
this.tole = this.meList.filter((item) => item.status === 'UN_READY').length;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleMenu() {
|
||||||
|
const fn = [...TUICore.getExtensionList(TUIConstants.TUISearch.EXTENSION.SEARCH_MORE.EXT_ID)];
|
||||||
|
const item = fn[1];
|
||||||
|
const {
|
||||||
|
listener = {
|
||||||
|
onClicked: () => {}
|
||||||
|
}
|
||||||
|
} = item;
|
||||||
|
listener?.onClicked?.(item);
|
||||||
|
this.statue = 3;
|
||||||
|
},
|
||||||
|
// 处理添加好友/群聊点击事件
|
||||||
|
handleAddFriend() {
|
||||||
|
this.statue = 2;
|
||||||
|
this.isPopupVisible = false;
|
||||||
|
},
|
||||||
|
handleScan() {
|
||||||
|
this.isPopupVisible = false;
|
||||||
|
uni.scanCode({
|
||||||
|
success: (res) => {
|
||||||
|
console.log('扫码结果:', res);
|
||||||
|
this.statue = 0;
|
||||||
|
// 可以在这里添加处理扫码结果的逻辑
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('扫码失败:', err);
|
||||||
|
this.statue = 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
startLongPress(item, index) {
|
||||||
|
this.longPressTimer = setTimeout(() => {
|
||||||
|
uni.showModal({
|
||||||
|
title: '确认删除',
|
||||||
|
content: '确定要删除这条消息吗?',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
getMemberdelete({ messageId: item.messageId }).then((res) => {
|
||||||
|
this.getMembermethod();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// 监听在线推送
|
}, 2000);
|
||||||
Push.addPushListener(Push.EVENT.MESSAGE_RECEIVED, (res) => {
|
},
|
||||||
// res 为消息内容
|
endLongPress() {
|
||||||
console.log('message received', res);
|
clearTimeout(this.longPressTimer);
|
||||||
});
|
}
|
||||||
// 监听在线推送被撤回
|
}
|
||||||
Push.addPushListener(Push.EVENT.MESSAGE_REVOKED, (res) => {
|
|
||||||
// res 为被撤回的消息 ID
|
|
||||||
console.log('message revoked', res);
|
|
||||||
});
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
// 接口返回非 200 状态码,跳转登录页面
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/passport/login",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
// 请求失败,跳转登录页面
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/passport/login",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.getMembermethod();
|
|
||||||
this.setTime();
|
|
||||||
// 监听全局点击事件
|
|
||||||
document.addEventListener("click", (event) =>
|
|
||||||
this.handleGlobalClick(event)
|
|
||||||
);
|
|
||||||
// 监听滚动事件
|
|
||||||
},
|
|
||||||
beforeDestroy() {
|
|
||||||
// 移除全局点击事件
|
|
||||||
document.removeEventListener("click", this.handleGlobalClick);
|
|
||||||
// 清除定时器
|
|
||||||
clearTimeout(this.cleartime);
|
|
||||||
// 移除滚动事件监听
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
lowerBottom() {
|
|
||||||
if (this.total >= this.meList.length) {
|
|
||||||
this.pageSize += 10;
|
|
||||||
this.getMembermethod();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
setTime() {
|
|
||||||
const th = this;
|
|
||||||
this.cleartime = setTimeout(() => {
|
|
||||||
this.getMembermethod();
|
|
||||||
th.setTime(); //递归调用setTime函数,实现每10秒执行一次getMembermethod函数的效果
|
|
||||||
}, 10000);
|
|
||||||
},
|
|
||||||
torut(item) {
|
|
||||||
// 将 item 对象转换为 JSON 字符串,以便在 URL 中传递
|
|
||||||
const itemJson = encodeURIComponent(JSON.stringify(item));
|
|
||||||
// 使用 uni.navigateTo 方法跳转到详情页,并传递信息
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/tabbar/im/details/index?item=${itemJson}`,
|
|
||||||
});
|
|
||||||
getMemberstate({ messageId: item.messageId }).then((res) => {
|
|
||||||
this.getMembermethod();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//完成跳转群名
|
|
||||||
confn() {
|
|
||||||
this.statue = 0;
|
|
||||||
this.isPopupVisible = false;
|
|
||||||
},
|
|
||||||
concen() {
|
|
||||||
this.statue = 0;
|
|
||||||
},
|
|
||||||
hui(index) {
|
|
||||||
this.statue = index;
|
|
||||||
},
|
|
||||||
fnkiopl() {
|
|
||||||
this.isPopupVisible = !this.isPopupVisible;
|
|
||||||
this.popupRef = this.$refs.popup;
|
|
||||||
},
|
|
||||||
handleGlobalClick(event) {
|
|
||||||
if (this.isPopupVisible && event.target._prevClass != "jolkp_l") {
|
|
||||||
this.isPopupVisible = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
getMembermethod() {
|
|
||||||
const param = {
|
|
||||||
pageSize: this.pageSize,
|
|
||||||
pageNumber: this.pageNumber,
|
|
||||||
};
|
|
||||||
getMember(param).then((res) => {
|
|
||||||
this.total = res.data.result.total;
|
|
||||||
if (this.pageNumber === 1) {
|
|
||||||
this.meList = res.data.result.records;
|
|
||||||
} else {
|
|
||||||
this.meList = this.meList.concat(res.data.result.records);
|
|
||||||
}
|
|
||||||
this.swipeStates = new Array(this.meList.length).fill(0);
|
|
||||||
this.tole = this.meList.filter(
|
|
||||||
(item) => item.status === "UN_READY"
|
|
||||||
).length;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleMenu() {
|
|
||||||
const fn = [
|
|
||||||
...TUICore.getExtensionList(
|
|
||||||
TUIConstants.TUISearch.EXTENSION.SEARCH_MORE.EXT_ID
|
|
||||||
),
|
|
||||||
];
|
|
||||||
const item = fn[1];
|
|
||||||
const {
|
|
||||||
listener = {
|
|
||||||
onClicked: () => {},
|
|
||||||
},
|
|
||||||
} = item;
|
|
||||||
listener?.onClicked?.(item);
|
|
||||||
this.statue = 3;
|
|
||||||
},
|
|
||||||
// 处理添加好友/群聊点击事件
|
|
||||||
handleAddFriend() {
|
|
||||||
this.statue = 2;
|
|
||||||
this.isPopupVisible = false;
|
|
||||||
},
|
|
||||||
handleScan() {
|
|
||||||
this.isPopupVisible = false;
|
|
||||||
uni.scanCode({
|
|
||||||
success: (res) => {
|
|
||||||
console.log("扫码结果:---", res);
|
|
||||||
geterweijki(res.result).then((resfn) => {
|
|
||||||
console.log(resfn, "====");
|
|
||||||
this.getUserimInfo();
|
|
||||||
this.statue = 0;
|
|
||||||
});
|
|
||||||
this.statue = 0;
|
|
||||||
// 可以在这里添加处理扫码结果的逻辑
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
console.error("扫码失败:", err);
|
|
||||||
this.statue = 0;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
startLongPress(item, index) {
|
|
||||||
this.longPressTimer = setTimeout(() => {
|
|
||||||
uni.showModal({
|
|
||||||
title: "确认删除",
|
|
||||||
content: "确定要删除这条消息吗?",
|
|
||||||
success: (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
getMemberdelete({ messageId: item.messageId }).then((res) => {
|
|
||||||
this.getMembermethod();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}, 2000);
|
|
||||||
},
|
|
||||||
endLongPress() {
|
|
||||||
clearTimeout(this.longPressTimer);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -517,17 +509,17 @@ page {
|
|||||||
width: 40%;
|
width: 40%;
|
||||||
}
|
}
|
||||||
.tui-conversation-item {
|
.tui-conversation-item {
|
||||||
/* height: 10%; */
|
/* height: 10%; */
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border: 1px solid #d9d9d9;
|
border: 1px solid #d9d9d9;
|
||||||
width: 98%;
|
width: 98%;
|
||||||
margin: 10px 10px 10px 5px;
|
margin-top: 10px;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.content {
|
.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -564,5 +556,4 @@ page {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -6,92 +6,61 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="header" @click="userDetail">
|
<view class="header" @click="userDetail">
|
||||||
<view class="head-1">
|
<view class="head-1">
|
||||||
<image :src="userInfo.face || '/static/imlogo.png'"></image>
|
<image :src="userInfo.face || '/static/missing-face.png'"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="head-2" v-if="userInfo.id">
|
<view class="head-2" v-if="userInfo.id">
|
||||||
<view class="user-name">{{ userInfo.nickName }}</view>
|
<view class="user-name">{{ userInfo.nickName }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="head-2" v-else>
|
<view class="head-2" v-else>
|
||||||
<view class="user-name">登录/注册</view>
|
<view class="user-name">登录/注册</view>
|
||||||
</view>
|
</view>
|
||||||
<u-icon
|
<u-icon style="display: flex;align-items: flex-start;" name="arrow-right"></u-icon>
|
||||||
style="display: flex; align-items: flex-start"
|
|
||||||
name="arrow-right"
|
|
||||||
></u-icon>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 积分,优惠券,关注, -->
|
<!-- 积分,优惠券,关注, -->
|
||||||
<div class="pointBox box">
|
<div class="pointBox box">
|
||||||
<u-row text-align="center" gutter="16" class="point">
|
<u-row text-align="center" gutter="16" class="point">
|
||||||
<u-col
|
<u-col text-align="center" span="4" @click="navigateTo('/pages/mine/deposit/operation')">
|
||||||
text-align="center"
|
|
||||||
span="4"
|
|
||||||
@click="navigateTo('/pages/mine/deposit/operation')"
|
|
||||||
>
|
|
||||||
<view>预存款</view>
|
<view>预存款</view>
|
||||||
<view class="money">{{ walletNum | unitPrice }}</view>
|
<view class="money">{{ walletNum | unitPrice}}</view>
|
||||||
</u-col>
|
</u-col>
|
||||||
|
|
||||||
<u-col
|
<u-col text-align="center" span="4" @click="navigateTo('/pages/cart/coupon/myCoupon')">
|
||||||
text-align="center"
|
|
||||||
span="4"
|
|
||||||
@click="navigateTo('/pages/cart/coupon/myCoupon')"
|
|
||||||
>
|
|
||||||
<view>优惠券</view>
|
<view>优惠券</view>
|
||||||
<view>{{ couponNum || 0 }}</view>
|
<view>{{ couponNum || 0 }}</view>
|
||||||
</u-col>
|
</u-col>
|
||||||
|
|
||||||
<u-col
|
<u-col text-align="center" span="4" @click="navigateTo('/pages/mine/myTracks')">
|
||||||
text-align="center"
|
|
||||||
span="4"
|
|
||||||
@click="navigateTo('/pages/mine/myTracks')"
|
|
||||||
>
|
|
||||||
<view>足迹</view>
|
<view>足迹</view>
|
||||||
<view>{{ footNum || 0 }}</view>
|
<view>{{ footNum || 0 }}</view>
|
||||||
</u-col>
|
</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
<!-- 我的订单,代付款 -->
|
<!-- 我的订单,代付款 -->
|
||||||
<view class="order">
|
<view class="order">
|
||||||
<view
|
<view class="order-item" @click="navigateTo('/pages/order/myOrder?status=0')">
|
||||||
class="order-item"
|
|
||||||
@click="navigateTo('/pages/order/myOrder?status=0')"
|
|
||||||
>
|
|
||||||
<div class="bag bag1">
|
<div class="bag bag1">
|
||||||
<u-icon name="order" size="35" color="#fff"></u-icon>
|
<u-icon name="order" size="35" color="#fff"></u-icon>
|
||||||
</div>
|
</div>
|
||||||
<view>我的订单</view>
|
<view>我的订单</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="order-item" @click="navigateTo('/pages/order/myOrder?status=1')">
|
||||||
class="order-item"
|
|
||||||
@click="navigateTo('/pages/order/myOrder?status=1')"
|
|
||||||
>
|
|
||||||
<div class="bag bag2">
|
<div class="bag bag2">
|
||||||
<u-icon name="bag-fill" size="35" color="#fff"></u-icon>
|
<u-icon name="bag-fill" size="35" color="#fff"></u-icon>
|
||||||
</div>
|
</div>
|
||||||
<view>待付款</view>
|
<view>待付款</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="order-item" @click="navigateTo('/pages/order/myOrder?status=3')">
|
||||||
class="order-item"
|
|
||||||
@click="navigateTo('/pages/order/myOrder?status=3')"
|
|
||||||
>
|
|
||||||
<div class="bag bag3">
|
<div class="bag bag3">
|
||||||
<u-icon name="car-fill" size="35" color="#fff"></u-icon>
|
<u-icon name="car-fill" size="35" color="#fff"></u-icon>
|
||||||
</div>
|
</div>
|
||||||
<view>待收货</view>
|
<view>待收货</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="order-item" @click="navigateTo('/pages/order/evaluate/myEvaluate')">
|
||||||
class="order-item"
|
|
||||||
@click="navigateTo('/pages/order/evaluate/myEvaluate')"
|
|
||||||
>
|
|
||||||
<div class="bag bag4">
|
<div class="bag bag4">
|
||||||
<u-icon name="star-fill" size="35" color="#fff"></u-icon>
|
<u-icon name="star-fill" size="35" color="#fff"></u-icon>
|
||||||
</div>
|
</div>
|
||||||
<view>待评价</view>
|
<view>待评价</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="order-item" @click="navigateTo('/pages/order/afterSales/afterSales')">
|
||||||
class="order-item"
|
|
||||||
@click="navigateTo('/pages/order/afterSales/afterSales')"
|
|
||||||
>
|
|
||||||
<div class="bag bag5">
|
<div class="bag bag5">
|
||||||
<u-icon name="server-fill" size="35" color="#fff"></u-icon>
|
<u-icon name="server-fill" size="35" color="#fff"></u-icon>
|
||||||
</div>
|
</div>
|
||||||
@ -101,7 +70,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 常用工具 -->
|
<!-- 常用工具 -->
|
||||||
|
|
||||||
<tool :userInfo="userInfo" v-if="userInfo.id != undefined" ref="tool"/>
|
<tool />
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@ -135,8 +105,6 @@ export default {
|
|||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
this.getUserOrderNum();
|
this.getUserOrderNum();
|
||||||
this.userInfo = this.$options.filters.isLogin();
|
this.userInfo = this.$options.filters.isLogin();
|
||||||
this.$refs.tool.getUser();
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// #ifndef MP
|
// #ifndef MP
|
||||||
onNavigationBarButtonTap(e) {
|
onNavigationBarButtonTap(e) {
|
||||||
@ -161,7 +129,7 @@ export default {
|
|||||||
userDetail() {
|
userDetail() {
|
||||||
this.userInfo.id
|
this.userInfo.id
|
||||||
? this.navigateTo("/pages/mine/set/personMsg")
|
? this.navigateTo("/pages/mine/set/personMsg")
|
||||||
: this.$options.filters.navigateToLogin();
|
: this.$options.filters.navigateToLogin();;
|
||||||
},
|
},
|
||||||
async getUserOrderNum() {
|
async getUserOrderNum() {
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
<view class="scroll-con">
|
<view class="scroll-con">
|
||||||
<view v-if="nomsg">没有相似商品</view>
|
<view v-if="nomsg">没有相似商品</view>
|
||||||
<view v-else class="con" v-for="(item,index) in goodsList" :key="index" @click="goDetail(item)">
|
<view v-else class="con" v-for="(item,index) in goodsList" :key="index" @click="goDetail(item)">
|
||||||
<image :src="imgfun(item.content.thumbnail)" mode=""></image>
|
<image :src="item.content.thumbnail" mode=""></image>
|
||||||
<view class="nowrap">{{item.content.name}}</view>
|
<view class="nowrap">{{item.content.name}}</view>
|
||||||
<view>
|
<view>
|
||||||
<text>¥{{item.content.price | unitPrice}}
|
<text>¥{{item.content.price | unitPrice}}
|
||||||
|
|||||||
@ -2,135 +2,59 @@
|
|||||||
<view>
|
<view>
|
||||||
<!-- 常用工具 -->
|
<!-- 常用工具 -->
|
||||||
<view class="interact-tools" style="margin-bottom: 15px">
|
<view class="interact-tools" style="margin-bottom: 15px">
|
||||||
|
|
||||||
<div class="paddingBox">
|
<div class="paddingBox">
|
||||||
<view class="interact-container">
|
<view class="interact-container">
|
||||||
<view
|
|
||||||
class="interact-item"
|
|
||||||
@click="navigateTo('/pages/mine/invite')"
|
|
||||||
v-if="userInfo.expert"
|
|
||||||
>
|
|
||||||
<image src="/static/mine/stion.png" mode=""></image>
|
|
||||||
<view>我的推荐</view>
|
|
||||||
</view>
|
|
||||||
<view
|
|
||||||
class="interact-item"
|
|
||||||
@click="navigateTo('/pages/mine/inviteinput')"
|
|
||||||
v-if="!userInfo.expert"
|
|
||||||
>
|
|
||||||
<image src="/static/mine/smk.png" mode=""></image>
|
|
||||||
<view>邀请</view>
|
|
||||||
</view>
|
|
||||||
<view
|
|
||||||
v-if="userInfo.expert != 1"
|
|
||||||
class="interact-item"
|
|
||||||
@click="navigateTo('/pages/mine/expert/index')"
|
|
||||||
>
|
|
||||||
<image src="/static/mine/mon.png" mode=""></image>
|
|
||||||
<view>达人申请</view>
|
|
||||||
</view>
|
|
||||||
<view
|
|
||||||
v-if="userInfo.storeId == null || userInfo.storeId == ''"
|
|
||||||
class="interact-item"
|
|
||||||
@click="navigateTo('/pages/mine/openShop/index')"
|
|
||||||
>
|
|
||||||
<image src="/static/mine/shop.png" mode=""></image>
|
|
||||||
<view>店铺申请</view>
|
|
||||||
</view>
|
|
||||||
<!-- <view class="interact-item" @click="navigateTo('/pages/mine/makeMoney/index')">
|
|
||||||
<image src="/static/mine/mony.png" mode=""></image>
|
|
||||||
<view>赚钱</view>
|
|
||||||
</view> -->
|
|
||||||
<view class="interact-item" @click="navigateTo('/pages/mine/signIn')">
|
<view class="interact-item" @click="navigateTo('/pages/mine/signIn')">
|
||||||
<image src="/static/mine/sign.png" mode=""></image>
|
<image src="/static/mine/sign.png" mode=""></image>
|
||||||
<view>每日签到</view>
|
<view>每日签到</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="interact-item" @click="navigateTo('/pages/mine/point/myPoint')">
|
||||||
class="interact-item"
|
|
||||||
@click="navigateTo('/pages/mine/point/myPoint')"
|
|
||||||
>
|
|
||||||
<image src="/static/mine/mypoint.png" mode=""></image>
|
<image src="/static/mine/mypoint.png" mode=""></image>
|
||||||
<view>我的积分</view>
|
<view>我的积分</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="interact-item" @click="navigateTo('/pages/cart/coupon/myCoupon')">
|
||||||
class="interact-item"
|
|
||||||
@click="navigateTo('/pages/cart/coupon/myCoupon')"
|
|
||||||
>
|
|
||||||
<image src="/static/mine/mycoupon.png" mode=""></image>
|
<image src="/static/mine/mycoupon.png" mode=""></image>
|
||||||
<view>优惠券</view>
|
<view>优惠券</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="interact-item" @click="navigateTo('/pages/mine/myCollect')">
|
||||||
class="interact-item"
|
|
||||||
@click="navigateTo('/pages/mine/myCollect')"
|
|
||||||
>
|
|
||||||
<image src="/static/mine/myfavorite.png" mode=""></image>
|
<image src="/static/mine/myfavorite.png" mode=""></image>
|
||||||
<view>我的关注</view>
|
<view>我的关注</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="interact-item" @click="navigateTo('/pages/mine/myTracks')">
|
||||||
class="interact-item"
|
|
||||||
@click="navigateTo('/pages/mine/myTracks')"
|
|
||||||
>
|
|
||||||
<image src="/static/mine/myhistory.png" mode=""></image>
|
<image src="/static/mine/myhistory.png" mode=""></image>
|
||||||
<view>我的足迹</view>
|
<view>我的足迹</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="interact-item" @click="navigateTo('/pages/order/evaluate/myEvaluate')">
|
||||||
class="interact-item"
|
|
||||||
@click="navigateTo('/pages/order/evaluate/myEvaluate')"
|
|
||||||
>
|
|
||||||
<image src="/static/mine/mycommit.png" mode=""></image>
|
<image src="/static/mine/mycommit.png" mode=""></image>
|
||||||
<view>我的评价</view>
|
<view>我的评价</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="interact-item" @click="navigateTo('/pages/order/complain/complainList')">
|
||||||
class="interact-item"
|
|
||||||
@click="navigateTo('/pages/order/complain/complainList')"
|
|
||||||
>
|
|
||||||
<image src="/static/mine/shensu.png" mode=""></image>
|
<image src="/static/mine/shensu.png" mode=""></image>
|
||||||
<view>我的投诉</view>
|
<view>我的投诉</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view
|
<view class="interact-item" @click="navigateTo('/pages/mine/set/feedBack')">
|
||||||
class="interact-item"
|
|
||||||
@click="navigateTo('/pages/mine/set/feedBack')"
|
|
||||||
>
|
|
||||||
<image src="/static/mine/feedback.png" mode=""></image>
|
<image src="/static/mine/feedback.png" mode=""></image>
|
||||||
<view>意见反馈</view>
|
<view>意见反馈</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="interact-item" @click="navigateTo('/pages/cart/coupon/couponCenter')">
|
||||||
class="interact-item"
|
|
||||||
@click="navigateTo('/pages/cart/coupon/couponCenter')"
|
|
||||||
>
|
|
||||||
<image src="/static/mine/couponcenter.png" mode=""></image>
|
<image src="/static/mine/couponcenter.png" mode=""></image>
|
||||||
<view>领券中心</view>
|
<view>领券中心</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="interact-item" @click="navigateTo('/pages/mine/address/addressManage')">
|
||||||
class="interact-item"
|
|
||||||
@click="navigateTo('/pages/mine/address/addressManage')"
|
|
||||||
>
|
|
||||||
<image src="/static/mine/myaddress.png" mode=""></image>
|
<image src="/static/mine/myaddress.png" mode=""></image>
|
||||||
<view>地址管理</view>
|
<view>地址管理</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="interact-item" @click="navigateTo('/pages/mine/set/setUp')">
|
||||||
class="interact-item"
|
|
||||||
@click="navigateTo('/pages/mine/set/setUp')"
|
|
||||||
>
|
|
||||||
<image src="/static/mine/setting.png" mode=""></image>
|
<image src="/static/mine/setting.png" mode=""></image>
|
||||||
<view>设置</view>
|
<view>设置</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="interact-item" @click="distribution">
|
||||||
class="interact-item"
|
|
||||||
@click="navigateTo('/pages/mine/mydistribution/index')"
|
|
||||||
v-if="userInfo.expert"
|
|
||||||
>
|
|
||||||
<image src="/static/mine/distribution.png" mode=""></image>
|
<image src="/static/mine/distribution.png" mode=""></image>
|
||||||
<view>我的分销</view>
|
<view>我的分销</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="interact-item" @click="distribution">
|
<view class="interact-item" @click="navigateTo('/pages/promotion/bargain/log')">
|
||||||
<image src="/static/mine/distribution.png" mode=""></image>
|
|
||||||
<view>我的分销</view>
|
|
||||||
</view> -->
|
|
||||||
<view
|
|
||||||
class="interact-item"
|
|
||||||
@click="navigateTo('/pages/promotion/bargain/log')"
|
|
||||||
>
|
|
||||||
<image src="/static/mine/kanjia.png" mode=""></image>
|
<image src="/static/mine/kanjia.png" mode=""></image>
|
||||||
<view>砍价记录</view>
|
<view>砍价记录</view>
|
||||||
</view>
|
</view>
|
||||||
@ -142,31 +66,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { distribution } from "@/api/goods";
|
import { distribution } from "@/api/goods";
|
||||||
import { getUserInfo } from "@/api/members";
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
|
||||||
// userInfo: {
|
|
||||||
// type: Object,
|
|
||||||
// default: () => {},
|
|
||||||
// },
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
userInfo: {}, // 用户信息
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onShow() {},
|
|
||||||
onLoad() {},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
this.getUser();
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
getUser() {
|
|
||||||
getUserInfo().then((user) => {
|
|
||||||
this.userInfo = user.data.result;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
navigateTo(url) {
|
navigateTo(url) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url,
|
url,
|
||||||
@ -220,6 +121,7 @@ export default {
|
|||||||
border-left: none;
|
border-left: none;
|
||||||
border-right: none;
|
border-right: none;
|
||||||
|
|
||||||
|
|
||||||
.interactBox {
|
.interactBox {
|
||||||
height: 156rpx;
|
height: 156rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,50 +0,0 @@
|
|||||||
/**
|
|
||||||
* 各种正则表达式
|
|
||||||
* mobile 手机号
|
|
||||||
* email 电子邮箱
|
|
||||||
* password 密码【6-20位】
|
|
||||||
* integer 正整数【不包含0】
|
|
||||||
* money 金钱
|
|
||||||
* TINumber 纳税识别号
|
|
||||||
* IDCard 身份证
|
|
||||||
* userName 账户名称【汉字、字母、数字、“-”、“_”的组合】
|
|
||||||
* URL URL
|
|
||||||
* TEL 固定电话
|
|
||||||
*/
|
|
||||||
|
|
||||||
// 手机号
|
|
||||||
export const mobile = /^0?(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])[0-9]{8}$/;
|
|
||||||
|
|
||||||
// 电子邮箱
|
|
||||||
export const email = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
|
|
||||||
|
|
||||||
// 密码【6-20位】
|
|
||||||
export const password = /^[@A-Za-z0-9!#$%^&*.~,]{6,20}$/;
|
|
||||||
|
|
||||||
// 正整数【不包含0】
|
|
||||||
export const integer = /^[1-9]\d*$/;
|
|
||||||
|
|
||||||
// 正整数【包含0】
|
|
||||||
export const Integer = /^[0-9]\d*$/;
|
|
||||||
|
|
||||||
// 金钱
|
|
||||||
export const money = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
|
|
||||||
|
|
||||||
// 纳税识别号
|
|
||||||
export const TINumber = /^((\d{6}[0-9A-Z]{9})|([0-9A-Za-z]{2}\d{6}[0-9A-Za-z]{10,12}))$/;
|
|
||||||
|
|
||||||
// 身份证
|
|
||||||
export const IDCard = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
|
|
||||||
|
|
||||||
// 账户名称【汉字、字母、数字、“-”、“_”的组合】
|
|
||||||
export const userName = /[A-Za-z0-9_\-\u4e00-\u9fa5]$/;
|
|
||||||
|
|
||||||
// URL
|
|
||||||
export const URL =
|
|
||||||
/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/;
|
|
||||||
|
|
||||||
// 固话
|
|
||||||
export const TEL = /0\d{2,3}-\d{7,8}/;
|
|
||||||
|
|
||||||
// 营业执照号
|
|
||||||
export const licenseNum = /(^(?:(?![IOZSV])[\dA-Z]){2}\d{6}(?:(?![IOZSV])[\dA-Z]){10}$)|(^\d{15}$)/;
|
|
||||||
BIN
static/abcx.png
|
Before Width: | Height: | Size: 229 KiB |
|
Before Width: | Height: | Size: 13 KiB |
BIN
static/logn.png
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 752 B |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
BIN
static/shop.png
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 1.4 KiB |
152
uni.css
@ -1,152 +0,0 @@
|
|||||||
@charset "UTF-8";
|
|
||||||
/* 页面左右间距 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/*文字颜色*/
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 图片加载中颜色 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/*主题颜色 具体参考 https://ant.design/docs/spec/colors-cn */
|
|
||||||
/**微信登录按钮颜色 */
|
|
||||||
/**主颜色*/
|
|
||||||
/*用于金钱等颜色 */
|
|
||||||
/*主题高亮颜色*/
|
|
||||||
/*辅助高亮颜色*/
|
|
||||||
/*主题高亮背景颜色*/
|
|
||||||
/*价格红高亮背景颜色*/
|
|
||||||
/*辅助色*/
|
|
||||||
.light-color {
|
|
||||||
color: #fe3c3c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-color {
|
|
||||||
color: #fe3c3c !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bg-light-color {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
background-color: #fe3c3c !important;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.bg-light-color /deep/ * {
|
|
||||||
background-color: #fe3c3c !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bg-main-color {
|
|
||||||
background-color: #fe3c3c !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bg-linear-gradient {
|
|
||||||
background-image: linear-gradient(25deg, #fa123b, #ff6b35, #ff9f28, #ffcc03);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
.uni-tabbar .uni-tabbar__icon {
|
|
||||||
width: 20px;
|
|
||||||
height: 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* #endif */
|
|
||||||
.flex {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
background-color: #fe3c3c;
|
|
||||||
color: #ffffff;
|
|
||||||
border-width: 0px;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
border: none;
|
|
||||||
/* #endif */
|
|
||||||
border-color: transparent;
|
|
||||||
border-radius: 44px;
|
|
||||||
height: 44px;
|
|
||||||
box-shadow: none;
|
|
||||||
font-weight: 400;
|
|
||||||
font-style: normal;
|
|
||||||
line-height: 44px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn::after {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
border: none;
|
|
||||||
/* #endif */
|
|
||||||
border-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button-hover {
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.margin {
|
|
||||||
margin: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag {
|
|
||||||
background-color: #f2f2f2;
|
|
||||||
color: #333333;
|
|
||||||
height: 28px;
|
|
||||||
border-radius: 28px;
|
|
||||||
box-shadow: none;
|
|
||||||
font-family: "PingFangSC-Regular", "PingFang SC", sans-serif;
|
|
||||||
font-weight: 400;
|
|
||||||
font-style: normal;
|
|
||||||
line-height: 28px;
|
|
||||||
text-align: center;
|
|
||||||
width: 90px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.c-content {
|
|
||||||
background-color: #ffffff;
|
|
||||||
border-top: 1px solid #ebeef5;
|
|
||||||
border-bottom: 1px solid #ebeef5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mt-30 {
|
|
||||||
margin-top: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border-top {
|
|
||||||
border-top: 1px solid #ebeef5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.describe {
|
|
||||||
color: #909399;
|
|
||||||
font-size: 24rpx;
|
|
||||||
padding: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.flex-center {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.flex-a-c {
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.relative {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
.wes {
|
|
||||||
/* 多出部分用省略号表示 , 用于一行 */
|
|
||||||
overflow: hidden;
|
|
||||||
word-wrap: normal;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wes-2 {
|
|
||||||
/* 适用于webkit内核和移动端 */
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* #endif */
|
|
||||||
44
uni.scss
@ -29,13 +29,13 @@ $uni-color-error: #dd524d;
|
|||||||
/**微信登录按钮颜色 */
|
/**微信登录按钮颜色 */
|
||||||
$weChat-color:#00a327;
|
$weChat-color:#00a327;
|
||||||
/**主颜色*/
|
/**主颜色*/
|
||||||
$main-color: #fe3c3c;
|
$main-color: #ff3c2a;
|
||||||
/*用于金钱等颜色 */
|
/*用于金钱等颜色 */
|
||||||
$price-color: #fe3c3c;
|
$price-color: #ff3c2a;
|
||||||
/*主题高亮颜色*/
|
/*主题高亮颜色*/
|
||||||
$light-color: #fe3c3c;
|
$light-color: #ff6b35;
|
||||||
/*辅助高亮颜色*/
|
/*辅助高亮颜色*/
|
||||||
$aider-light-color: #fe3c3c;
|
$aider-light-color: #ff9f28;
|
||||||
|
|
||||||
/*主题高亮背景颜色*/
|
/*主题高亮背景颜色*/
|
||||||
$main-light-color: #edfcf7;
|
$main-light-color: #edfcf7;
|
||||||
@ -63,12 +63,12 @@ $font-weight: 400;
|
|||||||
.main-color {
|
.main-color {
|
||||||
color: $main-color !important;
|
color: $main-color !important;
|
||||||
}
|
}
|
||||||
.bg-light-color {
|
.bg-light-color {
|
||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
background-color: $light-color !important;
|
background-color: $light-color !important;
|
||||||
/deep/ * {
|
/deep/ * {
|
||||||
background-color: $light-color !important;
|
background-color: $light-color !important;
|
||||||
}
|
}
|
||||||
/* #endif */
|
/* #endif */
|
||||||
}
|
}
|
||||||
.bg-main-color {
|
.bg-main-color {
|
||||||
@ -78,13 +78,13 @@ $font-weight: 400;
|
|||||||
// 渐变主题颜色
|
// 渐变主题颜色
|
||||||
.bg-linear-gradient {
|
.bg-linear-gradient {
|
||||||
background-image: linear-gradient(25deg, #fa123b, #ff6b35, #ff9f28, #ffcc03);
|
background-image: linear-gradient(25deg, #fa123b, #ff6b35, #ff9f28, #ffcc03);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
.uni-tabbar .uni-tabbar__icon {
|
.uni-tabbar .uni-tabbar__icon {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
}
|
}
|
||||||
/* #endif */
|
/* #endif */
|
||||||
|
|
||||||
|
|
||||||
@ -95,10 +95,10 @@ $font-weight: 400;
|
|||||||
.btn {
|
.btn {
|
||||||
background-color: $light-color;
|
background-color: $light-color;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
border-width: 0px;
|
border-width: 0px;
|
||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
border: none;
|
border: none;
|
||||||
/* #endif */
|
/* #endif */
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
border-radius: 44px;
|
border-radius: 44px;
|
||||||
height: 44px;
|
height: 44px;
|
||||||
@ -107,9 +107,9 @@ $font-weight: 400;
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
line-height: 44px;
|
line-height: 44px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
&::after {
|
&::after {
|
||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
border: none;
|
border: none;
|
||||||
/* #endif */
|
/* #endif */
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
}
|
}
|
||||||
@ -179,6 +179,6 @@ $font-weight: 400;
|
|||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
-webkit-line-clamp: 2;
|
-webkit-line-clamp: 2;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
/* #endif */
|
/* #endif */
|
||||||
|
|
||||||
|
|||||||
219
utils/request.js
@ -1,21 +1,25 @@
|
|||||||
import Request from "@/lib/request/index.js";
|
import Request from "@/lib/request/index.js";
|
||||||
import { refreshTokenFn } from "@/api/login.js";
|
import {
|
||||||
|
refreshTokenFn
|
||||||
|
} from "@/api/login.js";
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
import { md5 } from "@/utils/md5.js";
|
import {
|
||||||
|
md5
|
||||||
|
} from "@/utils/md5.js";
|
||||||
import Foundation from "@/utils/Foundation.js";
|
import Foundation from "@/utils/Foundation.js";
|
||||||
import api from "@/config/api.js";
|
import api from "@/config/api.js";
|
||||||
|
|
||||||
import uuid from "@/utils/uuid.modified.js";
|
import uuid from "@/utils/uuid.modified.js";
|
||||||
|
|
||||||
function cleanStorage() {
|
function cleanStorage() {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "你的登录状态已过期,请重新登录",
|
title: "你的登录状态已过期,请重新登录",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 1500,
|
duration: 1500,
|
||||||
});
|
});
|
||||||
if (uni.showLoading()) {
|
if (uni.showLoading()) {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
storage.setHasLogin(false);
|
storage.setHasLogin(false);
|
||||||
storage.setAccessToken("");
|
storage.setAccessToken("");
|
||||||
@ -32,70 +36,61 @@ function cleanStorage() {
|
|||||||
// 防抖处理跳转
|
// 防抖处理跳转
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
|
|
||||||
// 防抖处理跳转
|
uni.navigateTo({
|
||||||
// #ifdef MP-WEIXIN
|
url: "/pages/passport/wechatMPLogin",
|
||||||
|
});
|
||||||
|
|
||||||
uni.navigateTo({
|
// #endif
|
||||||
url: "/pages/passport/wechatMPLogin",
|
|
||||||
});
|
|
||||||
|
|
||||||
// #endif
|
// #ifndef MP-WEIXIN
|
||||||
|
|
||||||
// #ifndef MP-WEIXIN
|
uni.navigateTo({
|
||||||
|
url: "/pages/passport/login",
|
||||||
|
});
|
||||||
|
|
||||||
const pages = getCurrentPages();
|
// #endif
|
||||||
const currentPage = pages[pages.length - 1];
|
|
||||||
const currentRoute = currentPage.route;
|
|
||||||
console.log(currentRoute,'===');
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/passport/login",
|
|
||||||
});
|
|
||||||
}, 5000);
|
|
||||||
|
|
||||||
// #endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let http = new Request();
|
let http = new Request();
|
||||||
|
|
||||||
http.setConfig((config) => {
|
|
||||||
// 没有uuid创建
|
|
||||||
if (!storage.getUuid()) {
|
|
||||||
storage.setUuid(uuid.v1());
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 设置全局配置 */
|
http.setConfig((config) => {
|
||||||
config.baseURL = api.buyer;
|
// 没有uuid创建
|
||||||
config.header = {
|
if (!storage.getUuid()) {
|
||||||
...config.header,
|
storage.setUuid(uuid.v1());
|
||||||
};
|
}
|
||||||
config.validateStatus = (statusCode) => {
|
|
||||||
// 不论什么状态,统一在正确中处理
|
/* 设置全局配置 */
|
||||||
return true;
|
config.baseURL = api.buyer;
|
||||||
};
|
config.header = {
|
||||||
return config;
|
...config.header,
|
||||||
|
};
|
||||||
|
config.validateStatus = (statusCode) => {
|
||||||
|
// 不论什么状态,统一在正确中处理
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
return config;
|
||||||
});
|
});
|
||||||
|
|
||||||
http.interceptors.request.use(
|
http.interceptors.request.use(
|
||||||
(config) => {
|
(config) => {
|
||||||
/* 请求之前拦截器。可以使用async await 做异步操作 */
|
/* 请求之前拦截器。可以使用async await 做异步操作 */
|
||||||
let accessToken = storage.getAccessToken();
|
let accessToken = storage.getAccessToken();
|
||||||
|
|
||||||
if (accessToken) {
|
if (accessToken) {
|
||||||
const nonce = Foundation.randomString(6);
|
const nonce = Foundation.randomString(6);
|
||||||
const timestamp = parseInt(new Date().getTime() / 1000);
|
const timestamp = parseInt(new Date().getTime() / 1000);
|
||||||
const sign = md5(nonce + timestamp + accessToken);
|
const sign = md5(nonce + timestamp + accessToken);
|
||||||
const _params = {
|
const _params = {
|
||||||
nonce,
|
nonce,
|
||||||
timestamp,
|
timestamp,
|
||||||
sign,
|
sign,
|
||||||
};
|
};
|
||||||
let params = config.params || {};
|
let params = config.params || {};
|
||||||
params = {
|
params = {
|
||||||
...params,
|
...params,
|
||||||
..._params,
|
..._params
|
||||||
};
|
};
|
||||||
|
|
||||||
config.params = params;
|
config.params = params;
|
||||||
config.header.accessToken = accessToken;
|
config.header.accessToken = accessToken;
|
||||||
@ -122,6 +117,7 @@ http.interceptors.request.use(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// 是否正在刷新的标记
|
// 是否正在刷新的标记
|
||||||
let isRefreshing = false;
|
let isRefreshing = false;
|
||||||
//重试队列
|
//重试队列
|
||||||
@ -138,50 +134,53 @@ http.interceptors.response.use(
|
|||||||
isRefreshing = false;
|
isRefreshing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let token = storage.getAccessToken();
|
let token = storage.getAccessToken();
|
||||||
if (
|
if (
|
||||||
(token && response.statusCode === 403) ||
|
(token && response.statusCode === 403) ||
|
||||||
response.data.status === 403
|
response.data.status === 403
|
||||||
) {
|
) {
|
||||||
if (!isRefreshing) {
|
if (!isRefreshing) {
|
||||||
isRefreshing = true;
|
isRefreshing = true;
|
||||||
//调用刷新token的接口
|
//调用刷新token的接口
|
||||||
return refreshTokenFn(storage.getRefreshToken())
|
return refreshTokenFn(storage.getRefreshToken())
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
let { accessToken, refreshToken } = res.data.result;
|
let {
|
||||||
storage.setAccessToken(accessToken);
|
accessToken,
|
||||||
storage.setRefreshToken(refreshToken);
|
refreshToken
|
||||||
|
} = res.data.result;
|
||||||
|
storage.setAccessToken(accessToken);
|
||||||
|
storage.setRefreshToken(refreshToken);
|
||||||
|
|
||||||
response.header.accessToken = `${accessToken}`;
|
response.header.accessToken = `${accessToken}`;
|
||||||
// token 刷新后将数组的方法重新执行
|
// token 刷新后将数组的方法重新执行
|
||||||
requests.forEach((cb) => cb(accessToken));
|
requests.forEach((cb) => cb(accessToken));
|
||||||
requests = []; // 重新请求完清空
|
requests = []; // 重新请求完清空
|
||||||
return http.request(response.config);
|
return http.request(response.config);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
cleanStorage();
|
cleanStorage();
|
||||||
return Promise.reject(err);
|
return Promise.reject(err);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
isRefreshing = false;
|
isRefreshing = false;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 返回未执行 resolve 的 Promise
|
// 返回未执行 resolve 的 Promise
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
// 用函数形式将 resolve 存入,等待刷新后再执行
|
// 用函数形式将 resolve 存入,等待刷新后再执行
|
||||||
requests.push((token) => {
|
requests.push((token) => {
|
||||||
response.header.accessToken = `${token}`;
|
response.header.accessToken = `${token}`;
|
||||||
resolve(http.request(response.config));
|
resolve(http.request(response.config));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果当前返回没登录
|
// 如果当前返回没登录
|
||||||
} else if (
|
} else if (
|
||||||
(!token && response.statusCode === 403) ||
|
(!token && response.statusCode === 403) ||
|
||||||
response.data.code === 403
|
response.data.code === 403
|
||||||
) {
|
) {
|
||||||
cleanStorage();
|
cleanStorage();
|
||||||
|
|
||||||
// 如果当前状态码为正常但是success为不正常时
|
// 如果当前状态码为正常但是success为不正常时
|
||||||
} else if (
|
} else if (
|
||||||
@ -205,11 +204,13 @@ http.interceptors.response.use(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
export { http };
|
export {
|
||||||
|
http
|
||||||
|
};
|
||||||
|
|
||||||
export const Method = {
|
export const Method = {
|
||||||
GET: "GET",
|
GET: "GET",
|
||||||
POST: "POST",
|
POST: "POST",
|
||||||
PUT: "PUT",
|
PUT: "PUT",
|
||||||
DELETE: "DELETE",
|
DELETE: "DELETE",
|
||||||
};
|
};
|
||||||