Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8119933af | ||
|
|
c9c048e1ed | ||
|
|
d363547bf7 | ||
|
|
bc5a59c104 | ||
|
|
46d8fe8b70 | ||
|
|
108f204f03 | ||
|
|
77fee4ea46 | ||
|
|
0e04c560bc | ||
|
|
e6d8bff772 | ||
|
|
44093a5893 | ||
|
|
7f058ec10b | ||
|
|
c226263289 | ||
|
|
a59d10e7dc | ||
|
|
3523ce5599 | ||
|
|
41d9da4c7e | ||
|
|
733048e2c9 | ||
|
|
8c00c82e3f | ||
|
|
452f3e3327 | ||
|
|
61cecbe8e5 | ||
|
|
88147f3783 | ||
|
|
069f0fa413 | ||
|
|
6e14b8dd69 | ||
|
|
ed5792b860 | ||
|
|
98a142dba1 | ||
|
|
b3ae93633c | ||
|
|
cb5449eaac | ||
|
|
37c1277a83 | ||
|
|
36585188c4 | ||
|
|
2ee9876f01 | ||
|
|
1687f417d7 | ||
|
|
59dec5c11c | ||
|
|
d5d85d2cd2 | ||
|
|
708aa88914 | ||
|
|
dfb92b7332 | ||
|
|
df47b96e87 | ||
|
|
5d8ea0cbd5 | ||
|
|
f38ba76ac0 | ||
|
|
1845171a1e | ||
|
|
007e80bebb | ||
|
|
a427cfbb92 | ||
|
|
f1e063aab9 | ||
|
|
876e15b655 | ||
|
|
b0d8d3163e | ||
|
|
1e58a29d9b | ||
|
|
e6ff7fafce | ||
|
|
640d61fd49 | ||
|
|
6843be82cb | ||
|
|
c58f785304 | ||
|
|
2062046901 | ||
|
|
1adef8d00b | ||
|
|
62b227034f | ||
|
|
60c3e0f572 | ||
|
|
0f76d54e27 | ||
|
|
0369f0f1d3 | ||
|
|
085730bb9c | ||
|
|
d68f734f95 | ||
|
|
41d99e95f9 | ||
|
|
ae72fc0a8f | ||
|
|
8e00a1e477 | ||
|
|
75d4b43e5e | ||
|
|
62d8cfd13b | ||
|
|
96b175a562 | ||
|
|
230fe66e82 | ||
|
|
20c53f245c | ||
|
|
ac741f9339 | ||
|
|
f0284d1b06 | ||
|
|
3ac6fa4e14 | ||
|
|
691f8eabd0 | ||
|
|
b0e7628f65 | ||
|
|
920e7cc1dc | ||
|
|
f4539ccf4a | ||
|
|
f20e73e859 | ||
|
|
57fc90b030 | ||
|
|
6b09cf8a90 | ||
|
|
4670b51a5a | ||
|
|
e729fb3c94 | ||
|
|
c6ef03434e | ||
|
|
f7a3bdc3fe | ||
|
|
b636cd905b | ||
|
|
9102c47804 | ||
|
|
238f56ab11 | ||
|
|
e92027d74e | ||
|
|
90d908a959 | ||
|
|
3f0ca5e55e | ||
|
|
63bebfdb94 | ||
|
|
35f7127134 | ||
|
|
50fe0e78c8 | ||
|
|
9f843f3bba | ||
|
|
eb3db99cb8 | ||
|
|
d7aecbe755 | ||
|
|
23f3d8b994 | ||
|
|
663d8f06fb | ||
|
|
37ba270104 | ||
|
|
3cd6f29e32 | ||
|
|
51e9d8b966 | ||
|
|
50363edc6e | ||
|
|
2bc47e46f1 | ||
|
|
6c851d4f29 | ||
|
|
76a877f2c2 | ||
|
|
55ed80acbc | ||
|
|
956d7bf70b | ||
|
|
62e7776b64 | ||
|
|
8f7ff49641 | ||
|
|
6d963a5bc0 | ||
|
|
b4c1ea20ac | ||
|
|
ffadc6c501 | ||
|
|
47ac886d5d | ||
|
|
f72a68ccc3 | ||
|
|
73fa5e35d4 | ||
|
|
93c9445008 | ||
|
|
ea44413ac1 | ||
|
|
13a9b7a2f6 | ||
|
|
80078cae78 | ||
|
|
27ac2a086d | ||
|
|
df87d0f9c8 | ||
|
|
7aeff7ece1 | ||
|
|
8b36c419a3 | ||
|
|
7dcba7c04b | ||
|
|
3b70c6ddf0 | ||
|
|
f182d3b63a | ||
|
|
ffeb37456c | ||
|
|
c5a6ec0d21 | ||
|
|
46eff30230 | ||
|
|
7ee65297de | ||
|
|
785b59c2ad | ||
|
|
87f9efe143 | ||
|
|
1467bd7365 | ||
|
|
8ade9b36e6 | ||
|
|
6762944340 | ||
|
|
15ffeee122 | ||
|
|
d290ab6e8f | ||
|
|
be6b9d9316 | ||
|
|
f44b87dfbb | ||
|
|
4fbb35ea0d | ||
|
|
e4f4421799 | ||
|
|
aa686f86ba | ||
|
|
fb9b85645b | ||
|
|
46c35bc1b6 | ||
|
|
34d9e21896 | ||
|
|
492ad9e6d4 | ||
|
|
6e7ffa414e | ||
|
|
7a72c4e1da | ||
|
|
194ef2d711 | ||
|
|
69597f3959 | ||
|
|
98a9f10bbf | ||
|
|
c76e3b1e0a | ||
|
|
f3e8051983 | ||
|
|
1701241aa9 | ||
|
|
87dbaef360 | ||
|
|
6ae771ecf0 | ||
|
|
9f2fefbf28 | ||
|
|
50dfa0e585 | ||
|
|
13fb22d780 | ||
|
|
85c3e45dc9 | ||
|
|
04b6a8d384 | ||
|
|
0891b8029c | ||
|
|
26c5c4d115 | ||
|
|
11e69ea9c7 | ||
|
|
0e5c07b5da | ||
|
|
89e1e058cc | ||
|
|
7c70f65892 | ||
|
|
4c008f2b55 | ||
|
|
e05ceb0f68 | ||
|
|
758d3a2127 | ||
|
|
16fc923e4b | ||
|
|
f488fd4147 | ||
|
|
ad280253b8 | ||
|
|
e7182902ba | ||
|
|
0c738a2dc5 | ||
|
|
4eb12b7a70 | ||
|
|
48e037e44e | ||
|
|
4e0972f38a | ||
|
|
9c6aa2351b | ||
|
|
88d5421322 | ||
|
|
b72e7db15e | ||
|
|
dba726dc12 | ||
|
|
fe1cdf4dd5 | ||
|
|
778702a877 | ||
|
|
cf1f2791f6 | ||
|
|
7bf0344028 | ||
|
|
3826e11a3e | ||
|
|
1b4db7d4f8 | ||
|
|
e0dd9aa7ed | ||
|
|
656c27fdb8 | ||
|
|
2cddb59530 | ||
|
|
27924672a2 | ||
|
|
638eadb632 | ||
|
|
1e78f76be1 | ||
|
|
f113bf75be | ||
|
|
1453220d04 | ||
|
|
3c6c153cfd | ||
|
|
b1aad14d43 | ||
|
|
6ad916df62 | ||
|
|
292f2b2745 | ||
|
|
be8c2301f4 | ||
|
|
4c84a96e07 | ||
|
|
45b98c7bf1 | ||
|
|
71d9a8907b | ||
|
|
e50df3d893 | ||
|
|
b6703830cf | ||
|
|
5987d9254e | ||
|
|
c18030a3c3 | ||
|
|
7e8e888886 | ||
|
|
56d8fb78b2 | ||
|
|
85838b64a4 | ||
|
|
a896523128 | ||
|
|
0636c93695 | ||
|
|
e0e475c0d0 | ||
|
|
39a94a51ec | ||
|
|
cb607556e5 | ||
|
|
a5a2652f19 | ||
|
|
badd8eecc9 | ||
|
|
b0d49cc6d5 | ||
|
|
3a214a3b9d | ||
|
|
fe442424b0 | ||
|
|
933c6a3628 | ||
|
|
d0cff1e562 | ||
|
|
ac45a0dfee | ||
|
|
84e72f9313 | ||
|
|
05ef78870b | ||
|
|
de0699e705 | ||
|
|
b4935444b6 | ||
|
|
535a98e43a | ||
|
|
6caf9afcc0 | ||
|
|
d2a27c08e2 | ||
|
|
153df11ed4 | ||
|
|
58d21cafda | ||
|
|
9a27e2df49 | ||
|
|
bf31bf859e | ||
|
|
e982bc0595 | ||
|
|
c367a236c1 | ||
|
|
842ba2ff7f | ||
|
|
02e1015594 | ||
|
|
2da80cd30b | ||
|
|
ebe76499a5 | ||
|
|
a54b674e6f | ||
|
|
76eea8dcb4 | ||
|
|
aa44879dff | ||
|
|
5d7c3ac0c0 | ||
|
|
3f9463258e | ||
|
|
976dd1b096 | ||
|
|
cff3dba809 | ||
|
|
57410cc656 | ||
|
|
1f2a504086 | ||
|
|
da380c000f | ||
|
|
2f26d70a0e | ||
|
|
0a68bd1ca1 | ||
|
|
94df324fc5 | ||
|
|
59565871d9 | ||
|
|
a50d274a59 | ||
|
|
ced676832e | ||
|
|
69e5ba0169 | ||
|
|
91aad660e6 | ||
|
|
c3c0483625 | ||
|
|
6cb403c5d5 | ||
|
|
28ee55f9fd | ||
|
|
c8bf87aa4b | ||
|
|
53312c889e | ||
|
|
e3a69a708c | ||
|
|
a113312712 | ||
|
|
77f803ef10 | ||
|
|
52817b48a8 | ||
|
|
09a8d1b476 | ||
|
|
20ca6c988e | ||
|
|
092ef55293 | ||
|
|
a14d89efff | ||
|
|
9bf4febea6 | ||
|
|
3b8faf1eea | ||
|
|
898c3b74bc | ||
|
|
8a1a58d14a | ||
|
|
8f164cc6ef | ||
|
|
3b935811e3 | ||
|
|
0d1dfae3bd | ||
|
|
94b2af52d0 | ||
|
|
8c1aa62024 | ||
|
|
d3602c010e |
@@ -112,6 +112,10 @@ export default {
|
|||||||
keyboardHeight: {
|
keyboardHeight: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0
|
||||||
|
},
|
||||||
|
voiceException: {
|
||||||
|
type: String,
|
||||||
|
default: '没有听清您说了什么,请再说一遍'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -262,11 +266,11 @@ export default {
|
|||||||
fail: err => {
|
fail: err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
_this.$toast(_this.voiceException)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
_this.$toast(_this.voiceException)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -282,7 +286,7 @@ export default {
|
|||||||
_this.getTransResultReq()
|
_this.getTransResultReq()
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
_this.$toast(_this.voiceException)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getTransResultReq() {
|
getTransResultReq() {
|
||||||
@@ -296,7 +300,7 @@ export default {
|
|||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
_this.clearIntervalFn()
|
_this.clearIntervalFn()
|
||||||
if (data === '__NULL__') {
|
if (data === '__NULL__') {
|
||||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
_this.$toast(_this.voiceException)
|
||||||
} else {
|
} else {
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
const prompt = data[0].Text
|
const prompt = data[0].Text
|
||||||
@@ -308,7 +312,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
_this.$toast(_this.voiceException)
|
||||||
})
|
})
|
||||||
}, 1000)
|
}, 1000)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -112,7 +112,9 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
getChatList,
|
getChatList,
|
||||||
deleteChatListByType
|
deleteChatListByType,
|
||||||
|
getCountyAiChatList,
|
||||||
|
deleteCountyChatListByType
|
||||||
} from '@/api/chat/index'
|
} from '@/api/chat/index'
|
||||||
export default {
|
export default {
|
||||||
name: 'AiHistoryList',
|
name: 'AiHistoryList',
|
||||||
@@ -125,6 +127,10 @@ export default {
|
|||||||
formModule: {
|
formModule: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
|
},
|
||||||
|
countyId: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -142,7 +148,17 @@ export default {
|
|||||||
this.getChatListReq()
|
this.getChatListReq()
|
||||||
},
|
},
|
||||||
getChatListReq() {
|
getChatListReq() {
|
||||||
getChatList().then(res => {
|
let reqFn = null
|
||||||
|
let params = {}
|
||||||
|
if (this.countyId) {
|
||||||
|
reqFn = getCountyAiChatList
|
||||||
|
params = {
|
||||||
|
countyId: this.countyId
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
reqFn = getChatList
|
||||||
|
}
|
||||||
|
reqFn(params).then(res => {
|
||||||
const { success, data } = res
|
const { success, data } = res
|
||||||
if (success) {
|
if (success) {
|
||||||
this.todayList = data['今天'] || []
|
this.todayList = data['今天'] || []
|
||||||
@@ -152,7 +168,15 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
deleteRecords(type) {
|
deleteRecords(type) {
|
||||||
deleteChatListByType(type).then(res => {
|
let reqFn = null
|
||||||
|
let params = ''
|
||||||
|
if (this.countyId) {
|
||||||
|
reqFn = deleteCountyChatListByType
|
||||||
|
params = `?countyId=${this.countyId}&type=${type}`
|
||||||
|
} else {
|
||||||
|
reqFn = deleteChatListByType
|
||||||
|
}
|
||||||
|
reqFn(type, params).then(res => {
|
||||||
const { success } = res
|
const { success } = res
|
||||||
if (success) {
|
if (success) {
|
||||||
this.getChatListReq()
|
this.getChatListReq()
|
||||||
@@ -160,7 +184,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
historyItemClick(item) {
|
historyItemClick(item) {
|
||||||
const paramsStr = `?chatNumber=${item.chatNumber}&title=${item.title}&click=1`
|
const paramsStr = `?chatNumber=${item.chatNumber}&title=${item.title}&click=1&countyId=${this.countyId}`
|
||||||
if (!this.formModule) {
|
if (!this.formModule) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/aiChat/views/history' + paramsStr
|
url: '/aiChat/views/history' + paramsStr
|
||||||
|
|||||||
@@ -91,7 +91,7 @@
|
|||||||
<view class="total">
|
<view class="total">
|
||||||
共{{ item.totalNum }}件商品
|
共{{ item.totalNum }}件商品
|
||||||
<text v-if="item.isGiftCardReceiveBlind === 0" class="total-txt">
|
<text v-if="item.isGiftCardReceiveBlind === 0" class="total-txt">
|
||||||
总金额<text class="color-red">¥{{ item.totalPrice }}</text>
|
总金额<text class="color-red">¥{{ item.payPrice }}</text>
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -100,10 +100,7 @@ export const chatMixins = {
|
|||||||
}.bind(this)).exec()
|
}.bind(this)).exec()
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
if (this.audioContext) {
|
this.audioStopHandle()
|
||||||
this.audioContext.stop()
|
|
||||||
}
|
|
||||||
wx.getBackgroundAudioManager().stop()
|
|
||||||
this.closeWsFn()
|
this.closeWsFn()
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -375,7 +372,7 @@ export const chatMixins = {
|
|||||||
const _this = this
|
const _this = this
|
||||||
console.log('------------------创建连接')
|
console.log('------------------创建连接')
|
||||||
uni.connectSocket({
|
uni.connectSocket({
|
||||||
url: VUE_APP_API_URL.replace('https', 'wss') + settings.sysPrefix + `v1/chat/websocket/${_this.userInfo.unionId}-${conversationId}`,
|
url: VUE_APP_API_URL.replace('https', 'wss') + settings.sysPrefix + `v1/chat/websocket/${_this.userInfo.uid}-${conversationId}`,
|
||||||
header: {
|
header: {
|
||||||
'content-type': 'application/json'
|
'content-type': 'application/json'
|
||||||
},
|
},
|
||||||
@@ -447,9 +444,15 @@ export const chatMixins = {
|
|||||||
this.audioAyy = []
|
this.audioAyy = []
|
||||||
if (this.audioContext) {
|
if (this.audioContext) {
|
||||||
this.audioContext.stop()
|
this.audioContext.stop()
|
||||||
|
this.audioContext.destroy() // 强制销毁释放资源
|
||||||
|
this.audioContext = null
|
||||||
}
|
}
|
||||||
this.isPlayAudio = false
|
this.isPlayAudio = false
|
||||||
|
|
||||||
|
// 强制关闭微信小程序背景音频
|
||||||
|
if (typeof wx !== 'undefined' && wx.getBackgroundAudioManager) {
|
||||||
wx.getBackgroundAudioManager().stop()
|
wx.getBackgroundAudioManager().stop()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
ttsHandle(item) {
|
ttsHandle(item) {
|
||||||
this.audioAyy = []
|
this.audioAyy = []
|
||||||
|
|||||||
+343
-77
@@ -3,9 +3,18 @@ import {
|
|||||||
getCompletionsV3,
|
getCompletionsV3,
|
||||||
deleteChatItemByConversationId,
|
deleteChatItemByConversationId,
|
||||||
// getAnalyzeKeywordsV1,
|
// getAnalyzeKeywordsV1,
|
||||||
getAnalyzeKeywordsChangeV3
|
getAnalyzeKeywordsChangeV3,
|
||||||
|
getSseCountyAiConfigV1,
|
||||||
|
getCountyAiCompletionsV1,
|
||||||
|
getGiftRecommendOptions,
|
||||||
|
getGiftRecommendPrompt
|
||||||
} from '@/api/chat/index'
|
} from '@/api/chat/index'
|
||||||
import {
|
import {
|
||||||
|
getExceptionConfig,
|
||||||
|
getBottomNavigationConfigList
|
||||||
|
} from '@/api/public'
|
||||||
|
import {
|
||||||
|
getProductDetail,
|
||||||
postCartAdd
|
postCartAdd
|
||||||
} from '@/api/store'
|
} from '@/api/store'
|
||||||
import { VUE_APP_API_URL } from '@/config'
|
import { VUE_APP_API_URL } from '@/config'
|
||||||
@@ -21,29 +30,7 @@ export const chatMixinsV2 = {
|
|||||||
token: cookie.get('login_status'),
|
token: cookie.get('login_status'),
|
||||||
userInfo: cookie.get('userInfo'),
|
userInfo: cookie.get('userInfo'),
|
||||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
bottomTools: Object.freeze([
|
bottomTools: [],
|
||||||
{
|
|
||||||
icon: 'icon-50',
|
|
||||||
text: '我要送礼',
|
|
||||||
type: 'prompt',
|
|
||||||
prompt: '我要送礼,请给我推荐一些平台的礼品',
|
|
||||||
url: ''
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'icon-51',
|
|
||||||
text: '订单查询',
|
|
||||||
type: 'prompt',
|
|
||||||
prompt: '帮我查询我的待发货、待收货订单信息',
|
|
||||||
url: ''
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'icon-52',
|
|
||||||
text: '拍照识图',
|
|
||||||
type: 'link',
|
|
||||||
prompt: '',
|
|
||||||
url: '/aiChat/views/imageRecognition'
|
|
||||||
}
|
|
||||||
]),
|
|
||||||
scrollData: {},
|
scrollData: {},
|
||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
isScrollToBottom: false,
|
isScrollToBottom: false,
|
||||||
@@ -57,31 +44,20 @@ export const chatMixinsV2 = {
|
|||||||
loading: false,
|
loading: false,
|
||||||
chatNumber: '',
|
chatNumber: '',
|
||||||
infoResData: {},
|
infoResData: {},
|
||||||
chatMessageList: [
|
chatMessageList: [],
|
||||||
/*
|
|
||||||
{
|
|
||||||
type: -2,
|
|
||||||
isError: false,
|
|
||||||
showCursor: false,
|
|
||||||
conversationId: '',
|
|
||||||
prompt: '',
|
|
||||||
nodes: '-------------监听 WebSocket 接受到服务器的消息事件',
|
|
||||||
content: '-------------监听 WebSocket 接受到服务器的消息事件',
|
|
||||||
listQuestion: [
|
|
||||||
'监听 WebSocket 接受到服务器的消息事件',
|
|
||||||
'监听 WebSocket 接受到服务器的消息事件',
|
|
||||||
'监听 WebSocket 接受到服务器的消息事件'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
],
|
|
||||||
errorMsg: Object.freeze('您提的问题未能理解,云灵思想跑偏啦,重新整理一下问题或者重新提问,让云灵再试试!'),
|
|
||||||
audioAyy: [],
|
audioAyy: [],
|
||||||
isPlayAudio: false,
|
isPlayAudio: false,
|
||||||
audioContext: null,
|
audioContext: null,
|
||||||
audioPlayId: '',
|
audioPlayId: '',
|
||||||
showGiftBtn: false,
|
showGiftBtn: false,
|
||||||
buyLoading: false
|
buyLoading: false,
|
||||||
|
buyActionLock: false,
|
||||||
|
exceptionConfig: {
|
||||||
|
model_exception: '您提的问题未能理解,云灵思想跑偏啦,重新整理一下问题或者重新提问,让云灵再试试!',
|
||||||
|
voice_exception: ''
|
||||||
|
},
|
||||||
|
giftStepLoading: false,
|
||||||
|
onlyOneToAddCart: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -106,12 +82,12 @@ export const chatMixinsV2 = {
|
|||||||
}.bind(this)).exec()
|
}.bind(this)).exec()
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
if (this.audioContext) {
|
this.audioStopHandle()
|
||||||
this.audioContext.stop()
|
|
||||||
}
|
|
||||||
wx.getBackgroundAudioManager().stop()
|
|
||||||
this.closeWsFn()
|
this.closeWsFn()
|
||||||
},
|
},
|
||||||
|
onHide() {
|
||||||
|
this.audioStopHandle()
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
const _this = this
|
const _this = this
|
||||||
uni.getSystemInfo({
|
uni.getSystemInfo({
|
||||||
@@ -131,7 +107,37 @@ export const chatMixinsV2 = {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
createdCallbak() {
|
createdCallbak() {
|
||||||
console.log('页面初始话回调')
|
this.$nextTick(() => {
|
||||||
|
this.scrollToBottomHandle()
|
||||||
|
getExceptionConfig().then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
this.exceptionConfig = data || {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// 县域AI没有底部快捷操作和送礼配置
|
||||||
|
if (!this.countyId) {
|
||||||
|
getBottomNavigationConfigList().then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
this.bottomTools = data || []
|
||||||
|
this.bottomTools.forEach(item => {
|
||||||
|
item.display = true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
getGiftRecommendOptions().then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
this.giftBuyOptions = data || {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.extraReqFn()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
extraReqFn() {
|
||||||
|
console.log('首页/历史详情页面单独请求接口逻辑')
|
||||||
},
|
},
|
||||||
inputFocusHandle(value) {
|
inputFocusHandle(value) {
|
||||||
this.onFocus = value === 1
|
this.onFocus = value === 1
|
||||||
@@ -215,7 +221,16 @@ export const chatMixinsV2 = {
|
|||||||
handleLoginFailure()
|
handleLoginFailure()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const prompt = params.prompt
|
if (params.prompt.length > 500) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "字数已超出限制",
|
||||||
|
icon: "none",
|
||||||
|
duration: 5000
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.loading) return
|
||||||
|
const prompt = params.prompt.substr(0, 500)
|
||||||
if (params.init !== 1) {
|
if (params.init !== 1) {
|
||||||
_this.chatMessageList.push({
|
_this.chatMessageList.push({
|
||||||
prompt,
|
prompt,
|
||||||
@@ -257,21 +272,49 @@ export const chatMixinsV2 = {
|
|||||||
})
|
})
|
||||||
_this.loading = true
|
_this.loading = true
|
||||||
_this.showCursor = false
|
_this.showCursor = false
|
||||||
getSseConfigV1({
|
let reqFn = null
|
||||||
|
let postData = {}
|
||||||
|
if (_this.countyId) {
|
||||||
|
reqFn = getSseCountyAiConfigV1
|
||||||
|
postData = {
|
||||||
|
'countyId': _this.countyId,
|
||||||
'chatNumber': _this.chatNumber,
|
'chatNumber': _this.chatNumber,
|
||||||
prompt
|
prompt
|
||||||
}).then(resConfig => {
|
}
|
||||||
|
} else {
|
||||||
|
reqFn = getSseConfigV1
|
||||||
|
postData = {
|
||||||
|
'chatNumber': _this.chatNumber,
|
||||||
|
prompt
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reqFn(postData).then(resConfig => {
|
||||||
const conversationId = resConfig.data.conversationId
|
const conversationId = resConfig.data.conversationId
|
||||||
_this.chatNumber = resConfig.data.chatNumber || ''
|
_this.chatNumber = resConfig.data.chatNumber || ''
|
||||||
_this.chatMessageList[_this.chatMessageListLength - 1].showCursor = true
|
_this.chatMessageList[_this.chatMessageListLength - 1].showCursor = true
|
||||||
_this.chatMessageList[_this.chatMessageListLength - 1].conversationId = conversationId
|
_this.chatMessageList[_this.chatMessageListLength - 1].conversationId = conversationId
|
||||||
if (conversationId) {
|
if (conversationId) {
|
||||||
_this.initWebSocket(conversationId, () => {
|
_this.initWebSocket(conversationId, () => {
|
||||||
getCompletionsV3({
|
|
||||||
|
let completionsReqFn = null
|
||||||
|
let completionsPostData = {}
|
||||||
|
if (_this.countyId) {
|
||||||
|
completionsReqFn = getCountyAiCompletionsV1
|
||||||
|
completionsPostData = {
|
||||||
|
conversationId,
|
||||||
|
countyId: _this.countyId,
|
||||||
|
ws: true,
|
||||||
|
isNoNeedPublicErrorNotification: 1
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
completionsReqFn = getCompletionsV3
|
||||||
|
completionsPostData = {
|
||||||
conversationId,
|
conversationId,
|
||||||
ws: true,
|
ws: true,
|
||||||
isNoNeedPublicErrorNotification: 1
|
isNoNeedPublicErrorNotification: 1
|
||||||
}).then(sseRes => {
|
}
|
||||||
|
}
|
||||||
|
completionsReqFn(completionsPostData).then(sseRes => {
|
||||||
console.log(sseRes)
|
console.log(sseRes)
|
||||||
// _this.closeWsFn()
|
// _this.closeWsFn()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
@@ -291,7 +334,7 @@ export const chatMixinsV2 = {
|
|||||||
const _this = this
|
const _this = this
|
||||||
console.log('------------------创建连接')
|
console.log('------------------创建连接')
|
||||||
uni.connectSocket({
|
uni.connectSocket({
|
||||||
url: VUE_APP_API_URL.replace('https', 'wss') + settings.sysPrefix + `v1/chat/websocket/${_this.userInfo.unionId}-${conversationId}`,
|
url: VUE_APP_API_URL.replace('https', 'wss') + settings.sysPrefix + `v1/chat/websocket/${_this.userInfo.uid}-${conversationId}`,
|
||||||
header: {
|
header: {
|
||||||
'content-type': 'application/json'
|
'content-type': 'application/json'
|
||||||
},
|
},
|
||||||
@@ -483,16 +526,72 @@ export const chatMixinsV2 = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
productItemBuyNowClickHandle(item) {
|
productItemBuyNowClickHandle(item) {
|
||||||
this.audioStopHandle()
|
|
||||||
this.showGiftBtn = false
|
this.showGiftBtn = false
|
||||||
this.cart_num = 1
|
this.productItemBuyNowOrGiftBuy(item, 1)
|
||||||
this.addToCart(item)
|
|
||||||
},
|
},
|
||||||
productItemGiftBuyClickHandle(item) {
|
productItemGiftBuyClickHandle(item) {
|
||||||
this.audioStopHandle()
|
|
||||||
this.showGiftBtn = true
|
this.showGiftBtn = true
|
||||||
|
this.productItemBuyNowOrGiftBuy(item, 2)
|
||||||
|
},
|
||||||
|
productItemBuyNowOrGiftBuy(item, BuyNowOrGiftBuyType) {
|
||||||
|
if (this.buyActionLock) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.buyActionLock = true
|
||||||
|
this.audioStopHandle()
|
||||||
this.cart_num = 1
|
this.cart_num = 1
|
||||||
this.addToCart(item)
|
this.m_id = item.id
|
||||||
|
getProductDetail(item.id).then(res => {
|
||||||
|
const { data } = res
|
||||||
|
this.storeInfo = {...data.storeInfo}
|
||||||
|
if(data.storeInfo.stock === 0) {
|
||||||
|
this.buyActionLock = false
|
||||||
|
uni.showToast({
|
||||||
|
title: "产品库存不足,请选择其他商品",
|
||||||
|
icon: "none",
|
||||||
|
duration: 5000
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.isWenwan = data.isWenwan
|
||||||
|
this.qualifications = data.qualifications || []
|
||||||
|
// 给 attr 赋值,将请求回来的规格赋值给 attr
|
||||||
|
if (this.source !== 'pre' && this.source !== 'day' && this.source !== 'kill' && this.source !== 'spe') {
|
||||||
|
this.attr.productAttr = data.productAttr || []
|
||||||
|
this.productValueArr = []
|
||||||
|
for (const key in data.productValue) {
|
||||||
|
this.productValueArr.push({
|
||||||
|
attrItemkey: key,
|
||||||
|
...data.productValue[key]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 初始化认为所有的规格都是可以选的
|
||||||
|
this.attr.productAttr.map(item => {
|
||||||
|
item.attrValue.map(subItem => {
|
||||||
|
subItem.canUsed = true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.attr.defaultSku = data.defaultSku
|
||||||
|
this.attr.defaultSkuIndex = data.defaultSkuIndex
|
||||||
|
this.DefaultSelect()
|
||||||
|
// 是否单一规格
|
||||||
|
const onlyOne = Object.keys(data.productValue).length === 1
|
||||||
|
|
||||||
|
if(onlyOne) {
|
||||||
|
this.buyNowOrGiftBuyReq(BuyNowOrGiftBuyType)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.attr.cartAttr = !this.isOpen ? true : false
|
||||||
|
this.buyActionLock = false
|
||||||
|
}).catch(error => {
|
||||||
|
this.buyActionLock = false
|
||||||
|
uni.showToast({
|
||||||
|
title: error.msg || '操作失败,请稍后重试',
|
||||||
|
icon: "none",
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
})
|
||||||
},
|
},
|
||||||
buyNowOrGiftBuyReq(type) {
|
buyNowOrGiftBuyReq(type) {
|
||||||
const _this = this
|
const _this = this
|
||||||
@@ -532,6 +631,7 @@ export const chatMixinsV2 = {
|
|||||||
})
|
})
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
_this.buyLoading = false
|
_this.buyLoading = false
|
||||||
|
_this.buyActionLock = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
closeAttrWindow() {
|
closeAttrWindow() {
|
||||||
@@ -570,8 +670,8 @@ export const chatMixinsV2 = {
|
|||||||
},
|
},
|
||||||
chatErrorSetContent() {
|
chatErrorSetContent() {
|
||||||
this.chatMessageList[this.chatMessageListLength - 1].isError = true
|
this.chatMessageList[this.chatMessageListLength - 1].isError = true
|
||||||
this.chatMessageList[this.chatMessageListLength - 1].content = this.errorMsg
|
this.chatMessageList[this.chatMessageListLength - 1].content = this.exceptionConfig.model_exception
|
||||||
this.chatMessageList[this.chatMessageListLength - 1].nodes = this.errorMsg
|
this.chatMessageList[this.chatMessageListLength - 1].nodes = this.exceptionConfig.model_exception
|
||||||
this.closeWsFn()
|
this.closeWsFn()
|
||||||
},
|
},
|
||||||
closeWsFn() {
|
closeWsFn() {
|
||||||
@@ -589,13 +689,26 @@ export const chatMixinsV2 = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
audioStopHandle() {
|
audioStopHandle() {
|
||||||
|
// 强制关闭微信小程序背景音频
|
||||||
|
try {
|
||||||
|
const bgAudio = wx.getBackgroundAudioManager ? wx.getBackgroundAudioManager() : null
|
||||||
|
if (bgAudio && typeof bgAudio.stop === 'function') {
|
||||||
|
bgAudio.stop()
|
||||||
|
bgAudio.src = ''
|
||||||
|
bgAudio.title = ''
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('stop background audio failed', e)
|
||||||
|
}
|
||||||
|
this.audioPlayId = ''
|
||||||
// Fix bug#4049
|
// Fix bug#4049
|
||||||
this.audioAyy = []
|
this.audioAyy = []
|
||||||
if (this.audioContext) {
|
if (this.audioContext) {
|
||||||
this.audioContext.stop()
|
this.audioContext.stop()
|
||||||
|
this.audioContext.destroy() // 强制销毁释放资源
|
||||||
|
this.audioContext = null
|
||||||
}
|
}
|
||||||
this.isPlayAudio = false
|
this.isPlayAudio = false
|
||||||
wx.getBackgroundAudioManager().stop()
|
|
||||||
},
|
},
|
||||||
ttsHandle(item) {
|
ttsHandle(item) {
|
||||||
this.audioAyy = []
|
this.audioAyy = []
|
||||||
@@ -604,13 +717,13 @@ export const chatMixinsV2 = {
|
|||||||
// this.audioContext.destroy()
|
// this.audioContext.destroy()
|
||||||
}
|
}
|
||||||
// 如果正在播放,点击当前播放的则认为是暂停
|
// 如果正在播放,点击当前播放的则认为是暂停
|
||||||
if (this.isPlayAudio && item.conversationId === this.audioPlayId) {
|
if (this.isPlayAudio && [item.conversationId, item.messageId, item.parentMessageId].includes(this.audioPlayId)) {
|
||||||
this.isPlayAudio = false
|
this.isPlayAudio = false
|
||||||
this.audioPlayId = ''
|
this.audioPlayId = ''
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.isPlayAudio = false
|
this.isPlayAudio = false
|
||||||
this.audioPlayId = item.conversationId
|
this.audioPlayId = item.conversationId || item.messageId || item.parentMessageId
|
||||||
const flag = 1
|
const flag = 1
|
||||||
if (flag === 1) {
|
if (flag === 1) {
|
||||||
console.log(removeMarkdown(item.content).replace(/[\n\t\s]/g, ''))
|
console.log(removeMarkdown(item.content).replace(/[\n\t\s]/g, ''))
|
||||||
@@ -674,34 +787,74 @@ export const chatMixinsV2 = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
playNextChunk() {
|
playNextChunk() {
|
||||||
if (this.audioAyy.length > 0 && this.audioPlayId) {
|
if (!this.audioAyy.length || !this.audioPlayId) {
|
||||||
|
this.isPlayAudio = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 销毁旧实例
|
||||||
|
if (this.audioContext) {
|
||||||
|
this.audioContext.stop()
|
||||||
|
this.audioContext.destroy()
|
||||||
|
this.audioContext = null
|
||||||
|
}
|
||||||
|
|
||||||
const src = this.audioAyy.shift()
|
const src = this.audioAyy.shift()
|
||||||
this.isPlayAudio = true
|
this.isPlayAudio = true
|
||||||
|
|
||||||
const audioContext = uni.createInnerAudioContext({
|
const audioContext = uni.createInnerAudioContext({
|
||||||
// 是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项
|
useWebAudioImplement: true // 短音频建议 true
|
||||||
useWebAudioImplement: false
|
|
||||||
})
|
})
|
||||||
|
|
||||||
this.audioContext = audioContext
|
this.audioContext = audioContext
|
||||||
audioContext.src = src
|
audioContext.src = src
|
||||||
|
|
||||||
|
audioContext.onPlay(() => {
|
||||||
|
console.log('audio play:', src)
|
||||||
|
})
|
||||||
|
|
||||||
audioContext.onEnded(() => {
|
audioContext.onEnded(() => {
|
||||||
|
this.audioContext = null
|
||||||
audioContext.destroy()
|
audioContext.destroy()
|
||||||
this.playNextChunk()
|
this.playNextChunk()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
audioContext.onError((err) => {
|
||||||
|
console.error('audio error', err)
|
||||||
|
this.audioContext = null
|
||||||
|
audioContext.destroy()
|
||||||
|
this.playNextChunk()
|
||||||
|
})
|
||||||
|
|
||||||
audioContext.play()
|
audioContext.play()
|
||||||
console.log('------------src:' + src)
|
|
||||||
} else {
|
|
||||||
console.log('------------end')
|
|
||||||
this.isPlayAudio = false
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
bottomToolClickHandle(item) {
|
bottomToolClickHandle(item) {
|
||||||
if (item.type === 'prompt') {
|
// 非界面跳转的需要校验登录状态
|
||||||
|
if (!this.token && item.navType !== 'url') {
|
||||||
|
handleLoginFailure()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const idx = this.bottomTools.findIndex((i) => i.giftCardEnabled === 1)
|
||||||
|
if (item.giftCardEnabled === 1) {
|
||||||
|
// 新建会话
|
||||||
|
this.createNewHandle('giftChat')
|
||||||
|
this.$set(this, 'showGiftSteps', true)
|
||||||
|
if (idx > -1) {
|
||||||
|
this.$set(this.bottomTools[idx], 'display', false)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$set(this, 'showGiftSteps', false)
|
||||||
|
if (idx > -1) {
|
||||||
|
this.$set(this.bottomTools[idx], 'display', true)
|
||||||
|
}
|
||||||
|
if (item.navType === 'prompt') {
|
||||||
this.streamReq({
|
this.streamReq({
|
||||||
prompt: item.prompt,
|
prompt: item.promptContent,
|
||||||
init: 0
|
init: 0
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (item.type === 'link') {
|
if (item.navType === 'url') {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: item.url
|
url: item.url
|
||||||
})
|
})
|
||||||
@@ -709,7 +862,120 @@ export const chatMixinsV2 = {
|
|||||||
},
|
},
|
||||||
viewOrderTrackHandle(order) {
|
viewOrderTrackHandle(order) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/order/OrderDetails/index?id=' + order.orderId
|
url: '/pagesOrder/order/OrderDetails/index?id=' + order.orderId
|
||||||
|
})
|
||||||
|
},
|
||||||
|
isGiftOptionSelected(configId, optionId) {
|
||||||
|
if (!this.giftSelections[configId]) return false
|
||||||
|
return this.giftSelections[configId].includes(optionId)
|
||||||
|
},
|
||||||
|
toggleGiftOption(configId, optionId) {
|
||||||
|
if (!this.giftSelections[configId]) {
|
||||||
|
this.$set(this.giftSelections, configId, [])
|
||||||
|
}
|
||||||
|
const index = this.giftSelections[configId].indexOf(optionId)
|
||||||
|
if (index > -1) {
|
||||||
|
this.giftSelections[configId].splice(index, 1)
|
||||||
|
} else {
|
||||||
|
this.giftSelections[configId].push(optionId)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
prevGiftStep() {
|
||||||
|
if (this.currentGiftStepIndex > 0) {
|
||||||
|
this.currentGiftStepIndex--
|
||||||
|
}
|
||||||
|
},
|
||||||
|
clearCurrentGiftStepData() {
|
||||||
|
const currentStep = this.giftBuyOptions[this.currentGiftStepIndex]
|
||||||
|
if (!currentStep) return
|
||||||
|
|
||||||
|
if (currentStep.type === 'option_card') {
|
||||||
|
const nextSelections = { ...this.giftSelections }
|
||||||
|
delete nextSelections[currentStep.id]
|
||||||
|
this.giftSelections = nextSelections
|
||||||
|
} else if (currentStep.type === 'price_input') {
|
||||||
|
this.giftBudget = ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
nextGiftStep() {
|
||||||
|
const currentStep = this.giftBuyOptions[this.currentGiftStepIndex]
|
||||||
|
let hasSelection = false
|
||||||
|
|
||||||
|
// 校验是否已选择
|
||||||
|
if (currentStep.type === 'option_card') {
|
||||||
|
const selectedIds = this.giftSelections[currentStep.id] || []
|
||||||
|
hasSelection = selectedIds.length > 0
|
||||||
|
} else if (currentStep.type === 'price_input') {
|
||||||
|
hasSelection = !!this.giftBudget
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasSelection) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请完善信息后再点击下一步',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.currentGiftStepIndex < this.giftBuyOptions.length - 1) {
|
||||||
|
this.currentGiftStepIndex++
|
||||||
|
} else {
|
||||||
|
this.finishGiftSteps()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
skipGiftStep() {
|
||||||
|
this.clearCurrentGiftStepData()
|
||||||
|
if (this.currentGiftStepIndex < this.giftBuyOptions.length - 1) {
|
||||||
|
this.currentGiftStepIndex++
|
||||||
|
} else {
|
||||||
|
this.finishGiftSteps()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
finishGiftSteps() {
|
||||||
|
if (this.giftStepLoading || this.loading) return
|
||||||
|
const selectedSteps = []
|
||||||
|
this.giftBuyOptions.forEach(step => {
|
||||||
|
if (step.type === 'option_card') {
|
||||||
|
const selectedIds = this.giftSelections[step.id] || []
|
||||||
|
if (selectedIds.length > 0) {
|
||||||
|
const selectedNames = step.options.filter(opt => selectedIds.includes(opt.id)).map(opt => opt.optionName)
|
||||||
|
selectedSteps.push({
|
||||||
|
sort: step.sort,
|
||||||
|
title: step.title,
|
||||||
|
type: step.type,
|
||||||
|
options: selectedNames
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else if (step.type === 'price_input') {
|
||||||
|
if (this.giftBudget) {
|
||||||
|
selectedSteps.push({
|
||||||
|
sort: step.sort,
|
||||||
|
title: step.title,
|
||||||
|
type: step.type,
|
||||||
|
options: [this.giftBudget]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(selectedSteps)
|
||||||
|
uni.showLoading()
|
||||||
|
this.giftStepLoading = true
|
||||||
|
getGiftRecommendPrompt(selectedSteps).then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
this.showGiftSteps = false
|
||||||
|
this.streamReq({
|
||||||
|
prompt: data.prompt || '我想送礼',
|
||||||
|
init: 0
|
||||||
|
})
|
||||||
|
// 清空所有送礼选项
|
||||||
|
this.giftSelections = {}
|
||||||
|
this.giftBudget = ''
|
||||||
|
this.currentGiftStepIndex = 0
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
this.giftStepLoading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+53
-12
@@ -45,14 +45,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="item.type === -2" class="chat-message-body">
|
<view v-if="item.type === -2" class="chat-message-body">
|
||||||
<view v-if="item.nodes && item.nodes.length" class="avatar">
|
<view class="avatar">
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/aiChat/avatar.png'"
|
:src="webUrl + '/aiChat/avatar.png'"
|
||||||
class="chat-avatar"
|
class="chat-avatar"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="item.nodes && item.nodes.length" class="item-left">
|
<view class="item-left">
|
||||||
<view class="txt">
|
<view class="txt">
|
||||||
<view
|
<view
|
||||||
ref="rich-text-box"
|
ref="rich-text-box"
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
space="nbsp"
|
space="nbsp"
|
||||||
/>
|
/>
|
||||||
<view v-if="!(item.nodes && item.nodes.length) && loading" class="loader-wrap">
|
<view v-if="!(item.nodes && item.nodes.length) && loading" class="loader-wrap">
|
||||||
<div class="loader" />
|
<div class="loading2" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
@@ -109,13 +109,13 @@
|
|||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
:class="{
|
:class="{
|
||||||
'playing': audioPlayId === item.conversationId && isPlayAudio
|
'playing': [item.conversationId, item.messageId, item.parentMessageId].includes(audioPlayId) && isPlayAudio
|
||||||
}"
|
}"
|
||||||
class="item"
|
class="item"
|
||||||
@click="ttsHandle(item)"
|
@click="ttsHandle(item)"
|
||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/aiChat/' + ((audioPlayId === item.conversationId && isPlayAudio) ? 'audio-on' : 'audio-off') +'.png'"
|
:src="webUrl + '/aiChat/' + (([item.conversationId, item.messageId, item.parentMessageId].includes(audioPlayId) && isPlayAudio) ? 'audio-on' : 'audio-off') +'.png'"
|
||||||
class="icon"
|
class="icon"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
@@ -379,7 +379,12 @@
|
|||||||
@click="scrollToBottomHandle"
|
@click="scrollToBottomHandle"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="container">
|
<view
|
||||||
|
:class="{
|
||||||
|
'container-county': !!countyId
|
||||||
|
}"
|
||||||
|
class="container"
|
||||||
|
>
|
||||||
<view
|
<view
|
||||||
v-if="chatNumber"
|
v-if="chatNumber"
|
||||||
class="new-chat"
|
class="new-chat"
|
||||||
@@ -393,17 +398,21 @@
|
|||||||
开启新对话
|
开启新对话
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
|
v-if="!countyId"
|
||||||
v-for="(item, index) in bottomTools"
|
v-for="(item, index) in bottomTools"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
:class="{
|
||||||
|
'hide': !item.display
|
||||||
|
}"
|
||||||
class="bottom-tool-item"
|
class="bottom-tool-item"
|
||||||
@click="bottomToolClickHandle(item)"
|
@click="bottomToolClickHandle(item)"
|
||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/aiChat/' + item.icon + '.png'"
|
:src="item.icon"
|
||||||
class="tool-icon"
|
class="tool-icon"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
{{ item.text }}
|
{{ item.name }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -411,6 +420,7 @@
|
|||||||
ref="bottomSend"
|
ref="bottomSend"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:keyboard-height="keyboardHeight"
|
:keyboard-height="keyboardHeight"
|
||||||
|
:voice-exception="exceptionConfig.voice_exception"
|
||||||
@send="streamReq"
|
@send="streamReq"
|
||||||
@history="historyViewHandle"
|
@history="historyViewHandle"
|
||||||
@focus="inputFocusHandle"
|
@focus="inputFocusHandle"
|
||||||
@@ -418,6 +428,7 @@
|
|||||||
<AiHistoryList
|
<AiHistoryList
|
||||||
ref="historyView"
|
ref="historyView"
|
||||||
:status-bar-height="statusBarHeight"
|
:status-bar-height="statusBarHeight"
|
||||||
|
:county-id="countyId"
|
||||||
form-module="history"
|
form-module="history"
|
||||||
@enter-history="audioStopHandle"
|
@enter-history="audioStopHandle"
|
||||||
/>
|
/>
|
||||||
@@ -445,7 +456,8 @@ import BottomSend from '../components/bottomSend.vue'
|
|||||||
import OrderItem from '../components/orderItem.vue'
|
import OrderItem from '../components/orderItem.vue'
|
||||||
import ProductWindow from '@/components/ProductWindow'
|
import ProductWindow from '@/components/ProductWindow'
|
||||||
import {
|
import {
|
||||||
historyChatMessage
|
historyChatMessage,
|
||||||
|
getCountyAiHistoryChatMessage
|
||||||
} from '@/api/chat/index'
|
} from '@/api/chat/index'
|
||||||
import { formatAiMsgContent } from '../utils/aiChat'
|
import { formatAiMsgContent } from '../utils/aiChat'
|
||||||
export default {
|
export default {
|
||||||
@@ -459,19 +471,27 @@ export default {
|
|||||||
mixins: [chatMixinsV2, goCartMixin],
|
mixins: [chatMixinsV2, goCartMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
pageTitle: ''
|
pageTitle: '',
|
||||||
|
countyId: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.chatNumber = options.chatNumber
|
this.chatNumber = options.chatNumber
|
||||||
this.pageTitle = options.title
|
this.pageTitle = options.title || ''
|
||||||
|
this.countyId = options.countyId || ''
|
||||||
this.pageTitle = this.pageTitle.length > 8 ? (this.pageTitle.substring(0, 8) + '...') : this.pageTitle
|
this.pageTitle = this.pageTitle.length > 8 ? (this.pageTitle.substring(0, 8) + '...') : this.pageTitle
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
historyChatMessage({
|
let reqFn = null
|
||||||
|
if (this.countyId) {
|
||||||
|
reqFn = getCountyAiHistoryChatMessage
|
||||||
|
} else {
|
||||||
|
reqFn = historyChatMessage
|
||||||
|
}
|
||||||
|
reqFn({
|
||||||
chatNumber: this.chatNumber
|
chatNumber: this.chatNumber
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
const { success, data = [] } = res
|
const { success, data = [] } = res
|
||||||
@@ -547,6 +567,9 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(this.chatMessageList)
|
console.log(this.chatMessageList)
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.scrollToBottomHandle()
|
||||||
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '错误提示',
|
title: '错误提示',
|
||||||
@@ -572,6 +595,24 @@ export default {
|
|||||||
createNewHandle() {
|
createNewHandle() {
|
||||||
uni.setStorageSync('addNewChat', '1')
|
uni.setStorageSync('addNewChat', '1')
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
|
},
|
||||||
|
bottomToolClickHandle(item) {
|
||||||
|
if (item.giftCardEnabled === 1) {
|
||||||
|
uni.setStorageSync('addNewChat', '2')
|
||||||
|
uni.navigateBack()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (item.navType === 'prompt') {
|
||||||
|
this.streamReq({
|
||||||
|
prompt: item.promptContent,
|
||||||
|
init: 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (item.navType === 'url') {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: item.url
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="sheet-divider" />
|
<view class="sheet-divider" />
|
||||||
<view class="goods-grid">
|
<view v-if="!loaded" class="loading-state">
|
||||||
|
<u-loading-icon mode="circle" size="36" text="正在识别中..." vertical textSize="14"></u-loading-icon>
|
||||||
|
</view>
|
||||||
|
<view v-else class="goods-grid">
|
||||||
<view
|
<view
|
||||||
v-for="(item, index) in goodsList"
|
v-for="(item, index) in goodsList"
|
||||||
:key="index"
|
:key="index"
|
||||||
@@ -66,6 +69,9 @@
|
|||||||
lazy-load
|
lazy-load
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="item.similarityScore > 0" class="goods-desc">
|
||||||
|
相似度{{ item.similarityScore }}%
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -84,6 +90,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
loaded: false,
|
||||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
statusBarHeight: 20,
|
statusBarHeight: 20,
|
||||||
imageUrl: '',
|
imageUrl: '',
|
||||||
@@ -245,6 +252,13 @@ export default {
|
|||||||
margin: 0 32rpx;
|
margin: 0 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.loading-state {
|
||||||
|
padding: 120rpx 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.empty-state {
|
.empty-state {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
@@ -301,6 +315,12 @@ export default {
|
|||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
.goods-desc {
|
||||||
|
padding: 10rpx 14rpx 20rpx 14rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
.price-left {
|
.price-left {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
+231
-26
@@ -16,7 +16,7 @@
|
|||||||
transparent="auto"
|
transparent="auto"
|
||||||
barPlaceholder="hidden"
|
barPlaceholder="hidden"
|
||||||
title="云灵"
|
title="云灵"
|
||||||
@click-left="clickBackHandle"
|
@click-left="pageContainerBeforeleave"
|
||||||
/>
|
/>
|
||||||
<page-container
|
<page-container
|
||||||
:show="true"
|
:show="true"
|
||||||
@@ -40,17 +40,25 @@
|
|||||||
conversationId: '123'
|
conversationId: '123'
|
||||||
})">播放</button> -->
|
})">播放</button> -->
|
||||||
<block v-if="chatMessageListLength < 1">
|
<block v-if="chatMessageListLength < 1">
|
||||||
<view class="home-wrap">
|
<view
|
||||||
|
:class="{
|
||||||
|
'county-home-wrap': !!countyId
|
||||||
|
}"
|
||||||
|
class="home-wrap"
|
||||||
|
>
|
||||||
<view class="home-focus-wrap">
|
<view class="home-focus-wrap">
|
||||||
<view class="focus-guide-wrap">
|
<view class="focus-guide-wrap">
|
||||||
<view class="guide-left">
|
<view class="guide-left">
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/aiChat/logo-01.gif'"
|
:src="webUrl + '/aiChat/logo-transition.png'"
|
||||||
class="avatar"
|
:class="{
|
||||||
|
'county-avatar': !!countyId
|
||||||
|
}"
|
||||||
|
class="avatar avatar-bounce"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="guide-right">
|
<view v-if="!showGiftSteps" class="guide-right">
|
||||||
<view class="title">{{ settingInfo.helloMessageTitle }}</view>
|
<view class="title">{{ settingInfo.helloMessageTitle }}</view>
|
||||||
<view class="content">{{ settingInfo.helloMessageContent }}</view>
|
<view class="content">{{ settingInfo.helloMessageContent }}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -99,7 +107,8 @@
|
|||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="topic-wrap">
|
<!-- 大家都在问 -->
|
||||||
|
<view v-if="!showGiftSteps && !countyId" class="topic-wrap">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
<view class="title-left">大家都在问</view>
|
<view class="title-left">大家都在问</view>
|
||||||
<view class="title-right" @click="loadData('click')">
|
<view class="title-right" @click="loadData('click')">
|
||||||
@@ -133,6 +142,66 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 县域 -->
|
||||||
|
<view v-if="!showGiftSteps && countyId" class="county-tools-wrap">
|
||||||
|
<view class="list-cont">
|
||||||
|
<view
|
||||||
|
v-for="(item, index) in countyTools"
|
||||||
|
:key="index"
|
||||||
|
class="list-item"
|
||||||
|
@click="countyToolItemClickHandle(item)"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="item.icon"
|
||||||
|
class="icon"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
<view class="name">{{ item.name }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 在这里实现送礼步骤 -->
|
||||||
|
<view v-if="showGiftSteps" class="gift-steps-wrap">
|
||||||
|
<view
|
||||||
|
v-for="(item, index) in giftBuyOptions"
|
||||||
|
:key="index"
|
||||||
|
style="width: 100%;"
|
||||||
|
>
|
||||||
|
<view v-show="currentGiftStepIndex === index" class="gift-step-item">
|
||||||
|
<view class="gift-step-title">{{ item.title }}</view>
|
||||||
|
<view v-if="item.type === 'option_card'" class="gift-options">
|
||||||
|
<view
|
||||||
|
v-for="opt in item.options"
|
||||||
|
:key="opt.id"
|
||||||
|
class="gift-option-item"
|
||||||
|
:class="{ active: isGiftOptionSelected(item.id, opt.id) }"
|
||||||
|
@click="toggleGiftOption(item.id, opt.id)"
|
||||||
|
>
|
||||||
|
{{ opt.optionName }}
|
||||||
|
<image v-if="isGiftOptionSelected(item.id, opt.id)" :src="webUrl + '/aiChat/gift-options-check.png'" class="icon-check" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.type === 'price_input'" class="gift-price-input">
|
||||||
|
<view class="input-wrap">
|
||||||
|
<text class="label">价格预算:</text>
|
||||||
|
<input
|
||||||
|
v-model="giftBudget"
|
||||||
|
:placeholder="item.guideContent || '例如100以内/300~500元'"
|
||||||
|
class="input-budget"
|
||||||
|
placeholder-style="color: #ccc;"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="gift-step-actions">
|
||||||
|
<view class="action-btn-group">
|
||||||
|
<view v-if="currentGiftStepIndex > 0" class="btn btn-prev" @click="prevGiftStep">上一步</view>
|
||||||
|
<view class="btn btn-next" :class="{'full-width': currentGiftStepIndex === 0}" @click="nextGiftStep">下一步</view>
|
||||||
|
</view>
|
||||||
|
<view class="btn-skip" @click="skipGiftStep">跳过</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<view v-if="chatMessageListLength > 0" class="chat-wrap">
|
<view v-if="chatMessageListLength > 0" class="chat-wrap">
|
||||||
@@ -224,13 +293,13 @@
|
|||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
:class="{
|
:class="{
|
||||||
'playing': audioPlayId === item.conversationId && isPlayAudio
|
'playing': [item.conversationId, item.messageId, item.parentMessageId].includes(audioPlayId) && isPlayAudio
|
||||||
}"
|
}"
|
||||||
class="item"
|
class="item"
|
||||||
@click="ttsHandle(item)"
|
@click="ttsHandle(item)"
|
||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/aiChat/' + ((audioPlayId === item.conversationId && isPlayAudio) ? 'audio-on' : 'audio-off') +'.png'"
|
:src="webUrl + '/aiChat/' + (([item.conversationId, item.messageId, item.parentMessageId].includes(audioPlayId) && isPlayAudio) ? 'audio-on' : 'audio-off') +'.png'"
|
||||||
class="icon"
|
class="icon"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
@@ -500,9 +569,14 @@
|
|||||||
@click="scrollToBottomHandle"
|
@click="scrollToBottomHandle"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="container">
|
|
||||||
<view
|
<view
|
||||||
v-if="chatNumber"
|
:class="{
|
||||||
|
'container-county': !!countyId
|
||||||
|
}"
|
||||||
|
class="container"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
v-if="chatNumber || showGiftSteps"
|
||||||
class="new-chat"
|
class="new-chat"
|
||||||
@click="createNewHandle"
|
@click="createNewHandle"
|
||||||
>
|
>
|
||||||
@@ -514,17 +588,21 @@
|
|||||||
开启新对话
|
开启新对话
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
|
v-if="!countyId"
|
||||||
v-for="(item, index) in bottomTools"
|
v-for="(item, index) in bottomTools"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
:class="{
|
||||||
|
'hide': !item.display
|
||||||
|
}"
|
||||||
class="bottom-tool-item"
|
class="bottom-tool-item"
|
||||||
@click="bottomToolClickHandle(item)"
|
@click="bottomToolClickHandle(item)"
|
||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/aiChat/' + item.icon + '.png'"
|
:src="item.icon"
|
||||||
class="tool-icon"
|
class="tool-icon"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
{{ item.text }}
|
{{ item.name }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -532,6 +610,7 @@
|
|||||||
ref="bottomSend"
|
ref="bottomSend"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:keyboard-height="keyboardHeight"
|
:keyboard-height="keyboardHeight"
|
||||||
|
:voice-exception="exceptionConfig.voice_exception"
|
||||||
@send="streamReq"
|
@send="streamReq"
|
||||||
@add="createNewHandle"
|
@add="createNewHandle"
|
||||||
@history="historyViewHandle"
|
@history="historyViewHandle"
|
||||||
@@ -540,6 +619,7 @@
|
|||||||
<AiHistoryList
|
<AiHistoryList
|
||||||
ref="historyView"
|
ref="historyView"
|
||||||
:status-bar-height="statusBarHeight"
|
:status-bar-height="statusBarHeight"
|
||||||
|
:county-id="countyId"
|
||||||
@enter-history="audioStopHandle"
|
@enter-history="audioStopHandle"
|
||||||
/>
|
/>
|
||||||
<ProductWindow
|
<ProductWindow
|
||||||
@@ -565,6 +645,9 @@ import {
|
|||||||
getAiSystemInfoSetting,
|
getAiSystemInfoSetting,
|
||||||
getAiSystemInfoTopic
|
getAiSystemInfoTopic
|
||||||
} from '@/api/public'
|
} from '@/api/public'
|
||||||
|
import {
|
||||||
|
getCountyAiDetail
|
||||||
|
} from '@/api/chat/index'
|
||||||
import AiHistoryList from '../components/historyList'
|
import AiHistoryList from '../components/historyList'
|
||||||
import BottomSend from '../components/bottomSend.vue'
|
import BottomSend from '../components/bottomSend.vue'
|
||||||
import OrderItem from '../components/orderItem.vue'
|
import OrderItem from '../components/orderItem.vue'
|
||||||
@@ -581,30 +664,58 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
cityName: '',
|
cityName: '',
|
||||||
|
countyId: '',
|
||||||
animationWidth: '150%',
|
animationWidth: '150%',
|
||||||
animationStr: '',
|
animationStr: '',
|
||||||
settingInfo: {},
|
settingInfo: {},
|
||||||
topicList: [],
|
topicList: [],
|
||||||
onlyOneToAddCart: false,
|
topicIsRotate: false,
|
||||||
topicIsRotate: false
|
showGiftSteps: false,
|
||||||
|
currentGiftStepIndex: 0,
|
||||||
|
giftSelections: {},
|
||||||
|
giftBudget: '',
|
||||||
|
giftBuyOptions: [],
|
||||||
|
countyTools: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.cityName = options.cityName || ''
|
this.cityName = options.cityName || ''
|
||||||
|
this.countyId = options.countyId || ''
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
const addNewChat = uni.getStorageSync('addNewChat') === '1'
|
// 1-新对话,2-我要送礼
|
||||||
|
const addNewChat = uni.getStorageSync('addNewChat') || ''
|
||||||
// 从历史界面点击新增对话
|
// 从历史界面点击新增对话
|
||||||
if (addNewChat && this.chatNumber) {
|
if (addNewChat) {
|
||||||
console.log(addNewChat)
|
if (addNewChat === '1' && (this.chatNumber || this.showGiftSteps)) {
|
||||||
uni.removeStorageSync('addNewChat')
|
|
||||||
this.createNewHandle()
|
this.createNewHandle()
|
||||||
}
|
}
|
||||||
|
if (addNewChat === '2') {
|
||||||
|
const giftOptionItem = this.bottomTools.find((i) => i.giftCardEnabled === 1)
|
||||||
|
if (giftOptionItem) {
|
||||||
|
this.bottomToolClickHandle(giftOptionItem)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uni.removeStorageSync('addNewChat')
|
||||||
|
}
|
||||||
|
this.audioStopHandle()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
createdCallbak() {
|
extraReqFn() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.scrollToBottomHandle()
|
this.scrollToBottomHandle()
|
||||||
|
if (this.countyId) {
|
||||||
|
getCountyAiDetail({
|
||||||
|
countyId: this.countyId
|
||||||
|
}).then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
this.settingInfo.helloMessageTitle = data.title || ''
|
||||||
|
this.settingInfo.helloMessageContent = data.introduction || ''
|
||||||
|
this.countyTools = data.modules || []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
getAiSystemInfoSetting().then(res => {
|
getAiSystemInfoSetting().then(res => {
|
||||||
const { success, data } = res
|
const { success, data } = res
|
||||||
if (success) {
|
if (success) {
|
||||||
@@ -614,6 +725,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.loadData()
|
this.loadData()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
loadData(type = '') {
|
loadData(type = '') {
|
||||||
@@ -643,13 +755,12 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 创建新会话
|
// 创建新会话
|
||||||
createNewHandle() {
|
createNewHandle(type = '') {
|
||||||
this.closeAttrWindow()
|
this.closeAttrWindow()
|
||||||
if (this.audioContext) {
|
if (this.audioContext) {
|
||||||
this.audioContext.stop()
|
this.audioContext.stop()
|
||||||
}
|
}
|
||||||
wx.getBackgroundAudioManager().stop()
|
wx.getBackgroundAudioManager().stop()
|
||||||
if (!this.chatNumber) return
|
|
||||||
this.closeWsFn()
|
this.closeWsFn()
|
||||||
this.chatNumber = ''
|
this.chatNumber = ''
|
||||||
this.showCursor = false
|
this.showCursor = false
|
||||||
@@ -657,9 +768,21 @@ export default {
|
|||||||
this.getConfigLoading = false
|
this.getConfigLoading = false
|
||||||
this.chatMessageList = []
|
this.chatMessageList = []
|
||||||
this.loadData()
|
this.loadData()
|
||||||
|
// 清空所有送礼选项
|
||||||
|
this.giftSelections = {}
|
||||||
|
this.giftBudget = ''
|
||||||
|
this.currentGiftStepIndex = 0
|
||||||
|
if (type !== 'giftChat') {
|
||||||
|
const idx = this.bottomTools.findIndex((i) => i.giftCardEnabled === 1)
|
||||||
|
this.$set(this, 'showGiftSteps', false)
|
||||||
|
if (idx > -1) {
|
||||||
|
this.$set(this.bottomTools[idx], 'display', true)
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
/*
|
||||||
clickBackHandle() {
|
clickBackHandle() {
|
||||||
if (!this.chatNumber) {
|
if (!this.chatNumber && !this.showGiftSteps) {
|
||||||
if (getCurrentPages().length > 1) {
|
if (getCurrentPages().length > 1) {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
} else {
|
} else {
|
||||||
@@ -671,8 +794,9 @@ export default {
|
|||||||
this.createNewHandle()
|
this.createNewHandle()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
*/
|
||||||
pageContainerBeforeleave() {
|
pageContainerBeforeleave() {
|
||||||
if (!this.chatNumber) {
|
if (!this.chatNumber && !this.showGiftSteps) {
|
||||||
if (getCurrentPages().length > 1) {
|
if (getCurrentPages().length > 1) {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
} else {
|
} else {
|
||||||
@@ -683,6 +807,19 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.createNewHandle()
|
this.createNewHandle()
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
countyToolItemClickHandle(item) {
|
||||||
|
if (item.moduleType === 'prompt') {
|
||||||
|
this.streamReq({
|
||||||
|
prompt: item.promptContent,
|
||||||
|
init: 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (item.moduleType === 'url') {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: item.url
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -725,9 +862,18 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
height: calc(100vh - 240rpx);
|
min-height: calc(100vh - 240rpx);
|
||||||
|
height: auto;
|
||||||
padding: 0 0 240rpx 0;
|
padding: 0 0 240rpx 0;
|
||||||
|
padding-bottom: calc(240rpx + constant(safe-area-inset-bottom));
|
||||||
|
padding-bottom: calc(240rpx + env(safe-area-inset-bottom));
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
.gift-steps-wrap {
|
||||||
|
padding-bottom: 40rpx;
|
||||||
|
padding-bottom: calc(40rpx + constant(safe-area-inset-bottom));
|
||||||
|
padding-bottom: calc(40rpx + env(safe-area-inset-bottom));
|
||||||
}
|
}
|
||||||
.focus-guide-wrap {
|
.focus-guide-wrap {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -737,8 +883,13 @@ export default {
|
|||||||
.guide-left {
|
.guide-left {
|
||||||
.avatar {
|
.avatar {
|
||||||
display: block;
|
display: block;
|
||||||
width: 230rpx;
|
width: 400rpx;
|
||||||
height: 404rpx;
|
}
|
||||||
|
.county-avatar {
|
||||||
|
width: 360rpx;
|
||||||
|
}
|
||||||
|
.avatar-bounce {
|
||||||
|
animation: bounce 2s infinite ease-in-out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.guide-right {
|
.guide-right {
|
||||||
@@ -822,4 +973,58 @@ export default {
|
|||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes bounce {
|
||||||
|
0%, 100% {
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
transform: translateY(-20rpx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.county-home-wrap {
|
||||||
|
justify-content: flex-start;
|
||||||
|
.guide-right {
|
||||||
|
.content {
|
||||||
|
padding: 30rpx 32rpx 0 32rpx;
|
||||||
|
color: #666;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.county-tools-wrap {
|
||||||
|
width: 100%;
|
||||||
|
padding: 40rpx 0 0 0;
|
||||||
|
.list-cont {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 60rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.list-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 28%;
|
||||||
|
padding: 20rpx 0 12rpx 0;
|
||||||
|
margin: 0 0 24rpx 0;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0 0 12rpx rgba(0, 0, 0, 0.1);
|
||||||
|
.icon {
|
||||||
|
display: block;
|
||||||
|
width: 60rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
margin: 0 8rpx 0 0;
|
||||||
|
}
|
||||||
|
.name {
|
||||||
|
padding: 8rpx 0 0 0;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ export function deleteChatListByType(type) {
|
|||||||
return request.delete('/v1/chat/type/' + type, {}, { login: true })
|
return request.delete('/v1/chat/type/' + type, {}, { login: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function deleteCountyChatListByType(type, params) {
|
||||||
|
return request.delete('/county-ai/chat/type/' + type + params, {}, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
export function getWeatherData(params) {
|
export function getWeatherData(params) {
|
||||||
return request.get('/v1/chat/weatherData', params, { login: true })
|
return request.get('/v1/chat/weatherData', params, { login: true })
|
||||||
}
|
}
|
||||||
@@ -59,3 +63,33 @@ export function getAnalyzeKeywordsChangeV3(data) {
|
|||||||
export function getAnalyzeByImageV3(data) {
|
export function getAnalyzeByImageV3(data) {
|
||||||
return request.post('/v1/chat/image/recognition', data, { login: true })
|
return request.post('/v1/chat/image/recognition', data, { login: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取送礼选项配置
|
||||||
|
export function getGiftRecommendOptions(params) {
|
||||||
|
return request.get('/ai/gift-recommend/options', params, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取县域AI详情
|
||||||
|
export function getCountyAiDetail(params) {
|
||||||
|
return request.get('/county-ai/detail', params, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getSseCountyAiConfigV1(data) {
|
||||||
|
return request.post('/county-ai/chat', data, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCountyAiCompletionsV1(params) {
|
||||||
|
return request.get('/county-ai/chat/recognize', params, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCountyAiChatList(params) {
|
||||||
|
return request.get('/county-ai/chat/list', params, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCountyAiHistoryChatMessage(params) {
|
||||||
|
return request.get('/county-ai/chat/message', params, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getGiftRecommendPrompt(data) {
|
||||||
|
return request.post('/ai/gift-recommend/build-prompt', data, { login: true })
|
||||||
|
}
|
||||||
|
|||||||
+36
@@ -124,3 +124,39 @@ export function computedSojoumGroupBuyGiftOrderPrice(params) {
|
|||||||
login: true
|
login: true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文生图发起生成
|
||||||
|
* @param {*} data
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function aiGiftImageGenerate(data) {
|
||||||
|
return request.post("/aiGiftImage/generate", data, {
|
||||||
|
login: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文生图状态查询
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function aiGiftImageStatus(params) {
|
||||||
|
return request.get("/aiGiftImage/" + params.productId, {
|
||||||
|
login: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取商品以前使用过的AI礼品卡图片
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function aiGiftImageHistory(params) {
|
||||||
|
return request.get("/giftCard/aiGiftImages/history?productId=" + params.productId, {
|
||||||
|
login: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
+57
-14
@@ -11,16 +11,14 @@ export function getImages() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 商户申请页面数据
|
// 商户申请页面数据
|
||||||
export function getShopData(partnerId) {
|
export function getShopData(params) {
|
||||||
let param = {};
|
return request.get("/merchantApply/index", params, {login: true})
|
||||||
if (partnerId) param.partnerId = partnerId;
|
|
||||||
return request.get("/merchantApply/index", param, {login: true})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查看商户申请
|
// 查看商户申请
|
||||||
// 1-特产供应商 2-店铺 3-文玩供应商
|
// 1-特产供应商 2-店铺 3-文玩供应商
|
||||||
export function getShopInfo() {
|
export function getShopInfo(params) {
|
||||||
return request.get("/merchantApply/info", {}, {login: true})
|
return request.get("/merchantApply/info", params, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4-采购批发商
|
// 4-采购批发商
|
||||||
@@ -29,32 +27,77 @@ export function getWholesaler() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 提交店铺入驻申请
|
// 提交店铺入驻申请
|
||||||
export function saveShop(hotelInfo, captcha, partnerId) {
|
export function saveShop(hotelInfo, partnerId = '', promoterUid = '') {
|
||||||
let param = {hotelInfo, captcha: hotelInfo.captcha};
|
let param = {hotelInfo, captcha: hotelInfo.captcha};
|
||||||
if (partnerId && partnerId.length > 0) param.partnerId = partnerId;
|
if (partnerId && partnerId.length > 0) {
|
||||||
|
param.partnerId = partnerId;
|
||||||
|
}
|
||||||
|
if (promoterUid && promoterUid.length > 0) {
|
||||||
|
param.promoterUid = promoterUid;
|
||||||
|
}
|
||||||
return request.post("/merchantApply/hotel/submit", param, {login: true})
|
return request.post("/merchantApply/hotel/submit", param, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 保存店铺入驻草稿
|
||||||
|
export function saveHotelDraft(hotelInfo, partnerId = '', promoterUid = '') {
|
||||||
|
let param = {hotelInfo, captcha: hotelInfo.captcha};
|
||||||
|
if (partnerId && partnerId.length > 0) {
|
||||||
|
param.partnerId = partnerId;
|
||||||
|
}
|
||||||
|
if (promoterUid && promoterUid.length > 0) {
|
||||||
|
param.promoterUid = promoterUid;
|
||||||
|
}
|
||||||
|
return request.post("/merchantApply/hotel/saveDraft", param, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
// 提交特产供应商入驻申请
|
// 提交特产供应商入驻申请
|
||||||
export function saveSupplier(hotelInfo, supplierInfo, partnerId) {
|
export function saveSupplier(hotelInfo, supplierInfo, partnerId = '', promoterUid = '') {
|
||||||
let param = {hotelInfo, supplierInfo, captcha: supplierInfo.captcha};
|
let param = {hotelInfo, supplierInfo, captcha: supplierInfo.captcha};
|
||||||
if (partnerId && partnerId.length > 0) param.partnerId = partnerId;
|
if (partnerId && partnerId.length > 0) {
|
||||||
|
param.partnerId = partnerId;
|
||||||
|
}
|
||||||
|
if (promoterUid && promoterUid.length > 0) {
|
||||||
|
param.promoterUid = promoterUid;
|
||||||
|
}
|
||||||
return request.post("/merchantApply/goodSupplier/submit", param, {login: true})
|
return request.post("/merchantApply/goodSupplier/submit", param, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 提交文玩供应商入驻申请
|
// 提交文玩供应商入驻申请
|
||||||
export function saveWenwanSupplier(hotelInfo, supplierInfo, partnerId) {
|
export function saveWenwanSupplier(hotelInfo, supplierInfo, partnerId = '', promoterUid = '') {
|
||||||
let param = {hotelInfo, supplierInfo, captcha: supplierInfo.captcha};
|
let param = {hotelInfo, supplierInfo, captcha: supplierInfo.captcha};
|
||||||
if (partnerId && partnerId.length > 0) param.partnerId = partnerId;
|
if (partnerId && partnerId.length > 0) {
|
||||||
|
param.partnerId = partnerId;
|
||||||
|
}
|
||||||
|
if (promoterUid && promoterUid.length > 0) {
|
||||||
|
param.promoterUid = promoterUid;
|
||||||
|
}
|
||||||
return request.post("/merchantApply/wenwanSupplier/submit", param, {login: true})
|
return request.post("/merchantApply/wenwanSupplier/submit", param, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 保存供应商入驻草稿(特产/文玩共用)
|
||||||
|
export function saveSupplierDraft(hotelInfo, supplierInfo, partnerId = '', promoterUid = '') {
|
||||||
|
let param = {hotelInfo, supplierInfo, captcha: supplierInfo.captcha};
|
||||||
|
if (partnerId && partnerId.length > 0) {
|
||||||
|
param.partnerId = partnerId;
|
||||||
|
}
|
||||||
|
if (promoterUid && promoterUid.length > 0) {
|
||||||
|
param.promoterUid = promoterUid;
|
||||||
|
}
|
||||||
|
return request.post("/merchantApply/supplier/saveDraft", param, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
// 提交采购批发商入驻申请
|
// 提交采购批发商入驻申请
|
||||||
export function saveWholesaler(wholesalerInfo) {
|
export function saveWholesaler(wholesalerInfo) {
|
||||||
let param = {wholesalerInfo, captcha: wholesalerInfo.captcha};
|
let param = {wholesalerInfo, captcha: wholesalerInfo.captcha};
|
||||||
return request.post("/merchantApply/wholesaler/submit", param, {login: true})
|
return request.post("/merchantApply/wholesaler/submit", param, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 保存采购批发商入驻草稿
|
||||||
|
export function saveWholesalerDraft(wholesalerInfo) {
|
||||||
|
let param = {wholesalerInfo, captcha: wholesalerInfo.captcha};
|
||||||
|
return request.post("/merchantApply/wholesaler/saveDraft", param, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
export function saveExperienceStore(params) {
|
export function saveExperienceStore(params) {
|
||||||
return request.post("/merchantApply/experienceStore/submit", params, {login: true})
|
return request.post("/merchantApply/experienceStore/submit", params, {login: true})
|
||||||
}
|
}
|
||||||
@@ -82,8 +125,8 @@ export function getHotelInfo(params) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取千县名品店铺类型列表
|
// 获取千县名品店铺类型列表
|
||||||
export function getCountyFamousHotelType() {
|
export function getCountyFamousHotelType(params) {
|
||||||
return request.get("/countyFamous/hotelType", {}, {login: true})
|
return request.get("/countyFamous/hotelType", params, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+114
-4
@@ -3,15 +3,77 @@ import request from '@/utils/request'
|
|||||||
/**
|
/**
|
||||||
* 抽奖活动信息
|
* 抽奖活动信息
|
||||||
* */
|
* */
|
||||||
export function getDetail() {
|
export function getDetail(params = {}) {
|
||||||
return request.get('/lottery/dice/detail')
|
return request.get('/lottery/dice/detail', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 抽奖
|
* 抽奖
|
||||||
* */
|
* */
|
||||||
export function getPrize() {
|
export function getPrize(data = {}) {
|
||||||
return request.post('/lottery/dice/draw')
|
return request.post('/lottery/dice/draw', data)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 县域抽奖活动详情
|
||||||
|
* @param activityId 抽奖活动ID
|
||||||
|
*/
|
||||||
|
export function getDrawActivityInfo(activityId) {
|
||||||
|
return request.get('/draw/activityInfo', { activityId })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 县域抽奖活动规则
|
||||||
|
*/
|
||||||
|
export function getDrawRuleConfig() {
|
||||||
|
return request.get('/draw/ruleConfig')
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的抽奖码列表
|
||||||
|
* @param status 抽奖码状态(0:等待开奖, 1:已中奖, 2:未中奖, -1:已失效)
|
||||||
|
*/
|
||||||
|
export function getDrawMyTickets(status) {
|
||||||
|
const params = {}
|
||||||
|
if (status !== undefined && status !== null && status !== '') {
|
||||||
|
params.status = status
|
||||||
|
}
|
||||||
|
return request.get('/draw/myTickets', params)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 抽奖活动中奖记录
|
||||||
|
* @param activityId 抽奖活动ID
|
||||||
|
*/
|
||||||
|
export function getActivityWinRecord(activityId) {
|
||||||
|
return request.get('/draw/activityWinRecord', { activityId })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取最新中奖名单
|
||||||
|
* @param activityId 抽奖活动ID(可选)
|
||||||
|
*/
|
||||||
|
export function getDrawLatestWinners(activityId) {
|
||||||
|
const params = {}
|
||||||
|
if (activityId !== undefined && activityId !== null && activityId !== '') {
|
||||||
|
params.activityId = activityId
|
||||||
|
}
|
||||||
|
return request.get('/draw/latestWinners', params)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 历史抽奖活动列表
|
||||||
|
* 用于在中奖名单页面切换历史抽奖活动
|
||||||
|
*/
|
||||||
|
export function getDrawHistoryActivities() {
|
||||||
|
return request.get('/draw/historyActivities')
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取抽奖相关显示配置
|
||||||
|
*/
|
||||||
|
export function getDrawConfig() {
|
||||||
|
return request.get('/draw/config')
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,3 +98,51 @@ export function getLogs(page = 1, limit = 10) {
|
|||||||
export function getLotteryShareInfo() {
|
export function getLotteryShareInfo() {
|
||||||
return request.get('/lottery/shareImage')
|
return request.get('/lottery/shareImage')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单支付完成后检查抽奖码
|
||||||
|
* @param orderId 订单号
|
||||||
|
*/
|
||||||
|
export function getDrawTicketByOrder(orderId) {
|
||||||
|
return request.get('/draw/ticketCheck', { orderId })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验抽奖活动是否到开奖时间
|
||||||
|
* @param activityId 抽奖活动ID
|
||||||
|
*/
|
||||||
|
export function checkDrawTime(activityId) {
|
||||||
|
return request.get('/draw/checkTime', { activityId })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领取优惠券奖品
|
||||||
|
* @param ticketId 抽奖券ID
|
||||||
|
*/
|
||||||
|
export function claimCoupon(ticketId) {
|
||||||
|
return request.post('/draw/claimCoupon', { ticketId })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领取实物奖品
|
||||||
|
* @param ticketId 抽奖券ID
|
||||||
|
* @param addressId 用户收货地址ID
|
||||||
|
*/
|
||||||
|
export function claimPrize(ticketId, addressId) {
|
||||||
|
return request.post('/draw/claimPrize', { ticketId, addressId })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取实名认证信息
|
||||||
|
*/
|
||||||
|
export function getDrawRealname() {
|
||||||
|
return request.get('/draw/realname')
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交实名认证
|
||||||
|
* @param data { realName, idCard, phone }
|
||||||
|
*/
|
||||||
|
export function submitDrawRealname(data = {}) {
|
||||||
|
return request.post('/draw/realname', data)
|
||||||
|
}
|
||||||
|
|||||||
@@ -102,6 +102,17 @@ export function postOrderRefund(data) {
|
|||||||
return request.post("/order/refund/verify", data);
|
return request.post("/order/refund/verify", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消退款申请
|
||||||
|
* @param uni
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
export function cancelOrderRefund(uni) {
|
||||||
|
return request.post("/order/refund/cancel", {
|
||||||
|
uni
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确认收货
|
* 确认收货
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
|
|||||||
@@ -223,6 +223,16 @@ export function getAiSystemInfoTopic() {
|
|||||||
return request.get('/ai/systemTopic', {}, { login: false })
|
return request.get('/ai/systemTopic', {}, { login: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取异常提示配置
|
||||||
|
export function getExceptionConfig() {
|
||||||
|
return request.get('/ai/exceptionConfig', {}, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取已启用的底部导航配置列表
|
||||||
|
export function getBottomNavigationConfigList() {
|
||||||
|
return request.get('/ai/bottom-navigation/list', {}, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
// 获取通用分享配置
|
// 获取通用分享配置
|
||||||
export function getWeixinShareConfig() {
|
export function getWeixinShareConfig() {
|
||||||
return request.get('/weixinShareConfig', {}, { login: false })
|
return request.get('/weixinShareConfig', {}, { login: false })
|
||||||
|
|||||||
+7
-2
@@ -60,6 +60,11 @@ export function getCountyFamousCityGuideContent(param) {
|
|||||||
return request.get('/countyFamous/guide/content', param, { login: true })
|
return request.get('/countyFamous/guide/content', param, { login: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取千县名品县城图文攻略详情
|
||||||
|
export function getCountyFamousGraphicGuideContent(param) {
|
||||||
|
return request.get('/countyFamous/guide/graphic/content', param, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
// 获取千县名品县城重点产业列表
|
// 获取千县名品县城重点产业列表
|
||||||
export function getCountyFamousIndustry(param) {
|
export function getCountyFamousIndustry(param) {
|
||||||
return request.get('/countyFamous/industry', param, { login: true })
|
return request.get('/countyFamous/industry', param, { login: true })
|
||||||
@@ -313,8 +318,8 @@ export function getCityShopList(params) {
|
|||||||
return request.get('/countyFamous/hotel', params, {login: true})
|
return request.get('/countyFamous/hotel', params, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getCountyFamousHotelType() {
|
export function getCountyFamousHotelType(params) {
|
||||||
return request.get('/countyFamous/hotelType', {}, {login: true})
|
return request.get('/countyFamous/hotelType', params, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -603,3 +603,11 @@ export function queryUserGuide(params) {
|
|||||||
export function setUserGuide(params) {
|
export function setUserGuide(params) {
|
||||||
return request.post('/user/guide/status', params)
|
return request.post('/user/guide/status', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提现规则
|
||||||
|
*/
|
||||||
|
export function getWithdrawalRules() {
|
||||||
|
return request.get('/extract/rule')
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
+144
-8
@@ -9,16 +9,20 @@ page {
|
|||||||
}
|
}
|
||||||
.fix-tabbar-page {
|
.fix-tabbar-page {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
z-index: 0;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
|
background: transparent;
|
||||||
|
isolation: isolate;
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: -1;
|
||||||
|
pointer-events: none;
|
||||||
background: linear-gradient(155deg, rgba(61, 76, 241, 0.15) 0%, rgba(255,255,255,1) 25%, rgba(255,255,255,1) 75%, rgba(61, 76, 241, 0.15) 100%);
|
background: linear-gradient(155deg, rgba(61, 76, 241, 0.15) 0%, rgba(255,255,255,1) 25%, rgba(255,255,255,1) 75%, rgba(61, 76, 241, 0.15) 100%);
|
||||||
// background-color: #fff;
|
|
||||||
// background-size: 100% calc(100vh - 160rpx);
|
|
||||||
// background-image: url(https://wxapp.xdd618.com/api/file/pic/aiChat/bg.png);
|
|
||||||
// background-repeat: no-repeat;
|
|
||||||
// background-attachment: fixed;
|
|
||||||
&.new-chat {
|
|
||||||
background-size: 100% calc(100vh - 160rpx);
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
}
|
}
|
||||||
.fix-tabbar-header {
|
.fix-tabbar-header {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@@ -111,6 +115,12 @@ page {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
.container-county {
|
||||||
|
justify-content: flex-end;
|
||||||
|
.new-chat {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
.new-chat {
|
.new-chat {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -161,6 +171,9 @@ page {
|
|||||||
&:last-child {
|
&:last-child {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
|
&.hide {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
.tool-icon {
|
.tool-icon {
|
||||||
display: block;
|
display: block;
|
||||||
width: 32rpx;
|
width: 32rpx;
|
||||||
@@ -1365,3 +1378,126 @@ page {
|
|||||||
transform: rotate(720deg);
|
transform: rotate(720deg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.gift-steps-wrap {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 80rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.gift-step-title {
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 60rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gift-options {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.gift-option-item {
|
||||||
|
width: 48%;
|
||||||
|
height: 72rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background-color: #f2f4ff;
|
||||||
|
color: #333;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
position: relative;
|
||||||
|
transition: all 0.2s;
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
background-color: #3D4CF0;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-check {
|
||||||
|
margin-left: 8rpx;
|
||||||
|
width: 32rpx;
|
||||||
|
height: 32rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.gift-price-input {
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
|
||||||
|
.input-wrap {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
height: 88rpx;
|
||||||
|
background-color: #f2f4ff;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
|
||||||
|
.label {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-budget {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
padding-left: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.gift-step-actions {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.action-btn-group {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
height: 62rpx;
|
||||||
|
line-height: 62rpx;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
|
||||||
|
&-prev {
|
||||||
|
width: 48%;
|
||||||
|
background-color: #fff;
|
||||||
|
color: #3D4CF0;
|
||||||
|
border: 2rpx solid #3D4CF0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-next {
|
||||||
|
width: 48%;
|
||||||
|
background-color: #3D4CF0;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
&.full-width {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-skip {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #3D4CF0;
|
||||||
|
padding: 10rpx 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -127,6 +127,25 @@
|
|||||||
height: 52vh;
|
height: 52vh;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
margin: 30rpx 0;
|
margin: 30rpx 0;
|
||||||
|
|
||||||
|
// 小程序rich-text内块级标签无默认段间距,补充与后台富文本编辑器一致的段落格式
|
||||||
|
rich-text {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
p, div, ul, ol {
|
||||||
|
display: block;
|
||||||
|
margin: 0 0 16rpx;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
margin: 0 0 8rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.agree-box {
|
.agree-box {
|
||||||
|
|||||||
@@ -8231,3 +8231,192 @@ rich-text {
|
|||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.draw-ticket-mask {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 1000;
|
||||||
|
background: rgba(0, 0, 0, 0.45);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 24rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.draw-ticket-popup {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 640rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
padding: 50rpx 40rpx 60rpx;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.draw-ticket-close {
|
||||||
|
position: absolute;
|
||||||
|
top: 30rpx;
|
||||||
|
right: 30rpx;
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
border: 4rpx solid #333;
|
||||||
|
border-radius: 50%;
|
||||||
|
color: #333;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
z-index: 10;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
line-height: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.draw-ticket-icon {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-icon-box {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-icon-check {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.draw-ticket-title {
|
||||||
|
font-size: 56rpx;
|
||||||
|
color: #222;
|
||||||
|
font-weight: 800;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 24rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-card-container {
|
||||||
|
margin-top: 50rpx;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-badge {
|
||||||
|
background-color: #fff9eb;
|
||||||
|
border: 6rpx solid #111;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
padding: 12rpx 40rpx;
|
||||||
|
font-size: 46rpx;
|
||||||
|
font-weight: 800;
|
||||||
|
color: #222;
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
margin-bottom: -36rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-badge-arrow {
|
||||||
|
position: absolute;
|
||||||
|
bottom: -22rpx;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-left: 22rpx solid transparent;
|
||||||
|
border-right: 22rpx solid transparent;
|
||||||
|
border-top: 22rpx solid #111;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: -26rpx;
|
||||||
|
left: -16rpx;
|
||||||
|
border-left: 16rpx solid transparent;
|
||||||
|
border-right: 16rpx solid transparent;
|
||||||
|
border-top: 16rpx solid #fff9eb;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-card {
|
||||||
|
width: 100%;
|
||||||
|
background: #c23326;
|
||||||
|
border-radius: 36rpx;
|
||||||
|
padding: 70rpx 36rpx 40rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-card-subtitle {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-card-subtitle-text {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
border: 2rpx solid #fff;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
padding: 8rpx 50rpx;
|
||||||
|
letter-spacing: 4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-card-code-box {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
margin-top: 36rpx;
|
||||||
|
padding: 36rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-card-code {
|
||||||
|
color: #c23326;
|
||||||
|
font-size: 72rpx;
|
||||||
|
font-weight: 800;
|
||||||
|
letter-spacing: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-card-time {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 30rpx;
|
||||||
|
margin-top: 36rpx;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.draw-ticket-actions {
|
||||||
|
margin-top: 60rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
gap: 20rpx;
|
||||||
|
|
||||||
|
.action-btn {
|
||||||
|
flex: 1;
|
||||||
|
height: 86rpx;
|
||||||
|
border-radius: 44rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
|
&.home-btn {
|
||||||
|
color: #c23326;
|
||||||
|
border: 2rpx solid #c23326;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.primary {
|
||||||
|
color: #fff;
|
||||||
|
background: #c23326;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -42,9 +42,20 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
goSupplierMini() {
|
goSupplierMini() {
|
||||||
|
// 区分当前小程序环境:正式版跳正式版,体验版/开发版跳体验版
|
||||||
|
let envVersion = 'release'
|
||||||
|
try {
|
||||||
|
const accountInfo = uni.getAccountInfoSync()
|
||||||
|
if (accountInfo && accountInfo.miniProgram && accountInfo.miniProgram.envVersion !== 'release') {
|
||||||
|
envVersion = 'trial'
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
envVersion = 'release'
|
||||||
|
}
|
||||||
uni.navigateToMiniProgram({
|
uni.navigateToMiniProgram({
|
||||||
appId: "wx9ca93d1f2a9c8156",
|
appId: "wx9ca93d1f2a9c8156",
|
||||||
path: "pages/auth/login",
|
path: "pages/auth/login",
|
||||||
|
envVersion,
|
||||||
success(msg) {
|
success(msg) {
|
||||||
console.log("success", msg)
|
console.log("success", msg)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="components-checkbox-icon jc-center ai-center" :class="{'isSelected':isSelected}" @click="change"
|
|
||||||
v-if="ready">
|
|
||||||
<image class="icon-hook" :src="webUrl+'/20240109175325131970.png'" mode="scaleToFill" v-if="isSelected"/>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import {computed, getCurrentInstance, onMounted, ref} from '@vue/composition-api'
|
|
||||||
import {VUE_APP_RESOURCES_URL} from '../config/index'
|
|
||||||
|
|
||||||
const webUrl = VUE_APP_RESOURCES_URL
|
|
||||||
|
|
||||||
const emit = defineEmits(['change'])
|
|
||||||
const {proxy} = getCurrentInstance()
|
|
||||||
const props = defineProps({
|
|
||||||
defaultState: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
mark: Array
|
|
||||||
})
|
|
||||||
|
|
||||||
const ready = ref(false)
|
|
||||||
onMounted(() => {
|
|
||||||
ready.value = true
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
const isSelected = computed(() => {
|
|
||||||
return props.defaultState
|
|
||||||
})
|
|
||||||
const change = () => {
|
|
||||||
emit('change', !isSelected.value, props.mark)
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="less">
|
|
||||||
.components-checkbox-icon {
|
|
||||||
display: inline-flex;
|
|
||||||
width: 32rpx;
|
|
||||||
height: 32rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border: 2rpx solid #D5D7D8;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-hook {
|
|
||||||
width: 24rpx;
|
|
||||||
height: 24rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.isSelected {
|
|
||||||
border: 3px solid #FD5749;
|
|
||||||
background: #FD5749;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -82,7 +82,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
routerGo(cart) {
|
routerGo(cart) {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/shop/GoodsEvaluate/index",
|
path: "/pagesShop/shop/GoodsEvaluate/index",
|
||||||
query: { id: cart.unique }
|
query: { id: cart.unique }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view
|
<view
|
||||||
:class="{
|
:class="[{ on: attr.cartAttr === true }, className]"
|
||||||
'on': attr.cartAttr === true,
|
|
||||||
[className]: className
|
|
||||||
}"
|
|
||||||
:style="{ paddingBottom: paddingBottom }"
|
:style="{ paddingBottom: paddingBottom }"
|
||||||
class="product-window"
|
class="product-window"
|
||||||
>
|
>
|
||||||
@@ -38,8 +35,7 @@
|
|||||||
v-for="(subItem, subIndex) in item.attrValue"
|
v-for="(subItem, subIndex) in item.attrValue"
|
||||||
:key="subIndex"
|
:key="subIndex"
|
||||||
:class="{
|
:class="{
|
||||||
'actived': subItem.check,
|
'actived': subItem.check
|
||||||
'disabled': !subItem.canUsed
|
|
||||||
}"
|
}"
|
||||||
class="itemn v12-radius-40"
|
class="itemn v12-radius-40"
|
||||||
@click="tapAttr(index, subIndex, subItem)"
|
@click="tapAttr(index, subIndex, subItem)"
|
||||||
@@ -52,7 +48,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="cart v12-justify-between v12-align-center">
|
<view class="cart v12-justify-between v12-align-center">
|
||||||
<view class="titlev12-dark-text f12-font-32">购买数量</view>
|
<view class="titlev12-dark-text f12-font-32">购买数量</view>
|
||||||
<view class="carnum acea-row row-left">
|
<view v-if="!hideQuantityControls" class="carnum acea-row row-left">
|
||||||
<view style="border-radius: 40rpx 0rpx 0rpx 40rpx" class="cart-btn item reduce v12-font-36 v12-font-bold v12-white-text v12-dark1 v12-dark1-border" :class="cartNum <= 1 ? 'on' : ''" @click="CartNumDes">-</view>
|
<view style="border-radius: 40rpx 0rpx 0rpx 40rpx" class="cart-btn item reduce v12-font-36 v12-font-bold v12-white-text v12-dark1 v12-dark1-border" :class="cartNum <= 1 ? 'on' : ''" @click="CartNumDes">-</view>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
@@ -73,11 +69,12 @@
|
|||||||
@click="CartNumAdd"
|
@click="CartNumAdd"
|
||||||
>+</view>
|
>+</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-else class="v12-font-28 v12-dark-text">x1</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="v12-px-2 v12-mt-3" v-if="showOk">
|
<view class="v12-px-2 v12-mt-3" v-if="showOk">
|
||||||
<u-button
|
<u-button
|
||||||
shape="circle"
|
shape="circle"
|
||||||
color="#C52733"
|
:color="(attr.productSelect.stock === 0 && attr.cartAttr) ? '#9D9D9D' : '#C52733'"
|
||||||
@click="$emit('ok')"
|
@click="$emit('ok')"
|
||||||
:disabled="(attr.productSelect.stock === 0 && attr.cartAttr)"
|
:disabled="(attr.productSelect.stock === 0 && attr.cartAttr)"
|
||||||
>{{ okText }}</u-button>
|
>{{ okText }}</u-button>
|
||||||
@@ -85,7 +82,7 @@
|
|||||||
<view class="v12-px-2 v12-mt-3" v-if="isGift">
|
<view class="v12-px-2 v12-mt-3" v-if="isGift">
|
||||||
<u-button
|
<u-button
|
||||||
shape="circle"
|
shape="circle"
|
||||||
color="#C52733"
|
:color="(attr.productSelect.stock === 0 && attr.cartAttr) ? '#9D9D9D' : '#C52733'"
|
||||||
@click="$emit('gift')"
|
@click="$emit('gift')"
|
||||||
:disabled="(attr.productSelect.stock === 0 && attr.cartAttr)"
|
:disabled="(attr.productSelect.stock === 0 && attr.cartAttr)"
|
||||||
>送给朋友</u-button>
|
>送给朋友</u-button>
|
||||||
@@ -139,6 +136,10 @@ export default {
|
|||||||
className: {
|
className: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
|
},
|
||||||
|
hideQuantityControls: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -216,9 +217,9 @@ export default {
|
|||||||
},
|
},
|
||||||
tapAttr(index, subIndex, subItem) {
|
tapAttr(index, subIndex, subItem) {
|
||||||
// 缺货的点击了没效果
|
// 缺货的点击了没效果
|
||||||
if (!subItem.canUsed || subItem.check) {
|
// if (!subItem.canUsed || subItem.check) {
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
this.attrObj.productAttr[index].attrValue.map((subItem, subIdx) => {
|
this.attrObj.productAttr[index].attrValue.map((subItem, subIdx) => {
|
||||||
subItem.check= false
|
subItem.check= false
|
||||||
if (subIndex === subIdx) {
|
if (subIndex === subIdx) {
|
||||||
@@ -253,6 +254,15 @@ export default {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scope>
|
<style scope>
|
||||||
|
.btn-car-disabled {
|
||||||
|
border: 2rpx solid #9D9D9D !important;
|
||||||
|
color: #9D9D9D !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-buy-disabled {
|
||||||
|
background: #9D9D9D !important;
|
||||||
|
color: #FFFFFF !important;
|
||||||
|
}
|
||||||
.itemn{
|
.itemn{
|
||||||
margin: 28rpx 0 0 34rpx !important;
|
margin: 28rpx 0 0 34rpx !important;
|
||||||
width: auto;
|
width: auto;
|
||||||
|
|||||||
@@ -13,12 +13,19 @@
|
|||||||
import {
|
import {
|
||||||
getAiSystemInfoSetting
|
getAiSystemInfoSetting
|
||||||
} from '@/api/public'
|
} from '@/api/public'
|
||||||
|
import {
|
||||||
|
getCountyAiDetail
|
||||||
|
} from '@/api/chat/index'
|
||||||
export default {
|
export default {
|
||||||
name: 'AiEntrance',
|
name: 'AiEntrance',
|
||||||
props: {
|
props: {
|
||||||
cityName: {
|
cityName: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
|
},
|
||||||
|
countyId: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -33,6 +40,19 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
|
if (this.countyId) {
|
||||||
|
getCountyAiDetail({
|
||||||
|
countyId: this.countyId
|
||||||
|
}).then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
const aiImage = data.aiImage || ''
|
||||||
|
this.settingInfo.mainImage = aiImage
|
||||||
|
this.showImg = !!aiImage
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
getAiSystemInfoSetting().then(res => {
|
getAiSystemInfoSetting().then(res => {
|
||||||
const { success, data } = res
|
const { success, data } = res
|
||||||
if (success) {
|
if (success) {
|
||||||
@@ -43,7 +63,7 @@ export default {
|
|||||||
},
|
},
|
||||||
enterAiChat() {
|
enterAiChat() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/aiChat/views/index?click=1&cityName=' + (this.cityName || this.localCityName)
|
url: '/aiChat/views/index?click=1&cityName=' + (this.cityName || this.localCityName) + '&countyId=' + (this.countyId || '')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,343 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view>
|
|
||||||
<view class="upload">
|
|
||||||
<block v-for="(upload,index) in uploads" :key="index">
|
|
||||||
<view class="uplode-file">
|
|
||||||
<image v-if="types == 'image'" class="uploade-img" :style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'" :src="upload" :data-src="upload" @tap="previewImage"></image>
|
|
||||||
<image v-if="types == 'image'" class="clear-one-icon" :src="clearIcon" @tap="delImage(index)"></image>
|
|
||||||
<video v-if="types == 'video'" class="uploade-img" :style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'" :src="upload" controls>
|
|
||||||
<cover-image v-if="types == 'video'" class="clear-one-icon" :src="clearIcon" @tap="delImage(index)"></cover-image>
|
|
||||||
</video>
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
<view v-if="uploads.length < uploadCount" :class="uploadIcon ? 'uploader-icon' : 'uploader-input-box'" :style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'" >
|
|
||||||
<view v-if="!uploadIcon" class="uploader-input" @tap="chooseUploads"></view>
|
|
||||||
<image v-else class="image-cion" :src="uploadIcon" @tap="chooseUploads"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- <button type="primary" v-if="types == 'image' && !autoUpload" @tap="unifiedUpload">上传</button> -->
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default{
|
|
||||||
props: {
|
|
||||||
header:{
|
|
||||||
type:Object,
|
|
||||||
default:{}
|
|
||||||
},
|
|
||||||
types: {
|
|
||||||
type: String,
|
|
||||||
default: 'image'
|
|
||||||
},
|
|
||||||
dataList: {
|
|
||||||
type: Array,
|
|
||||||
default: function() {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
clearIcon: {
|
|
||||||
type: String,
|
|
||||||
default: 'http://img1.imgtn.bdimg.com/it/u=451604666,2295832001&fm=26&gp=0.jpg'
|
|
||||||
},
|
|
||||||
uploadIcon: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
uploadUrl: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
deleteUrl: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
uploadCount: {
|
|
||||||
type: Number,
|
|
||||||
default: 1
|
|
||||||
},
|
|
||||||
//上传图片大小 默认3M
|
|
||||||
upload_max: {
|
|
||||||
type: Number,
|
|
||||||
default: 3
|
|
||||||
},
|
|
||||||
//上传视频大小 默认30M
|
|
||||||
upload_video_max: {
|
|
||||||
type: Number,
|
|
||||||
default: 50
|
|
||||||
},
|
|
||||||
// 图片/选择宽高
|
|
||||||
upload_img_wh: {
|
|
||||||
type: Number,
|
|
||||||
default: 210
|
|
||||||
},
|
|
||||||
autoUpload: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data(){
|
|
||||||
return {
|
|
||||||
//上传的图片地址
|
|
||||||
uploadImages: [],
|
|
||||||
//展示的图片地址
|
|
||||||
uploads: [],
|
|
||||||
// 超出限制数组
|
|
||||||
exceeded_list: [],
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch:{
|
|
||||||
dataList:{
|
|
||||||
handler(val){
|
|
||||||
this.uploads = val;
|
|
||||||
},
|
|
||||||
immediate: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
previewImage (e) {
|
|
||||||
var current = e.target.dataset.src
|
|
||||||
uni.previewImage({
|
|
||||||
current: current,
|
|
||||||
urls: this.dataList
|
|
||||||
})
|
|
||||||
},
|
|
||||||
chooseUploads(){
|
|
||||||
switch (this.types){
|
|
||||||
case 'image':
|
|
||||||
uni.chooseImage({
|
|
||||||
count: this.uploadCount - this.uploads.length, //默认9
|
|
||||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
||||||
sourceType: ['album', 'camera'], //从相册选择
|
|
||||||
success: (res) => {
|
|
||||||
for(let i = 0; i< res.tempFiles.length; i++){
|
|
||||||
if(Math.ceil(res.tempFiles[i].size / 1024) < this.upload_max * 1024){
|
|
||||||
this.uploads.push(res.tempFiles[i].path)
|
|
||||||
console.log(this.uploads);
|
|
||||||
if(this.autoUpload){
|
|
||||||
this.uploadFile(res.tempFiles[i].path)
|
|
||||||
}else{
|
|
||||||
this.uploadImages.push(res.tempFiles[i].path);
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
this.exceeded_list.push(i === 0 ? 1 : i + 1);
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: `第${[...new Set(this.exceeded_list)].join(',')}张图片超出限制${this.upload_max}MB,已过滤`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
uni.showModal({
|
|
||||||
content: JSON.stringify(err)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 'video' :
|
|
||||||
uni.chooseVideo({
|
|
||||||
sourceType: ['camera', 'album'],
|
|
||||||
success: (res) => {
|
|
||||||
if(Math.ceil(res.size / 1024) < this.upload_video_max * 1024){
|
|
||||||
this.uploads.push(res.tempFilePath)
|
|
||||||
uni.uploadFile({
|
|
||||||
url: this.uploadUrl, //仅为示例,非真实的接口地址
|
|
||||||
filePath: res.tempFilePath,
|
|
||||||
name: 'file',
|
|
||||||
//请求参数
|
|
||||||
formData: {
|
|
||||||
'user': 'test'
|
|
||||||
},
|
|
||||||
success: (uploadFileRes) => {
|
|
||||||
this.$emit('successVideo',uploadFileRes)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}else {
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: `第${[...new Set(this.exceeded_list)].join(',')}张视频超出限制${this.upload_max}MB,已过滤`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
uni.showModal({
|
|
||||||
content: JSON.stringify(err)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
delImage(index){
|
|
||||||
|
|
||||||
this.uploads.splice(index,1)
|
|
||||||
//如果不自动上传
|
|
||||||
if(!this.autoUpload){
|
|
||||||
this.uploadImages.splice(index,1)
|
|
||||||
}
|
|
||||||
|
|
||||||
// //第一个是判断app或者h5的 第二个是判断小程序的
|
|
||||||
// if(this.uploads[index].substring(0,4) !== 'http' || this.uploads[index].substring(0,11) == 'http://tmp/'){
|
|
||||||
// this.uploads.splice(index,1)
|
|
||||||
// //如果不自动上传
|
|
||||||
// if(!this.autoUpload){
|
|
||||||
// this.uploadImages.splice(index,1)
|
|
||||||
// }
|
|
||||||
// return;
|
|
||||||
// };
|
|
||||||
|
|
||||||
// if(!this.deleteUrl) {
|
|
||||||
// uni.showModal({
|
|
||||||
// content: '请填写删除接口'
|
|
||||||
// });
|
|
||||||
// return;
|
|
||||||
// };
|
|
||||||
// uni.request({
|
|
||||||
// url: this.deleteUrl,
|
|
||||||
// method: 'DELETE',
|
|
||||||
// data: {
|
|
||||||
// image: this.dataList[index]
|
|
||||||
// },
|
|
||||||
// success: res => {
|
|
||||||
// if(res.data.status == 1) {
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '删除成功'
|
|
||||||
// })
|
|
||||||
// this.uploads.splice(index,1)
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
},
|
|
||||||
uploadFile(path){
|
|
||||||
// uni.uploadFile({
|
|
||||||
// url: this.uploadUrl, //仅为示例,非真实的接口地址
|
|
||||||
// filePath: path,
|
|
||||||
// name: 'file',
|
|
||||||
// //自定义请求参数
|
|
||||||
// formData: {
|
|
||||||
// 'user': 'test'
|
|
||||||
// },
|
|
||||||
// success: (uploadFileRes) => {
|
|
||||||
// this.$emit('successImage',uploadFileRes)
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
uni.uploadFile({
|
|
||||||
url: this.uploadUrl,
|
|
||||||
filePath: path,
|
|
||||||
header: this.header,
|
|
||||||
name: "file",
|
|
||||||
success: res => {
|
|
||||||
console.log(res);
|
|
||||||
|
|
||||||
this.$emit('successImage',uploadFileRes)
|
|
||||||
},
|
|
||||||
fail: err => {
|
|
||||||
|
|
||||||
console.log(err);
|
|
||||||
|
|
||||||
},
|
|
||||||
complete: res => {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
unifiedUpload(){
|
|
||||||
if(!this.uploadUrl) {
|
|
||||||
uni.showModal({
|
|
||||||
content: '请填写上传接口'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
};
|
|
||||||
for (let i of this.uploadImages) {
|
|
||||||
this.uploadFile(i)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.upload {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
.uplode-file {
|
|
||||||
margin: 10rpx;
|
|
||||||
/* width: 210upx;
|
|
||||||
height: 210upx; */
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.uploade-img {
|
|
||||||
display: block;
|
|
||||||
/* width: 210upx;
|
|
||||||
height: 210upx; */
|
|
||||||
}
|
|
||||||
.clear-one{
|
|
||||||
position: absolute;
|
|
||||||
top: -10rpx;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
.clear-one-icon{
|
|
||||||
position: absolute;
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
z-index: 9;
|
|
||||||
}
|
|
||||||
.uploader-input-box {
|
|
||||||
position: relative;
|
|
||||||
margin:10upx;
|
|
||||||
/* width: 208upx;
|
|
||||||
height: 208upx; */
|
|
||||||
border: 2upx solid #D9D9D9;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
.uploader-input-box:before,
|
|
||||||
.uploader-input-box:after {
|
|
||||||
content: " ";
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
-webkit-transform: translate(-50%, -50%);
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
background-color: #D9D9D9;
|
|
||||||
}
|
|
||||||
.uploader-input-box:before {
|
|
||||||
width: 4upx;
|
|
||||||
height: 79upx;
|
|
||||||
}
|
|
||||||
.uploader-input-box:after {
|
|
||||||
width: 79upx;
|
|
||||||
height: 4upx;
|
|
||||||
}
|
|
||||||
.uploader-input-box:active {
|
|
||||||
border-color: #999999;
|
|
||||||
}
|
|
||||||
.uploader-input-box:active:before,
|
|
||||||
.uploader-input-box:active:after {
|
|
||||||
background-color: #999999;
|
|
||||||
}
|
|
||||||
.uploader-input {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 1;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
.uploader-icon{
|
|
||||||
position: relative;
|
|
||||||
margin:10upx;
|
|
||||||
/* width: 208upx;
|
|
||||||
height: 208upx; */
|
|
||||||
}
|
|
||||||
.uploader-icon .image-cion{
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
### easy-upload 组件
|
|
||||||
|
|
||||||
使用方法
|
|
||||||
```js
|
|
||||||
<easy-upload
|
|
||||||
:dataList="dataList"
|
|
||||||
uploadUrl="http://localhost:3000/upload"
|
|
||||||
deleteUrl='http://localhost:3000/upload'
|
|
||||||
:types="types"
|
|
||||||
@successImage="successImage"
|
|
||||||
@successVideo="successvideo"
|
|
||||||
/>
|
|
||||||
|
|
||||||
//使用 hbuilderX (easycom) 可以直接使用 或
|
|
||||||
import easyUpload from '@/components/easy-upload/easy-upload.vue'
|
|
||||||
export default {
|
|
||||||
//用easycom 则省略注册组件
|
|
||||||
components:{
|
|
||||||
easyUpload
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
dataList: [],
|
|
||||||
types: 'image'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
| 参数 | 类型 | 是否必填 | 参数描述
|
|
||||||
| ---- | ---- | ---- | ----
|
|
||||||
| types | String | 否 | 上传类型 image/video
|
|
||||||
| autoUpload | Boolean | 否 | 自动上传 默认false
|
|
||||||
| dataList | Array | 否 | 图片/视频数据展示
|
|
||||||
| clearIcon | String | 否 | 删除图标(可以换成自己的图片)
|
|
||||||
| uploadIcon | String | 否 | 上传图标(可以换成自己的图片)
|
|
||||||
| uploadUrl | String | 否 | 上传的接口
|
|
||||||
| deleteUrl | String | 否 | 删除的接口
|
|
||||||
| uploadCount | Number | 否 | 上传图片最大个数(默认为一张)
|
|
||||||
| upload_max | Number | 否 | 上传大小(默认为3M)
|
|
||||||
| upload_max | Number | 否 | 上传大小(默认为3M)
|
|
||||||
| upload_max | Number | 否 | 上传大小(默认为3M)
|
|
||||||
|
|
||||||
| 事件 | 是否必填 | 参数描述
|
|
||||||
| ---- | ---- | ----
|
|
||||||
| successImage | 否 | 上传图片成功事件
|
|
||||||
| successVideo | 否 | 上传视频成功回调
|
|
||||||
|
|
||||||
示例项目中有简单的服务端代码 /server (node.js)
|
|
||||||
如果本地测试可以先运行一下服务端的代码
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,143 +0,0 @@
|
|||||||
/* eslint-disable */
|
|
||||||
var provinceData = [{
|
|
||||||
"label": "北京市",
|
|
||||||
"value": "11"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "天津市",
|
|
||||||
"value": "12"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "河北省",
|
|
||||||
"value": "13"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "山西省",
|
|
||||||
"value": "14"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "内蒙古自治区",
|
|
||||||
"value": "15"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "辽宁省",
|
|
||||||
"value": "21"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "吉林省",
|
|
||||||
"value": "22"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "黑龙江省",
|
|
||||||
"value": "23"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "上海市",
|
|
||||||
"value": "31"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "江苏省",
|
|
||||||
"value": "32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "浙江省",
|
|
||||||
"value": "33"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "安徽省",
|
|
||||||
"value": "34"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "福建省",
|
|
||||||
"value": "35"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "江西省",
|
|
||||||
"value": "36"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "山东省",
|
|
||||||
"value": "37"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "河南省",
|
|
||||||
"value": "41"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "湖北省",
|
|
||||||
"value": "42"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "湖南省",
|
|
||||||
"value": "43"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "广东省",
|
|
||||||
"value": "44"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "广西壮族自治区",
|
|
||||||
"value": "45"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "海南省",
|
|
||||||
"value": "46"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "重庆市",
|
|
||||||
"value": "50"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "四川省",
|
|
||||||
"value": "51"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "贵州省",
|
|
||||||
"value": "52"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "云南省",
|
|
||||||
"value": "53"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "西藏自治区",
|
|
||||||
"value": "54"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "陕西省",
|
|
||||||
"value": "61"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "甘肃省",
|
|
||||||
"value": "62"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "青海省",
|
|
||||||
"value": "63"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "宁夏回族自治区",
|
|
||||||
"value": "64"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "新疆维吾尔自治区",
|
|
||||||
"value": "65"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "台湾",
|
|
||||||
"value": "66"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "香港",
|
|
||||||
"value": "67"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "澳门",
|
|
||||||
"value": "68"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "钓鱼岛",
|
|
||||||
"value": "69"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
export default provinceData;
|
|
||||||
@@ -1,381 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="simple-address" v-if="showPopup" @touchmove.stop.prevent="clear">
|
|
||||||
<!-- 遮罩层 -->
|
|
||||||
<view
|
|
||||||
class="simple-address-mask"
|
|
||||||
@touchmove.stop.prevent="clear"
|
|
||||||
v-if="maskClick"
|
|
||||||
:class="[ani + '-mask', animation ? 'mask-ani' : '']"
|
|
||||||
:style="{
|
|
||||||
'background-color': maskBgColor
|
|
||||||
}"
|
|
||||||
@tap="hideMask(true)"
|
|
||||||
></view>
|
|
||||||
|
|
||||||
<view class="simple-address-content simple-address--fixed" :class="[type, ani + '-content', animation ? 'content-ani' : '']">
|
|
||||||
<view class="simple-address__header">
|
|
||||||
<view class="simple-address__header-btn-box" @click="pickerCancel"><text class="simple-address__header-text">取消</text></view>
|
|
||||||
<view class="simple-address__header-btn-box" @click="pickerConfirm"><text class="simple-address__header-text" :style="{ color: themeColor }">确定</text></view>
|
|
||||||
</view>
|
|
||||||
<view class="simple-address__box">
|
|
||||||
<picker-view indicator-style="height: 70rpx;" class="simple-address-view" :value="pickerValue" @change="pickerChange">
|
|
||||||
<picker-view-column>
|
|
||||||
<!-- #ifndef APP-NVUE -->
|
|
||||||
<view class="picker-item" v-for="(item, index) in provinceDataList" :key="index">{{ item.label }}</view>
|
|
||||||
<!-- #endif -->
|
|
||||||
<!-- #ifdef APP-NVUE -->
|
|
||||||
<text class="picker-item" v-for="(item, index) in provinceDataList" :key="index">{{ item.label }}</text>
|
|
||||||
<!-- #endif -->
|
|
||||||
</picker-view-column>
|
|
||||||
<picker-view-column>
|
|
||||||
<!-- #ifndef APP-NVUE -->
|
|
||||||
<view class="picker-item" v-for="(item, index) in cityDataList" :key="index">{{ item.label }}</view>
|
|
||||||
<!-- #endif -->
|
|
||||||
<!-- #ifdef APP-NVUE -->
|
|
||||||
<text class="picker-item" v-for="(item, index) in cityDataList" :key="index">{{ item.label }}</text>
|
|
||||||
<!-- #endif -->
|
|
||||||
</picker-view-column>
|
|
||||||
<picker-view-column>
|
|
||||||
<!-- #ifndef APP-NVUE -->
|
|
||||||
<view class="picker-item" v-for="(item, index) in areaDataList" :key="index">{{ item.label }}</view>
|
|
||||||
<!-- #endif -->
|
|
||||||
<!-- #ifdef APP-NVUE -->
|
|
||||||
<text class="picker-item" v-for="(item, index) in areaDataList" :key="index">{{ item.label }}</text>
|
|
||||||
<!-- #endif -->
|
|
||||||
</picker-view-column>
|
|
||||||
</picker-view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import provinceData from './city-data/province.js';
|
|
||||||
import cityData from './city-data/city.js';
|
|
||||||
import areaData from './city-data/area.js';
|
|
||||||
export default {
|
|
||||||
name: 'simpleAddress',
|
|
||||||
props: {
|
|
||||||
mode: {
|
|
||||||
// 地址类型
|
|
||||||
// default 则代表老版本根据index索引获取数据
|
|
||||||
//
|
|
||||||
type: String,
|
|
||||||
default: 'default'
|
|
||||||
},
|
|
||||||
// 开启动画
|
|
||||||
animation: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
/* 弹出层类型,可选值;
|
|
||||||
bottom:底部弹出层
|
|
||||||
*/
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
default: 'bottom'
|
|
||||||
},
|
|
||||||
// maskClick
|
|
||||||
maskClick: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
show: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
maskBgColor: {
|
|
||||||
type: String,
|
|
||||||
default: 'rgba(0, 0, 0, 0.4)' //背景颜色 rgba(0, 0, 0, 0.4) 为空则调用 uni.scss
|
|
||||||
},
|
|
||||||
themeColor: {
|
|
||||||
type: String,
|
|
||||||
default: '' // 主题色
|
|
||||||
},
|
|
||||||
/* 默认值 */
|
|
||||||
pickerValueDefault: {
|
|
||||||
type: Array,
|
|
||||||
default() {
|
|
||||||
return [0, 0, 0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
ani: '',
|
|
||||||
showPopup: false,
|
|
||||||
pickerValue: [0, 0, 0],
|
|
||||||
provinceDataList: [],
|
|
||||||
cityDataList: [],
|
|
||||||
areaDataList: []
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
show(newValue) {
|
|
||||||
if (newValue) {
|
|
||||||
this.open();
|
|
||||||
} else {
|
|
||||||
this.close();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
pickerValueDefault() {
|
|
||||||
this.init();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.init();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init() {
|
|
||||||
this.handPickValueDefault(); // 对 pickerValueDefault 做兼容处理
|
|
||||||
this.provinceDataList = provinceData;
|
|
||||||
this.cityDataList = cityData[this.pickerValueDefault[0]];
|
|
||||||
this.areaDataList = areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]];
|
|
||||||
this.pickerValue = this.pickerValueDefault;
|
|
||||||
},
|
|
||||||
handPickValueDefault() {
|
|
||||||
if (this.pickerValueDefault !== [0, 0, 0]) {
|
|
||||||
if (this.pickerValueDefault[0] > provinceData.length - 1) {
|
|
||||||
this.pickerValueDefault[0] = provinceData.length - 1;
|
|
||||||
}
|
|
||||||
if (this.pickerValueDefault[1] > cityData[this.pickerValueDefault[0]].length - 1) {
|
|
||||||
this.pickerValueDefault[1] = cityData[this.pickerValueDefault[0]].length - 1;
|
|
||||||
}
|
|
||||||
if (this.pickerValueDefault[2] > areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]].length - 1) {
|
|
||||||
this.pickerValueDefault[2] = areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]].length - 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
pickerChange(e) {
|
|
||||||
let changePickerValue = e.detail.value;
|
|
||||||
if (this.pickerValue[0] !== changePickerValue[0]) {
|
|
||||||
// 第一级发生滚动
|
|
||||||
this.cityDataList = cityData[changePickerValue[0]];
|
|
||||||
this.areaDataList = areaData[changePickerValue[0]][0];
|
|
||||||
changePickerValue[1] = 0;
|
|
||||||
changePickerValue[2] = 0;
|
|
||||||
} else if (this.pickerValue[1] !== changePickerValue[1]) {
|
|
||||||
// 第二级滚动
|
|
||||||
this.areaDataList = areaData[changePickerValue[0]][changePickerValue[1]];
|
|
||||||
changePickerValue[2] = 0;
|
|
||||||
}
|
|
||||||
this.pickerValue = changePickerValue;
|
|
||||||
this._$emit('onChange');
|
|
||||||
},
|
|
||||||
_$emit(emitName) {
|
|
||||||
let pickObj = {
|
|
||||||
label: this._getLabel(),
|
|
||||||
value: this.pickerValue,
|
|
||||||
cityCode: this._getCityCode(),
|
|
||||||
areaCode: this._getAreaCode(),
|
|
||||||
provinceCode: this._getProvinceCode(),
|
|
||||||
labelArr:this._getLabel().split('-')
|
|
||||||
};
|
|
||||||
console.log(this._getLabel().split('-'));
|
|
||||||
this.$emit(emitName, pickObj);
|
|
||||||
},
|
|
||||||
_getLabel() {
|
|
||||||
let pcikerLabel =
|
|
||||||
this.provinceDataList[this.pickerValue[0]].label + '-' + this.cityDataList[this.pickerValue[1]].label + '-' + this.areaDataList[this.pickerValue[2]].label;
|
|
||||||
return pcikerLabel;
|
|
||||||
},
|
|
||||||
_getCityCode() {
|
|
||||||
return this.cityDataList[this.pickerValue[1]].value;
|
|
||||||
},
|
|
||||||
_getProvinceCode() {
|
|
||||||
return this.provinceDataList[this.pickerValue[0]].value;
|
|
||||||
},
|
|
||||||
_getAreaCode() {
|
|
||||||
return this.areaDataList[this.pickerValue[2]].value;
|
|
||||||
},
|
|
||||||
queryIndex(params = [], type = 'value') {
|
|
||||||
// params = [ 11 ,1101,110101 ];
|
|
||||||
// 1.获取省份的index
|
|
||||||
let provinceIndex = provinceData.findIndex(res => res[type] == params[0]);
|
|
||||||
let cityIndex = cityData[provinceIndex].findIndex(res => res[type] == params[1]);
|
|
||||||
let areaIndex = areaData[provinceIndex][cityIndex].findIndex(res => res[type] == params[2]);
|
|
||||||
return {
|
|
||||||
index: [provinceIndex, cityIndex, areaIndex],
|
|
||||||
data: {
|
|
||||||
province: provinceData[provinceIndex],
|
|
||||||
city: cityData[provinceIndex][cityIndex],
|
|
||||||
area: areaData[cityIndex][0][areaIndex]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
clear() {},
|
|
||||||
hideMask() {
|
|
||||||
this._$emit('onCancel');
|
|
||||||
this.close();
|
|
||||||
},
|
|
||||||
pickerCancel() {
|
|
||||||
this._$emit('onCancel');
|
|
||||||
this.close();
|
|
||||||
},
|
|
||||||
pickerConfirm() {
|
|
||||||
this._$emit('onConfirm');
|
|
||||||
this.close();
|
|
||||||
},
|
|
||||||
open() {
|
|
||||||
this.showPopup = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.ani = 'simple-' + this.type;
|
|
||||||
}, 100);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
close(type) {
|
|
||||||
if (!this.maskClick && type) return;
|
|
||||||
this.ani = '';
|
|
||||||
this.$nextTick(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.showPopup = false;
|
|
||||||
}, 300);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.simple-address {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-address-mask {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
|
|
||||||
transition-property: opacity;
|
|
||||||
transition-duration: 0.3s;
|
|
||||||
opacity: 0;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
z-index: 99;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.mask-ani {
|
|
||||||
transition-property: opacity;
|
|
||||||
transition-duration: 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-bottom-mask {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-center-mask {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-address--fixed {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
transition-property: transform;
|
|
||||||
transition-duration: 0.3s;
|
|
||||||
transform: translateY(460rpx);
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
z-index: 99;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-address-content {
|
|
||||||
background-color: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-content-bottom {
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
transform: translateY(500rpx);
|
|
||||||
}
|
|
||||||
|
|
||||||
.content-ani {
|
|
||||||
transition-property: transform, opacity;
|
|
||||||
transition-duration: 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-bottom-content {
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-center-content {
|
|
||||||
transform: scale(1);
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-address__header {
|
|
||||||
position: relative;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
justify-content: space-between;
|
|
||||||
border-bottom-color: #f2f2f2;
|
|
||||||
border-bottom-style: solid;
|
|
||||||
border-bottom-width: 1rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-address--fixed-top {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-between;
|
|
||||||
border-top-color: $uni-border-color;
|
|
||||||
border-top-style: solid;
|
|
||||||
border-top-width: 1rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-address__header-btn-box {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
height: 70rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-address__header-text {
|
|
||||||
text-align: center;
|
|
||||||
font-size: $uni-font-size-base;
|
|
||||||
color: #1aad19;
|
|
||||||
line-height: 70rpx;
|
|
||||||
padding-left: 40rpx;
|
|
||||||
padding-right: 40rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-address__box {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-address-view {
|
|
||||||
position: relative;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
width: 100%;
|
|
||||||
/* #endif */
|
|
||||||
/* #ifdef APP-NVUE */
|
|
||||||
width: 750rpx;
|
|
||||||
/* #endif */
|
|
||||||
height: 408rpx;
|
|
||||||
background-color: rgba(255, 255, 255, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.picker-item {
|
|
||||||
text-align: center;
|
|
||||||
line-height: 70rpx;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view :class="[styleType === 'text'?'segmented-control--text' : 'segmented-control--button' ]" :style="{ borderColor: styleType === 'text' ? '' : activeColor }"
|
|
||||||
class="segmented-control">
|
|
||||||
<view v-for="(item, index) in values" :class="[ styleType === 'text'?'segmented-control__item--text': 'segmented-control__item--button' , index === currentIndex&&styleType === 'button'?'segmented-control__item--button--active': '' , index === 0&&styleType === 'button'?'segmented-control__item--button--first': '',index === values.length - 1&&styleType === 'button'?'segmented-control__item--button--last': '' ]"
|
|
||||||
:key="index" :style="{
|
|
||||||
backgroundColor: index === currentIndex && styleType === 'button' ? activeColor : '',borderColor: index === currentIndex&&styleType === 'text'||styleType === 'button'?activeColor:'transparent'
|
|
||||||
}"
|
|
||||||
class="segmented-control__item" @click="_onClick(index)">
|
|
||||||
<text :style="{color:
|
|
||||||
index === currentIndex
|
|
||||||
? styleType === 'text'
|
|
||||||
? activeColor
|
|
||||||
: '#fff'
|
|
||||||
: styleType === 'text'
|
|
||||||
? '#000'
|
|
||||||
: activeColor}"
|
|
||||||
class="segmented-control__text">{{ item }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
/**
|
|
||||||
* SegmentedControl 分段器
|
|
||||||
* @description 用作不同视图的显示
|
|
||||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=54
|
|
||||||
* @property {Number} current 当前选中的tab索引值,从0计数
|
|
||||||
* @property {String} styleType = [button|text] 分段器样式类型
|
|
||||||
* @value button 按钮类型
|
|
||||||
* @value text 文字类型
|
|
||||||
* @property {String} activeColor 选中的标签背景色与边框颜色
|
|
||||||
* @property {Array} values 选项数组
|
|
||||||
* @event {Function} clickItem 组件触发点击事件时触发,e={currentIndex}
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
name: 'UniSegmentedControl',
|
|
||||||
props: {
|
|
||||||
current: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
values: {
|
|
||||||
type: Array,
|
|
||||||
default () {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
activeColor: {
|
|
||||||
type: String,
|
|
||||||
default: '#007aff'
|
|
||||||
},
|
|
||||||
styleType: {
|
|
||||||
type: String,
|
|
||||||
default: 'button'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
currentIndex: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
current(val) {
|
|
||||||
if (val !== this.currentIndex) {
|
|
||||||
this.currentIndex = val
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.currentIndex = this.current
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
_onClick(index) {
|
|
||||||
if (this.currentIndex !== index) {
|
|
||||||
this.currentIndex = index
|
|
||||||
this.$emit('clickItem', {
|
|
||||||
currentIndex: index
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.segmented-control {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
box-sizing: border-box;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
height: 50rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
/* #ifdef H5 */
|
|
||||||
cursor: pointer;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
.segmented-control__item {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: inline-flex;
|
|
||||||
box-sizing: border-box;
|
|
||||||
/* #endif */
|
|
||||||
position: relative;
|
|
||||||
flex: 1;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
padding: 10rpx;
|
|
||||||
}
|
|
||||||
.segmented-control__item--button {
|
|
||||||
border-style: solid;
|
|
||||||
border-top-width: 1px;
|
|
||||||
border-bottom-width: 1px;
|
|
||||||
border-right-width: 1px;
|
|
||||||
border-left-width: 0;
|
|
||||||
}
|
|
||||||
.segmented-control__item--button--first {
|
|
||||||
border-left-width: 1px;
|
|
||||||
border-top-left-radius: 5px;
|
|
||||||
border-bottom-left-radius: 5px;
|
|
||||||
}
|
|
||||||
.segmented-control__item--button--last {
|
|
||||||
border-top-right-radius: 5px;
|
|
||||||
border-bottom-right-radius: 5px;
|
|
||||||
}
|
|
||||||
.segmented-control__item--text {
|
|
||||||
border-bottom-style: solid;
|
|
||||||
border-bottom-width: 3px;
|
|
||||||
}
|
|
||||||
.segmented-control__text {
|
|
||||||
font-size: 28rpx;
|
|
||||||
line-height: 28rpx;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -12,7 +12,14 @@ const settings = {
|
|||||||
/* 系统接口前缀,没有统一的填空字符串 */
|
/* 系统接口前缀,没有统一的填空字符串 */
|
||||||
sysPrefix: '/',
|
sysPrefix: '/',
|
||||||
/* 是否收集错误日志 */
|
/* 是否收集错误日志 */
|
||||||
collectRequestError: false
|
collectRequestError: false,
|
||||||
|
/* 订阅消息模板ID */
|
||||||
|
SubscribeMessageTmplIds: [
|
||||||
|
'7O3wKw7_D4t7yfSOlvecKuOQP8QEPY88uBx2FJg43HE',
|
||||||
|
'TSmTnGibZ8IxWCiRWOvLxha6-0u7tE-V1-WbDCiPkKU',
|
||||||
|
'9Q6xLHe6HyjkU5Zn5k_2zxYPf2y4MxVyUbOSW8pcZRU',
|
||||||
|
'v0GegDmzjpqiinmdj7dOwRK1MaTAPVyCOpqn8hJ3Y3Q'
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
export default settings
|
export default settings
|
||||||
|
|||||||
@@ -10,6 +10,14 @@ if (NODE_ENV === 'development' || NODE_ENV === 'test') {
|
|||||||
enableDebug: false
|
enableDebug: false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (NODE_ENV === 'fix') {
|
||||||
|
BASE_URL = 'https://shop-pre.xdd618.com/api'
|
||||||
|
SERVICE_URL = 'https://service-pre.xdd618.com/api'
|
||||||
|
SERVICE_WS_URL = 'wss://service-pre.xdd618.com/ws'
|
||||||
|
wx.setEnableDebug({
|
||||||
|
enableDebug: false
|
||||||
|
})
|
||||||
|
}
|
||||||
if (NODE_ENV === 'prod') {
|
if (NODE_ENV === 'prod') {
|
||||||
BASE_URL = 'https://wxapp.xdd618.com/api'
|
BASE_URL = 'https://wxapp.xdd618.com/api'
|
||||||
SERVICE_URL = 'https://service.xdd618.com/api'
|
SERVICE_URL = 'https://service.xdd618.com/api'
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
import { subscribeMessage } from '@/libs/order'
|
// import { subscribeMessage } from '@/libs/order'
|
||||||
import { getProvider } from '@/utils'
|
import { getProvider } from '@/utils'
|
||||||
import WechatJSSDK from 'wechat-jssdk/dist/client.umd'
|
import WechatJSSDK from 'wechat-jssdk/dist/client.umd'
|
||||||
import { getWechatConfig, wechatAuth } from '@/api/public'
|
import { getWechatConfig, wechatAuth } from '@/api/public'
|
||||||
@@ -65,7 +65,7 @@ export const weappPay = option => {
|
|||||||
resolve(success)
|
resolve(success)
|
||||||
}, 3000)
|
}, 3000)
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
subscribeMessage()
|
// subscribeMessage()
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
fail: error => {
|
fail: error => {
|
||||||
|
|||||||
@@ -0,0 +1,72 @@
|
|||||||
|
import { getDrawTicketByOrder } from '@/api/lottery'
|
||||||
|
export const orderPaySuccessToCheckDrawStatus = {
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
drawTicketPopup: {
|
||||||
|
show: false,
|
||||||
|
ticketCode: '',
|
||||||
|
drawTime: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
setDrawTicketPopupFromQuery(ticketData = '') {
|
||||||
|
const drawTicketData = ticketData || this.$yroute.query.drawTicketData
|
||||||
|
if (!drawTicketData) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let result = {}
|
||||||
|
try {
|
||||||
|
result = typeof drawTicketData === 'string' ? JSON.parse(decodeURIComponent(drawTicketData)) : drawTicketData
|
||||||
|
console.log(result)
|
||||||
|
} catch (e) {
|
||||||
|
result = {}
|
||||||
|
}
|
||||||
|
const hasTicket = Number(result.hasTicket || 0) === 1
|
||||||
|
const howPopup = Number(result.showPopup || 0) === 1
|
||||||
|
if (!hasTicket || !howPopup) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.drawTicketPopup = {
|
||||||
|
show: true,
|
||||||
|
ticketCode: result.ticketCode || result.code || '',
|
||||||
|
drawTime: result.drawTime || ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
closeDrawTicketPopup() {
|
||||||
|
this.drawTicketPopup.show = false
|
||||||
|
},
|
||||||
|
goHomeFromPopup() {
|
||||||
|
this.drawTicketPopup.show = false
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/home/index'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goTicketsFromPopup() {
|
||||||
|
this.drawTicketPopup.show = false
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pkg-video/views/county-my-tickets'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
buildOrderDetailQuery(orderId, drawTicketResult = {}) {
|
||||||
|
return {
|
||||||
|
id: orderId,
|
||||||
|
drawTicketData: encodeURIComponent(JSON.stringify(drawTicketResult || {}))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async afterPaySuccess(orderId, fallback) {
|
||||||
|
if (!orderId) {
|
||||||
|
fallback && fallback()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const res = await getDrawTicketByOrder(orderId)
|
||||||
|
const result = (res && res.data) || {}
|
||||||
|
fallback && fallback(result)
|
||||||
|
return
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
fallback && fallback({})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -133,6 +133,17 @@
|
|||||||
"CUSTOM-CONST": true
|
"CUSTOM-CONST": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"mp-weixin-fix": {
|
||||||
|
"title": "微信小程序(Fix环境)",
|
||||||
|
"env": {
|
||||||
|
"UNI_PLATFORM": "mp-weixin",
|
||||||
|
"VUE_APP_ENV": "fix",
|
||||||
|
"UNI_OUTPUT_DIR": "dist"
|
||||||
|
},
|
||||||
|
"define": {
|
||||||
|
"CUSTOM-CONST": true
|
||||||
|
}
|
||||||
|
},
|
||||||
"mp-weixin": {
|
"mp-weixin": {
|
||||||
"title": "微信小程序(生产环境)",
|
"title": "微信小程序(生产环境)",
|
||||||
"env": {
|
"env": {
|
||||||
|
|||||||
+253
-153
@@ -76,12 +76,6 @@
|
|||||||
"navigationBarTextStyle": "white"
|
"navigationBarTextStyle": "white"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/shop/StoreList/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商家列表"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/shop/GoodsList/index",
|
"path": "pages/shop/GoodsList/index",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -110,24 +104,6 @@
|
|||||||
"navigationBarTextStyle": "white"
|
"navigationBarTextStyle": "white"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/shop/GoodsCollection/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商品收藏"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/shop/EvaluateList/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "评价列表"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/shop/GoodsEvaluate/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商品评价"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/shop/GoodsCon/index",
|
"path": "pages/shop/GoodsCon/index",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -149,88 +125,18 @@
|
|||||||
"navigationBarTitleText": "新增收货地址"
|
"navigationBarTitleText": "新增收货地址"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/user/UserAccount/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "账户余额"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/user/address/AddressManagement/index",
|
"path": "pages/user/address/AddressManagement/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "收货地址"
|
"navigationBarTitleText": "收货地址"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/CashAudit/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "提现结果"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/PromoterOrder/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "分销详情"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/PromoterList/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "分销列表",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/UserPromotion/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "团队管理",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/History/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商品足迹",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/UserBill/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "账单记录"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/CommissionDetails/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "佣金明细"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/user/signIn/Integral/index",
|
"path": "pages/user/signIn/Integral/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "我的积分"
|
"navigationBarTitleText": "我的积分"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/UserCash/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "提现"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/CustomerList/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "客服列表"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/Recharge/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "充值"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/order/MyOrder/index",
|
"path": "pages/order/MyOrder/index",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -239,18 +145,6 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/order/Logistics/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "查看物流"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/order/OrderDetails/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "订单详情"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/order/OrderSubmission/index",
|
"path": "pages/order/OrderSubmission/index",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -258,48 +152,16 @@
|
|||||||
"navigationBarBackgroundColor": "#fff"
|
"navigationBarBackgroundColor": "#fff"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/order/PaymentStatus/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "支付状态"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/order/GoodsReturn/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "申请退款"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/order/ReturnList/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "退货列表"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/map/index",
|
"path": "pages/map/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "地图"
|
"navigationBarTitleText": "地图"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/user/Message/Message",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "消息",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/MessageDetail/MessageDetail",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "消息详情",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/VideoPlayBackList/VideoPlayBackList",
|
"path": "pages/VideoPlayBackList/VideoPlayBackList",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "寻看点",
|
"navigationBarTitleText": "使用指南",
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -309,18 +171,6 @@
|
|||||||
"navigationBarTitleText": "视频详情",
|
"navigationBarTitleText": "视频详情",
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/UserFavorite/UserFavorite",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "我的喜欢"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/Points/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "积分"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"subPackages": [
|
"subPackages": [
|
||||||
@@ -401,11 +251,47 @@
|
|||||||
"navigationBarTitleText": "抽奖"
|
"navigationBarTitleText": "抽奖"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "views/county-lottery",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "抽奖"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "views/lottery-log",
|
"path": "views/lottery-log",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "抽奖记录"
|
"navigationBarTitleText": "抽奖记录"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/county-lottery-rules",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "活动规则"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/county-my-tickets",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "我的抽奖码"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/county-winners",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "中奖名单"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/county-claim-address",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "填写收货地址"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/county-realname",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "实名认证"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -469,7 +355,7 @@
|
|||||||
{
|
{
|
||||||
"path": "views/wholesaler",
|
"path": "views/wholesaler",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "采购批发商入驻"
|
"navigationBarTitleText": "礼品集采中心入驻"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -604,7 +490,7 @@
|
|||||||
{
|
{
|
||||||
"path": "views/giftList",
|
"path": "views/giftList",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "特色礼品"
|
"navigationBarTitleText": "全国礼品"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -646,6 +532,13 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "views/famousQianxianGraphicGuide",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "攻略详情",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "views/famousQianxianVillageShop",
|
"path": "views/famousQianxianVillageShop",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -1008,6 +901,213 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"root": "pagesOrder",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"path": "order/GoodsReturn/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "申请退款"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "order/Logistics/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "查看物流"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "order/OrderDetails/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "订单详情"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "order/ReturnList/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "退货列表"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"root": "pagesShop",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"path": "shop/EvaluateList/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "评价列表"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "shop/GoodsCollection/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "商品收藏"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "shop/GoodsEvaluate/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "商品评价"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "shop/GoodsPromotion/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "商品促销"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "shop/StoreList/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "商家列表"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"root": "pagesUser",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"path": "user/CustomerList/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "客服列表"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/History/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "商品足迹",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/MemberUpgradeIntro/MemberUpgradeIntro",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "升级介绍"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/Message/Message",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "消息",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/MessageDetail/MessageDetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "消息详情",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/ModifyPayPassword/ModifyPayPassword",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "评价列表"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/Points/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "积分"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/Recharge/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "充值"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/RetrievePassword/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "找回密码"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/UpgradeElectronicProtocol/UpgradeElectronicProtocol",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "升级电子协议"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/UpgradeProtocolDetail/UpgradeProtocolDetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "升级电子协议详情"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/UserAccount/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "账户余额"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/UserBill/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "账单记录"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/UserFavorite/UserFavorite",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "我的喜欢"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/UserVip/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "用户等级"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/promotion/CashAudit/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "提现审核"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/promotion/CommissionDetails/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "提现审核"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/promotion/Poster/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "海报生成"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/promotion/PromoterList/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "分销列表",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/promotion/PromoterOrder/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "分销详情"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/promotion/UserCash/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "提现"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/promotion/UserPromotion/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "团队管理",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"preloadRule": {
|
"preloadRule": {
|
||||||
|
|||||||
+8
-15
@@ -49,21 +49,18 @@ export default {
|
|||||||
// 注释下面一行,会停留在启动页
|
// 注释下面一行,会停留在启动页
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.toLaunch();
|
this.toLaunch();
|
||||||
}, 2000)
|
}, 5000)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 未登录:静默处理登录,5秒后跳转业务页面
|
||||||
cookie.get("spread");
|
cookie.get("spread");
|
||||||
// this.toLaunch();
|
if (this.$deviceType != "app") {
|
||||||
if (this.$deviceType == "app") {
|
|
||||||
// this.toLaunch();
|
|
||||||
this.$yrouter.switchTab({
|
|
||||||
path: "/pages/home/index"
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//检查授权信息
|
//检查授权信息
|
||||||
this.checkUserInfo();
|
this.checkUserInfo();
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
this.toLaunch();
|
||||||
|
}, 5000);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(["changeAuthorization", "setUserInfo"]),
|
...mapActions(["changeAuthorization", "setUserInfo"]),
|
||||||
@@ -89,11 +86,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
login(loginInfo).finally(() => {
|
login(loginInfo);
|
||||||
this.$yrouter.switchTab({
|
|
||||||
path: "/pages/home/index"
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="">
|
<view class="">
|
||||||
<video class="video" :show-fullscreen-btn="false" id="myVideo" autoplay :src="curPlayVideoUrl" @error="videoErrorCallback" controls></video>
|
<video
|
||||||
|
class="video"
|
||||||
|
:show-fullscreen-btn="false"
|
||||||
|
:direction="videoDirection"
|
||||||
|
id="myVideo"
|
||||||
|
autoplay
|
||||||
|
:src="curPlayVideoUrl"
|
||||||
|
@loadedmetadata="handleLoadedMetadata"
|
||||||
|
@error="videoErrorCallback"
|
||||||
|
controls
|
||||||
|
></video>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -15,12 +25,14 @@ export default {
|
|||||||
return {
|
return {
|
||||||
curPlayVideoUrl:'',
|
curPlayVideoUrl:'',
|
||||||
isVideoPopupShow:false,
|
isVideoPopupShow:false,
|
||||||
pageKeyId: ''
|
pageKeyId: '',
|
||||||
|
videoDirection: 90,
|
||||||
|
hasLoadedMetadata: false,
|
||||||
|
hasRequestedFullscreen: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onReady(res) {
|
onReady(res) {
|
||||||
this.videoContext = uni.createVideoContext('myVideo');
|
this.videoContext = uni.createVideoContext('myVideo');
|
||||||
this.videoContext.requestFullScreen();
|
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
if (!options.click) {
|
if (!options.click) {
|
||||||
@@ -32,6 +44,29 @@ export default {
|
|||||||
this.pageKeyId = `findVideo_videoId_${id}`
|
this.pageKeyId = `findVideo_videoId_${id}`
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleLoadedMetadata(e) {
|
||||||
|
const detail = e.detail || {}
|
||||||
|
const width = Number(detail.width) || 0
|
||||||
|
const height = Number(detail.height) || 0
|
||||||
|
|
||||||
|
if (height > width && width > 0) {
|
||||||
|
this.videoDirection = 0
|
||||||
|
} else {
|
||||||
|
this.videoDirection = 90
|
||||||
|
}
|
||||||
|
|
||||||
|
this.hasLoadedMetadata = true
|
||||||
|
this.enterFullScreen()
|
||||||
|
},
|
||||||
|
enterFullScreen() {
|
||||||
|
if (!this.videoContext || !this.hasLoadedMetadata || this.hasRequestedFullscreen) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.hasRequestedFullscreen = true
|
||||||
|
this.videoContext.requestFullScreen({
|
||||||
|
direction: this.videoDirection
|
||||||
|
})
|
||||||
|
},
|
||||||
videoErrorCallback: function(e) {
|
videoErrorCallback: function(e) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
content: e.target.errMsg,
|
content: e.target.errMsg,
|
||||||
|
|||||||
@@ -6,25 +6,44 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="list" v-if="list.length">
|
<view class="list" v-show="hasList">
|
||||||
<custom-waterfalls-flow :value="list" imageKey="cover">
|
<view class="video-waterfalls-wrap">
|
||||||
<view class="item" v-for="(item,index) in list" :key="index" slot="slot{{index}}" @click="goDetail(item)">
|
<view class="waterfalls-column">
|
||||||
<image class="cover" :src="item.cover" mode="widthFix"></image>
|
<view class="item" v-for="(lItem,lIndex) in leftList" :key="lIndex" @click="goDetail(lItem)">
|
||||||
|
<image class="cover" :src="lItem.cover" mode="widthFix" lazy-load></image>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="title more-t">{{ item.title }}</view>
|
<view class="title more-t">{{ lItem.title }}</view>
|
||||||
<view class="footer flex jc-between ai-center">
|
<view class="footer flex jc-between ai-center">
|
||||||
<view class="visit flex ai-center">
|
<view class="visit flex ai-center">
|
||||||
<image class="icon" style="margin-right: 8rpx" :src="item.storeLogo" mode="scaleToFill"></image>
|
<image class="icon" style="margin-right: 8rpx" :src="lItem.storeLogo" mode="scaleToFill"></image>
|
||||||
{{ item.storeName }}
|
{{ lItem.storeName }}
|
||||||
</view>
|
</view>
|
||||||
<image class="icon flex-0" :src="webUrl+'/20210806121203835373.png'" mode="scaleToFill"></image>
|
<image class="icon flex-0" :src="webUrl+'/20210806121203835373.png'" mode="scaleToFill"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</custom-waterfalls-flow>
|
</view>
|
||||||
|
<view class="waterfalls-column">
|
||||||
|
<view class="item" v-for="(rItem,rIndex) in rightList" :key="rIndex" @click="goDetail(rItem)">
|
||||||
|
<image class="cover" :src="rItem.cover" mode="widthFix" lazy-load></image>
|
||||||
|
<view class="content">
|
||||||
|
<view class="title more-t">{{ rItem.title }}</view>
|
||||||
|
<view class="footer flex jc-between ai-center">
|
||||||
|
<view class="visit flex ai-center">
|
||||||
|
<image class="icon" style="margin-right: 8rpx" :src="rItem.storeLogo" mode="scaleToFill"></image>
|
||||||
|
{{ rItem.storeName }}
|
||||||
|
</view>
|
||||||
|
<image class="icon flex-0" :src="webUrl+'/20210806121203835373.png'" mode="scaleToFill"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="v4-nodata" v-else>
|
<view class="loading-more" v-show="isWait">加载中...</view>
|
||||||
|
|
||||||
|
<view class="v4-nodata" v-show="showEmpty">
|
||||||
<image src="@/static/images/img_nodata.png" mode="scaleToFill"/>
|
<image src="@/static/images/img_nodata.png" mode="scaleToFill"/>
|
||||||
<view class="text">暂无数据</view>
|
<view class="text">暂无数据</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -36,6 +55,11 @@ import {getStoreVideoType, getArticleList} from '@/api/public'
|
|||||||
import {getVideoList} from '@/api/user'
|
import {getVideoList} from '@/api/user'
|
||||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||||
|
|
||||||
|
// 封面固定宽度(rpx)
|
||||||
|
const COVER_WIDTH = 332
|
||||||
|
// 每项除封面外的文字内容预估高度(rpx)
|
||||||
|
const TEXT_HEIGHT = 120
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [pageListenMixins],
|
mixins: [pageListenMixins],
|
||||||
data() {
|
data() {
|
||||||
@@ -46,11 +70,23 @@ export default {
|
|||||||
page: 1,
|
page: 1,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
keyword: '',
|
keyword: '',
|
||||||
list: [],
|
leftList: [],
|
||||||
|
rightList: [],
|
||||||
|
leftHeight: 0,
|
||||||
|
rightHeight: 0,
|
||||||
isWait: false,
|
isWait: false,
|
||||||
|
requestId: 0,
|
||||||
pageKeyId: Object.freeze('findVideoList')
|
pageKeyId: Object.freeze('findVideoList')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
hasList() {
|
||||||
|
return this.leftList.length + this.rightList.length > 0
|
||||||
|
},
|
||||||
|
showEmpty() {
|
||||||
|
return !this.isWait && !this.hasList
|
||||||
|
}
|
||||||
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
if (!options.click) {
|
if (!options.click) {
|
||||||
uni.switchTab({ url: '/pages/home/index' })
|
uni.switchTab({ url: '/pages/home/index' })
|
||||||
@@ -76,26 +112,72 @@ export default {
|
|||||||
changeType(item) {
|
changeType(item) {
|
||||||
this.type = item.value
|
this.type = item.value
|
||||||
this.page = 1
|
this.page = 1
|
||||||
this.list = []
|
// 使进行中的请求失效并解锁,避免切换时被上一次请求阻塞
|
||||||
|
this.requestId++
|
||||||
|
this.isWait = false
|
||||||
this.fetchList()
|
this.fetchList()
|
||||||
},
|
},
|
||||||
fetchList() {
|
resetList() {
|
||||||
|
this.leftList = []
|
||||||
|
this.rightList = []
|
||||||
|
this.leftHeight = 0
|
||||||
|
this.rightHeight = 0
|
||||||
|
},
|
||||||
|
async fetchList() {
|
||||||
if (this.isWait) return
|
if (this.isWait) return
|
||||||
|
const requestId = ++this.requestId
|
||||||
this.isWait = true
|
this.isWait = true
|
||||||
const params = {
|
const params = {
|
||||||
type: this.type,
|
type: this.type,
|
||||||
page: this.page,
|
page: this.page,
|
||||||
limit: this.limit
|
limit: this.limit
|
||||||
}
|
}
|
||||||
getVideoList(params).then(res => {
|
try {
|
||||||
|
const res = await getVideoList(params)
|
||||||
|
// 请求已被更新的请求(如切换分类)取代,丢弃本次结果
|
||||||
|
if (requestId !== this.requestId) return
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
for (let i = 0; i < res.data.length; i++) {
|
const items = res.data
|
||||||
res.data[i].hide = true
|
for (let i = 0; i < items.length; i++) {
|
||||||
this.list.push(res.data[i])
|
items[i].hide = true
|
||||||
}
|
}
|
||||||
}
|
// 并行获取所有封面高度,完成后一次性替换列表,避免闪现空列表
|
||||||
this.isWait = false
|
const heights = await Promise.all(items.map(item => this.getImageHeight(item.cover)))
|
||||||
|
if (requestId !== this.requestId) return
|
||||||
|
if (this.page === 1) this.resetList()
|
||||||
|
items.forEach((item, i) => {
|
||||||
|
this.pushToColumn(item, heights[i] + TEXT_HEIGHT)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// 忽略请求或图片尺寸获取失败
|
||||||
|
} finally {
|
||||||
|
if (requestId === this.requestId) {
|
||||||
|
this.isWait = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getImageHeight(src) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
uni.getImageInfo({
|
||||||
|
src,
|
||||||
|
success: res => {
|
||||||
|
resolve(res.height / res.width * COVER_WIDTH)
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
resolve(COVER_WIDTH)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
pushToColumn(item, height) {
|
||||||
|
if (this.leftHeight <= this.rightHeight) {
|
||||||
|
this.leftList.push(item)
|
||||||
|
this.leftHeight += height
|
||||||
|
} else {
|
||||||
|
this.rightList.push(item)
|
||||||
|
this.rightHeight += height
|
||||||
|
}
|
||||||
},
|
},
|
||||||
goDetail(item) {
|
goDetail(item) {
|
||||||
this.$yrouter.push("/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl=" + item.video + '&id=' + item.id + '&click=1')
|
this.$yrouter.push("/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl=" + item.video + '&id=' + item.id + '&click=1')
|
||||||
@@ -114,6 +196,7 @@ export default {
|
|||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.active {
|
.active {
|
||||||
@@ -125,13 +208,23 @@ export default {
|
|||||||
.list {
|
.list {
|
||||||
margin: 28rpx 32rpx;
|
margin: 28rpx 32rpx;
|
||||||
|
|
||||||
|
.video-waterfalls-wrap {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.waterfalls-column {
|
||||||
|
width: 332rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
|
margin-bottom: 20rpx;
|
||||||
border-radius: 4rpx;
|
border-radius: 4rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
|
||||||
.cover {
|
.cover {
|
||||||
width: 332rpx;
|
width: 332rpx;
|
||||||
//height: 200rpx;
|
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,4 +267,11 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.loading-more {
|
||||||
|
padding: 24rpx 0;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
+84
-19
@@ -109,7 +109,7 @@
|
|||||||
<view v-if="item.isNegotiable === 1" class="v12-primary-text v12-font-32 v12-font-weight" @clicks.stop="goRoom(item)">
|
<view v-if="item.isNegotiable === 1" class="v12-primary-text v12-font-32 v12-font-weight" @clicks.stop="goRoom(item)">
|
||||||
价格面议
|
价格面议
|
||||||
</view>
|
</view>
|
||||||
<view class="btn">
|
<view class="btn" @click.stop="addToCart(item, 'productId')">
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/home/icon-cart.png'"
|
:src="webUrl + '/home/icon-cart.png'"
|
||||||
class="img-icon"
|
class="img-icon"
|
||||||
@@ -309,14 +309,14 @@
|
|||||||
:key="attr"
|
:key="attr"
|
||||||
:class="{
|
:class="{
|
||||||
'on': attr.check,
|
'on': attr.check,
|
||||||
'disabled': getAttrItemData(attr.attr).stock === 0
|
'disabled': getAttrItemData1(attr.attr).stock === 0
|
||||||
}"
|
}"
|
||||||
class="attr"
|
class="attr"
|
||||||
@click="attrItemClick(attr, attrIndex, index)"
|
@click="attrItemClick(attr, attrIndex, index)"
|
||||||
>
|
>
|
||||||
{{ attr.attr }}
|
{{ attr.attr }}
|
||||||
<text
|
<text
|
||||||
v-if="getAttrItemData(attr.attr).stock === 0"
|
v-if="getAttrItemData1(attr.attr).stock === 0"
|
||||||
class="tag"
|
class="tag"
|
||||||
>缺货</text>
|
>缺货</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -368,28 +368,41 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
<ProductWindow
|
||||||
|
ref="attrWindow"
|
||||||
|
:attr="attr"
|
||||||
|
:cartNum="cart_num"
|
||||||
|
:showOk="true"
|
||||||
|
@changeFun="changeFun"
|
||||||
|
@ok="handleOk(() => this.getCart())"
|
||||||
|
/>
|
||||||
<xdd-tabbar :curr-index="2" />
|
<xdd-tabbar :curr-index="2" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import XddTabbar from '@/components/xdd-tabbar'
|
import XddTabbar from '@/components/xdd-tabbar'
|
||||||
|
import ProductWindow from '@/components/ProductWindow'
|
||||||
import {getAddressList, getUserLike} from "@/api/user";
|
import {getAddressList, getUserLike} from "@/api/user";
|
||||||
import {
|
import {
|
||||||
changeCartNum,
|
changeCartNum,
|
||||||
getCartGroup,
|
getCartGroup,
|
||||||
postCartDel,
|
postCartDel,
|
||||||
|
postCartAdd,
|
||||||
getCartGoodAttr,
|
getCartGoodAttr,
|
||||||
cartGoodChangeAttr
|
cartGoodChangeAttr
|
||||||
} from '@/api/store'
|
} from '@/api/store'
|
||||||
import CheckboxIcon from '@/components/CheckboxIcon.vue'
|
import CheckboxIcon from '@/components/CheckboxIcon.vue'
|
||||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||||
|
import goCartMixin from '@/mixins/goCartMixins'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
import cookie from "@/utils/store/cookie"
|
import cookie from "@/utils/store/cookie"
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
CheckboxIcon,
|
CheckboxIcon,
|
||||||
XddTabbar
|
XddTabbar,
|
||||||
|
ProductWindow
|
||||||
},
|
},
|
||||||
mixins: [pageListenMixins],
|
mixins: [pageListenMixins, goCartMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
@@ -406,15 +419,18 @@ export default {
|
|||||||
},
|
},
|
||||||
showAttr: false,
|
showAttr: false,
|
||||||
pageKeyId: Object.freeze('landmarkGoodsIndex'),
|
pageKeyId: Object.freeze('landmarkGoodsIndex'),
|
||||||
|
cartSelectedIdsCacheKey: Object.freeze('cartSelectedIds'),
|
||||||
isEdit: false,
|
isEdit: false,
|
||||||
addressList:[],
|
addressList:[],
|
||||||
addressInfo: {},
|
addressInfo: {},
|
||||||
userLikeList: [],
|
userLikeList: [],
|
||||||
|
selectedCartIds: [],
|
||||||
// 是否已登录
|
// 是否已登录
|
||||||
isNoLogin: false
|
isNoLogin: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapGetters(['isLogin']),
|
||||||
total() {
|
total() {
|
||||||
let price = 0
|
let price = 0
|
||||||
this.list.forEach(item => {
|
this.list.forEach(item => {
|
||||||
@@ -435,6 +451,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.selectedCartIds = this.getSelectedCartIds()
|
||||||
this.getCart()
|
this.getCart()
|
||||||
this.getAddress()
|
this.getAddress()
|
||||||
},
|
},
|
||||||
@@ -581,22 +598,75 @@ export default {
|
|||||||
isInvalid: true
|
isInvalid: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.list = res.data['valid'].concat(invalid)
|
this.list = this.restoreCartState(res.data['valid'].concat(invalid))
|
||||||
this.handleAll(false)
|
|
||||||
const _res = await getUserLike()
|
const _res = await getUserLike()
|
||||||
this.userLikeList = _res.data
|
this.userLikeList = _res.data
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleAll(state) {
|
getSelectedCartIds() {
|
||||||
this.isAll = state
|
const ids = uni.getStorageSync(this.cartSelectedIdsCacheKey)
|
||||||
|
return Array.isArray(ids) ? ids : []
|
||||||
|
},
|
||||||
|
syncSelectedCartIds() {
|
||||||
|
const ids = []
|
||||||
|
this.list.forEach(item => {
|
||||||
|
item.carts.forEach(good => {
|
||||||
|
if (good.state) {
|
||||||
|
ids.push(good.id)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.selectedCartIds = ids
|
||||||
|
uni.setStorageSync(this.cartSelectedIdsCacheKey, ids)
|
||||||
|
},
|
||||||
|
refreshSelectionState() {
|
||||||
|
let hasSelectableGoods = false
|
||||||
|
let isAll = true
|
||||||
this.list = this.list.map(item => {
|
this.list = this.list.map(item => {
|
||||||
item.state = state
|
const selectableCarts = item.carts.filter(() => !item.isInvalid || this.isEdit)
|
||||||
|
if (selectableCarts.length > 0) {
|
||||||
|
hasSelectableGoods = true
|
||||||
|
}
|
||||||
|
item.state = selectableCarts.length > 0 && selectableCarts.every(good => good.state)
|
||||||
|
if (selectableCarts.length > 0 && !item.state) {
|
||||||
|
isAll = false
|
||||||
|
}
|
||||||
|
return item
|
||||||
|
})
|
||||||
|
this.isAll = hasSelectableGoods && isAll
|
||||||
|
this.syncSelectedCartIds()
|
||||||
|
},
|
||||||
|
restoreCartState(list) {
|
||||||
|
const selectedCartIds = new Set(this.selectedCartIds)
|
||||||
|
const nextList = list.map(item => {
|
||||||
|
const canSelect = !item.isInvalid || this.isEdit
|
||||||
|
const carts = item.carts.map(good => {
|
||||||
|
return {
|
||||||
|
...good,
|
||||||
|
state: canSelect ? selectedCartIds.has(good.id) : false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
carts,
|
||||||
|
state: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.list = nextList
|
||||||
|
this.refreshSelectionState()
|
||||||
|
return this.list
|
||||||
|
},
|
||||||
|
handleAll(state) {
|
||||||
|
this.list = this.list.map(item => {
|
||||||
|
const canSelect = !item.isInvalid || this.isEdit
|
||||||
|
item.state = canSelect ? state : false
|
||||||
item.carts = item.carts.map(good => {
|
item.carts = item.carts.map(good => {
|
||||||
good.state = item.isInvalid && !this.isEdit ? false : state
|
good.state = canSelect ? state : false
|
||||||
return good
|
return good
|
||||||
})
|
})
|
||||||
return item
|
return item
|
||||||
})
|
})
|
||||||
|
this.refreshSelectionState()
|
||||||
},
|
},
|
||||||
navToStore(id) {
|
navToStore(id) {
|
||||||
if (id === 0) {
|
if (id === 0) {
|
||||||
@@ -615,6 +685,7 @@ export default {
|
|||||||
if (mark.length === 1) {
|
if (mark.length === 1) {
|
||||||
if (mark[0] === -1) {
|
if (mark[0] === -1) {
|
||||||
this.handleAll(state)
|
this.handleAll(state)
|
||||||
|
return
|
||||||
} else {
|
} else {
|
||||||
this.list[mark[0]]['state'] = state
|
this.list[mark[0]]['state'] = state
|
||||||
this.list[mark[0]]['carts'] = this.list[mark[0]]['carts'].map(good => {
|
this.list[mark[0]]['carts'] = this.list[mark[0]]['carts'].map(good => {
|
||||||
@@ -634,13 +705,7 @@ export default {
|
|||||||
})
|
})
|
||||||
this.list[mark[0]]['state'] = count === length
|
this.list[mark[0]]['state'] = count === length
|
||||||
}
|
}
|
||||||
let shopCheckNumber = 0
|
this.refreshSelectionState()
|
||||||
this.list.map(item => {
|
|
||||||
if (item.state) {
|
|
||||||
shopCheckNumber++
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.isAll = shopCheckNumber === this.list.length
|
|
||||||
},
|
},
|
||||||
inputChangeHandle(index, gIndex, good, e) {
|
inputChangeHandle(index, gIndex, good, e) {
|
||||||
|
|
||||||
@@ -766,7 +831,7 @@ export default {
|
|||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getAttrItemData(attr) {
|
getAttrItemData1(attr) {
|
||||||
let result = {
|
let result = {
|
||||||
stock: 0
|
stock: 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -384,20 +384,23 @@ export default {
|
|||||||
this.mescroll && this.mescroll.triggerDownScroll()
|
this.mescroll && this.mescroll.triggerDownScroll()
|
||||||
},
|
},
|
||||||
search() {
|
search() {
|
||||||
if(this.keyword === '') return
|
const keyword = (this.keyword || '').trim()
|
||||||
this.listGroup.findIndex((group, index) => {
|
if (!keyword) return
|
||||||
let result
|
const matchIndex = this.listGroup.findIndex(group => {
|
||||||
group.city.forEach(item => {
|
const cityList = Array.isArray(group.city) ? group.city : []
|
||||||
result = item.cityName.indexOf(this.keyword, 0)
|
return cityList.some(item => item && item.cityName && item.cityName.indexOf(keyword) !== -1)
|
||||||
if (result !== -1) {
|
|
||||||
this.asideTap(index);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
if (result !== -1) {
|
if (matchIndex !== -1) {
|
||||||
return result
|
this.keyword = keyword
|
||||||
|
this.asideTap(matchIndex)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
if (matchIndex === -1) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '未找到该城市,请重新输入城市名称',
|
||||||
|
icon: 'none'
|
||||||
})
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
select(item) {
|
select(item) {
|
||||||
if (this.type === 0 && item.hasData === 0) return
|
if (this.type === 0 && item.hasData === 0) return
|
||||||
|
|||||||
@@ -114,7 +114,8 @@
|
|||||||
<view class="icon-box"><u-icon name="arrow-rightward" color="#fff" size="8"></u-icon></view>
|
<view class="icon-box"><u-icon name="arrow-rightward" color="#fff" size="8"></u-icon></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="v4-nodata" v-if="townList.length === 0">
|
<goo-skeleton v-if="!townLoaded" :show-avatar="false"/>
|
||||||
|
<view class="v4-nodata" v-else-if="townList.length === 0">
|
||||||
<image src="@/static/images/img_nodata.png" mode="scaleToFill"/>
|
<image src="@/static/images/img_nodata.png" mode="scaleToFill"/>
|
||||||
<view class="text">暂无数据</view>
|
<view class="text">暂无数据</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -203,6 +204,7 @@ export default {
|
|||||||
isNext: false,
|
isNext: false,
|
||||||
townConfig: {},
|
townConfig: {},
|
||||||
townList: [],
|
townList: [],
|
||||||
|
townLoaded: false,
|
||||||
randomSeed: null,
|
randomSeed: null,
|
||||||
hotelBanner: [],
|
hotelBanner: [],
|
||||||
goodCityId: '',
|
goodCityId: '',
|
||||||
@@ -519,6 +521,8 @@ export default {
|
|||||||
}
|
}
|
||||||
getAncientTownList(params).then(res => {
|
getAncientTownList(params).then(res => {
|
||||||
this.townList = res.data.records
|
this.townList = res.data.records
|
||||||
|
}).finally(() => {
|
||||||
|
this.townLoaded = true
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
+173
-779
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,454 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="pkg-product-land-mark" v-if="mapData">
|
|
||||||
<view class="top-box" :style="{'backgroundColor':topBoxBgColor}">
|
|
||||||
<view class="view-box">
|
|
||||||
<view class="search-box flex ai-center">
|
|
||||||
<input
|
|
||||||
v-model="keyword"
|
|
||||||
type="text"
|
|
||||||
placeholder="搜索商品"
|
|
||||||
placeholder-style="color:#999"
|
|
||||||
@confirm="search()"
|
|
||||||
/>
|
|
||||||
<image
|
|
||||||
:src="webUrl+'/20231223183627184005.png'"
|
|
||||||
mode="scaleToFill"
|
|
||||||
style="width:30rpx;height:30rpx"
|
|
||||||
@click="search()"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="map-box">
|
|
||||||
<image class="img-map" :src="mapData.mapImage" mode="widthFix"/>
|
|
||||||
|
|
||||||
<view
|
|
||||||
v-for="(item, index) in mapLocations"
|
|
||||||
:key="index"
|
|
||||||
class="item"
|
|
||||||
:style="{'left':item.gx+'rpx','top':item.gy+'rpx'}"
|
|
||||||
@click="goGoods(item.productId)"
|
|
||||||
>
|
|
||||||
<view class="round">
|
|
||||||
<view class="line" :class="'line-'+directionClass[item.labelDirection]"></view>
|
|
||||||
</view>
|
|
||||||
<view class="label flex ai-end" :class="'label-'+directionClass[item.labelDirection]">
|
|
||||||
<image class="cover flex-0" :src="item.mapImage" mode="scaleToFill" v-if="item.labelDirection===4"/>
|
|
||||||
<view class="title flex ai-center">{{ item.mapTitle }}</view>
|
|
||||||
<image class="cover flex-0" :src="item.mapImage" mode="scaleToFill" v-if="item.labelDirection!==4"/>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="nav flex">
|
|
||||||
<view class="flex flex-0 ai-center" :class="{'active': navIndex===index}" v-for="(item,index) in navList"
|
|
||||||
:key="index" @click="changeNav(index)">{{ item.provinceName }}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="main-box" v-if="mapData.recommended.storeImage"
|
|
||||||
@click="goGoods(mapData.recommended.productId)">
|
|
||||||
<image class="bg-main" :src="mapData.recommended.storeImage" mode="scaleToFill"/>
|
|
||||||
<view class="box-mask flex flex-col jc-end">
|
|
||||||
<view class="one-t bold">{{ mapData.recommended.title }}</view>
|
|
||||||
<view class="more-t">{{ mapData.recommended.description }}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="list-box flex flex-wrap">
|
|
||||||
<view class="item" v-for="item in goods" :key="item.id" @click="goGoods(item.productId)">
|
|
||||||
<image :src="item.storeImage" mode="scaleToFill"/>
|
|
||||||
<view class="content flex flex-col jc-between">
|
|
||||||
<view class="more-t bold">{{ item.title }}</view>
|
|
||||||
<view class="flex jc-between ai-center">
|
|
||||||
<text class="price">¥{{ item.price }}</text>
|
|
||||||
<image class="btn" :src="webUrl+'/20231114151028082368.png'" mode="scaleToFill"/>
|
|
||||||
<!-- <view class="btn flex jc-center ai-center">立即购买</view>-->
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<image class="img-nodata" :src="webUrl+'/20231023131208675588.png'" mode="scaleToFill"
|
|
||||||
v-if="goods.length===0"/>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {getProvince, getProvinceGoods, getProvinceList} from "@/api/product";
|
|
||||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'LandMarkPage',
|
|
||||||
mixins: [pageListenMixins],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
|
||||||
keyword: '',
|
|
||||||
page: 1,
|
|
||||||
navList: [],
|
|
||||||
navIndex: 0,
|
|
||||||
mapData: null,
|
|
||||||
mapLocations: [],
|
|
||||||
goods: [],
|
|
||||||
directionClass: ['', 'up', 'right', 'down', 'left'],
|
|
||||||
pageKeyId: Object.freeze('landmarkGoodsIndex')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
topBoxBgColor() {
|
|
||||||
return this.navList.length > 0 ? this.navList[this.navIndex]['backgroundColor'] : '#FFFFFF';
|
|
||||||
},
|
|
||||||
viewBoxBgColor() {
|
|
||||||
return this.mapData?.backgroundColor || '#FFFFFF';
|
|
||||||
},
|
|
||||||
scale() {
|
|
||||||
return 718 / (this.mapData?.mapImageWidth || 1);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
this.getNavList();
|
|
||||||
},
|
|
||||||
onHide() {
|
|
||||||
this.pageToHideHandle()
|
|
||||||
},
|
|
||||||
onReachBottom() {
|
|
||||||
this.page++;
|
|
||||||
this.fetchGoods();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getNavList() {
|
|
||||||
getProvinceList().then(({data}) => {
|
|
||||||
this.navList = data;
|
|
||||||
this.changeNav(this.navIndex);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
search() {
|
|
||||||
this.page = 1;
|
|
||||||
this.fetchGoods();
|
|
||||||
},
|
|
||||||
|
|
||||||
changeNav(index) {
|
|
||||||
this.navIndex = index;
|
|
||||||
this.page = 1;
|
|
||||||
this.getMap();
|
|
||||||
this.fetchGoods();
|
|
||||||
},
|
|
||||||
|
|
||||||
getMap() {
|
|
||||||
const id = this.navList[this.navIndex]['id']
|
|
||||||
getProvince(id).then(({data}) => {
|
|
||||||
this.mapData = data;
|
|
||||||
this.mapLocations = data.mapLocations;
|
|
||||||
this.calcPosition();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
// 计算位置
|
|
||||||
calcPosition() {
|
|
||||||
this.mapLocations?.forEach(item => {
|
|
||||||
item.gx = item.x * this.scale;
|
|
||||||
item.gy = item.y * this.scale;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
fetchGoods() {
|
|
||||||
const id = this.navList[this.navIndex]['id']
|
|
||||||
getProvinceGoods(id, this.keyword, this.page).then(({data}) => {
|
|
||||||
if (this.page === 1) this.goods = [];
|
|
||||||
for (let i = 0; i < data.length; i++) {
|
|
||||||
this.goods.push(data[i]);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
goGoods(id) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/shop/GoodsCon/index?id=${id}&from=landmark`
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="less">
|
|
||||||
.pkg-product-land-mark {
|
|
||||||
background: #F7F3ED;
|
|
||||||
|
|
||||||
image {
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.top-box {
|
|
||||||
padding: 32rpx 0 20rpx;
|
|
||||||
|
|
||||||
.view-box {
|
|
||||||
position: relative;
|
|
||||||
margin: 0 16rpx;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
.search-box {
|
|
||||||
position: absolute;
|
|
||||||
top: 20rpx;
|
|
||||||
left: 34rpx;
|
|
||||||
width: 650rpx;
|
|
||||||
height: 64rpx;
|
|
||||||
padding: 0 32rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border-radius: 32rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
z-index: 10;
|
|
||||||
|
|
||||||
input {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
line-height: 64rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.map-box {
|
|
||||||
position: relative;
|
|
||||||
width: 718rpx;
|
|
||||||
|
|
||||||
.img-map {
|
|
||||||
width: 718rpx;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item {
|
|
||||||
position: absolute;
|
|
||||||
|
|
||||||
.round {
|
|
||||||
width: 8rpx;
|
|
||||||
height: 8rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
box-shadow: 0 0 0 8rpx rgba(225, 38, 65, .4);;
|
|
||||||
background: #E12641;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line {
|
|
||||||
position: relative;
|
|
||||||
border: 2rpx solid #E12641;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line-up {
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, -100%);
|
|
||||||
width: 0;
|
|
||||||
height: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line-right {
|
|
||||||
top: 50%;
|
|
||||||
transform: translate(0, -50%);
|
|
||||||
width: 30rpx;
|
|
||||||
height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line-down {
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, 0);
|
|
||||||
width: 0;
|
|
||||||
height: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line-left {
|
|
||||||
top: 50%;
|
|
||||||
transform: translate(-100%, -50%);
|
|
||||||
width: 30rpx;
|
|
||||||
height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.label {
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.cover {
|
|
||||||
width: 60rpx;
|
|
||||||
height: 60rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border: 6rpx solid #E12641;
|
|
||||||
border-radius: 50%;
|
|
||||||
z-index: 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
height: 32rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
padding: 0 16rpx;
|
|
||||||
background: #E12641;
|
|
||||||
color: #FFFFFF;
|
|
||||||
font-size: 22rpx;
|
|
||||||
line-height: 32rpx;
|
|
||||||
white-space: nowrap;
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.label-up {
|
|
||||||
top: -80rpx;
|
|
||||||
left: -50%;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
margin-right: -9rpx;
|
|
||||||
border-radius: 20rpx 0 0 20rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.label-right {
|
|
||||||
top: -40rpx;
|
|
||||||
left: 32rpx;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
margin-right: -9rpx;
|
|
||||||
border-radius: 20rpx 0 0 20rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.label-down {
|
|
||||||
left: -50%;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
margin-right: -9rpx;
|
|
||||||
border-radius: 20rpx 0 0 20rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.label-left {
|
|
||||||
left: -100%;
|
|
||||||
transform: translate(-30rpx, -40rpx);
|
|
||||||
|
|
||||||
.title {
|
|
||||||
margin-left: -9rpx;
|
|
||||||
border-radius: 0 20rpx 20rpx 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav {
|
|
||||||
padding: 30rpx 20rpx 0;
|
|
||||||
overflow-x: scroll;
|
|
||||||
|
|
||||||
view {
|
|
||||||
height: 52rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 0 18rpx;
|
|
||||||
border: 4rpx solid transparent;
|
|
||||||
color: #FFFFFF;
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.active {
|
|
||||||
border-color: #FFFFFF;
|
|
||||||
border-radius: 26rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-box {
|
|
||||||
position: relative;
|
|
||||||
width: 718rpx;
|
|
||||||
height: 360rpx;
|
|
||||||
margin: 24rpx 16rpx;
|
|
||||||
border-radius: 16rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
.bg-main {
|
|
||||||
width: 718rpx;
|
|
||||||
height: 360rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.box-mask {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 200rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 20rpx 16rpx 16rpx;
|
|
||||||
background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000000 100%);
|
|
||||||
color: #FFFFFF;
|
|
||||||
|
|
||||||
.one-t {
|
|
||||||
margin-bottom: 16rpx;
|
|
||||||
font-size: 46rpx;
|
|
||||||
line-height: 52rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.more-t {
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding-top: 10rpx;
|
|
||||||
border-top: 1rpx solid #FFFFFF;
|
|
||||||
font-size: 28rpx;
|
|
||||||
line-height: 32rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-box {
|
|
||||||
margin-top: 24rpx;
|
|
||||||
padding: 0 16rpx 34rpx;
|
|
||||||
|
|
||||||
.item {
|
|
||||||
width: 234rpx;
|
|
||||||
height: 380rpx;
|
|
||||||
margin-right: 8rpx;
|
|
||||||
margin-bottom: 24rpx;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 234rpx;
|
|
||||||
height: 234rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
height: 122rpx;
|
|
||||||
margin: 6rpx 6rpx 18rpx;
|
|
||||||
|
|
||||||
.more-t {
|
|
||||||
font-size: 28rpx;
|
|
||||||
line-height: 36rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.price {
|
|
||||||
font-size: 28rpx;
|
|
||||||
line-height: 36rpx;
|
|
||||||
color: #DC1616;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
width: 118rpx;
|
|
||||||
height: 42rpx;
|
|
||||||
//background: linear-gradient(180deg, #EFEDC7 0%, #EAC94B 100%);
|
|
||||||
//border-radius: 4rpx;
|
|
||||||
//color: #764A00;
|
|
||||||
//font-size: 24rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.item:nth-child(3n) {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.img-nodata {
|
|
||||||
position: relative;
|
|
||||||
top: 0;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, 0);
|
|
||||||
width: 352rpx;
|
|
||||||
height: 338rpx;
|
|
||||||
margin-bottom: 60rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
+21
-3
@@ -36,7 +36,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="product-wrap v12-mt-3">
|
<view v-if="products.length > 0" class="product-wrap v12-mt-3">
|
||||||
<view class="product-card" v-for="(item, index) in products" :key="index" @click="toGoods(item)">
|
<view class="product-card" v-for="(item, index) in products" :key="index" @click="toGoods(item)">
|
||||||
<image :src="item.productImage" class="product-card-img" mode="heightFix|widthFix"></image>
|
<image :src="item.productImage" class="product-card-img" mode="heightFix|widthFix"></image>
|
||||||
<view class="new-info">
|
<view class="new-info">
|
||||||
@@ -53,6 +53,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-else class="empty-wrap">
|
||||||
|
<view class="empty-text">暂无数据</view>
|
||||||
|
</view>
|
||||||
<ProductWindow
|
<ProductWindow
|
||||||
ref="attrWindow"
|
ref="attrWindow"
|
||||||
:attr="attr"
|
:attr="attr"
|
||||||
@@ -99,8 +102,12 @@ export default{
|
|||||||
onLoad() {
|
onLoad() {
|
||||||
queryNewZone().then(res => {
|
queryNewZone().then(res => {
|
||||||
this.details = res.data
|
this.details = res.data
|
||||||
this.tabs = res.data.categories
|
this.tabs = Array.isArray(res.data.categories) ? res.data.categories : []
|
||||||
|
if (this.tabs.length > 0) {
|
||||||
this.handleClick(0, this.tabs[0])
|
this.handleClick(0, this.tabs[0])
|
||||||
|
} else {
|
||||||
|
this.products = []
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -112,7 +119,7 @@ export default{
|
|||||||
methods: {
|
methods: {
|
||||||
handleClick(index, tab) {
|
handleClick(index, tab) {
|
||||||
this.activeIndex = index
|
this.activeIndex = index
|
||||||
this.products = tab.products
|
this.products = Array.isArray(tab && tab.products) ? tab.products : []
|
||||||
},
|
},
|
||||||
handleChange(e) {
|
handleChange(e) {
|
||||||
this.current = e.detail.current
|
this.current = e.detail.current
|
||||||
@@ -144,6 +151,17 @@ export default{
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
.empty-wrap{
|
||||||
|
min-height: 260rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.empty-text{
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999999;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
.tab-line{
|
.tab-line{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
|||||||
+870
-141
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -117,7 +117,7 @@
|
|||||||
<text class="v12-font-28">{{ force2Decimal(orderPrice.payPostage) }}</text>
|
<text class="v12-font-28">{{ force2Decimal(orderPrice.payPostage) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="v12-justify-between v12-align-center v12-py-1">
|
<view v-if="!isLotteryOrder()" class="v12-justify-between v12-align-center v12-py-1">
|
||||||
<view class="v12-font-24 v12-dark-text v12-align-center">
|
<view class="v12-font-24 v12-dark-text v12-align-center">
|
||||||
<text>优惠券</text>
|
<text>优惠券</text>
|
||||||
<view class="v12-align-center v12-ml-1" v-if="couponTitle">
|
<view class="v12-align-center v12-ml-1" v-if="couponTitle">
|
||||||
@@ -255,7 +255,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- v9 优惠券开始 -->
|
<!-- v9 优惠券开始 -->
|
||||||
<u-popup
|
<u-popup
|
||||||
v-if="show"
|
v-if="!isLotteryOrder() && show"
|
||||||
:show="show"
|
:show="show"
|
||||||
:round="10"
|
:round="10"
|
||||||
mode="bottom"
|
mode="bottom"
|
||||||
@@ -263,7 +263,7 @@
|
|||||||
@close="close"
|
@close="close"
|
||||||
>
|
>
|
||||||
<CouponsPopup
|
<CouponsPopup
|
||||||
v-if="couponList.usable.length > 0 && show"
|
v-if="!isLotteryOrder() && couponList.usable.length > 0 && show"
|
||||||
:two-list="couponList"
|
:two-list="couponList"
|
||||||
@change="changeCoupons"
|
@change="changeCoupons"
|
||||||
@close="close"
|
@close="close"
|
||||||
@@ -328,7 +328,10 @@ import {isNullOrEmpty, isWeixin} from "@/utils"
|
|||||||
import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue'
|
import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue'
|
||||||
import uniPopup from '@/components/uni-popup/uni-popup.vue'
|
import uniPopup from '@/components/uni-popup/uni-popup.vue'
|
||||||
import CouponsPopup from "@/components/CouponsPopup.vue"
|
import CouponsPopup from "@/components/CouponsPopup.vue"
|
||||||
|
import { getDrawTicketByOrder } from '@/api/lottery'
|
||||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||||
|
import settings from '@/config/baseSetting.js'
|
||||||
|
import { orderPaySuccessToCheckDrawStatus } from '@/mixins/orderPaySuccessToCheckDrawStatus.js'
|
||||||
|
|
||||||
const NAME = "OrderSubmission"
|
const NAME = "OrderSubmission"
|
||||||
const _isWeixin = isWeixin()
|
const _isWeixin = isWeixin()
|
||||||
@@ -342,7 +345,7 @@ export default {
|
|||||||
passkeyborad,
|
passkeyborad,
|
||||||
CouponsPopup
|
CouponsPopup
|
||||||
},
|
},
|
||||||
mixins: [pageListenMixins],
|
mixins: [pageListenMixins, orderPaySuccessToCheckDrawStatus],
|
||||||
props: {},
|
props: {},
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
@@ -395,7 +398,8 @@ export default {
|
|||||||
pageKeyId: Object.freeze('orderConfirm'),
|
pageKeyId: Object.freeze('orderConfirm'),
|
||||||
total: 0,
|
total: 0,
|
||||||
couponTitle: '',
|
couponTitle: '',
|
||||||
hasCoupon: false
|
hasCoupon: false,
|
||||||
|
pageQuery: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: mapGetters(["userInfo", "storeItems"]),
|
computed: mapGetters(["userInfo", "storeItems"]),
|
||||||
@@ -414,17 +418,18 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad(opts) {
|
onLoad(opts) {
|
||||||
const that = this
|
const that = this
|
||||||
if (that.$yroute.query.pinkid !== undefined) {
|
that.pageQuery = Object.assign({}, that.resolvePageQuery(), opts || {})
|
||||||
that.pinkId = that.$yroute.query.pinkid
|
if (that.pageQuery.pinkid !== undefined) {
|
||||||
|
that.pinkId = that.pageQuery.pinkid
|
||||||
}
|
}
|
||||||
if (that.$yroute.query.id !== undefined) {
|
if (that.pageQuery.id !== undefined) {
|
||||||
that.cartid = that.$yroute.query.id
|
that.cartid = that.pageQuery.id
|
||||||
console.log(that.cartid)
|
console.log(that.cartid)
|
||||||
}
|
}
|
||||||
if (that.$yroute.query.lotteryRecordId !== undefined) {
|
if (that.pageQuery.lotteryRecordId !== undefined) {
|
||||||
that.lotteryRecordId = that.$yroute.query.lotteryRecordId
|
that.lotteryRecordId = that.pageQuery.lotteryRecordId
|
||||||
}
|
}
|
||||||
that.hasCoupon = opts.couponId !== ''
|
that.hasCoupon = !!(opts && opts.couponId !== '')
|
||||||
that.getCartInfo()
|
that.getCartInfo()
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
@@ -449,6 +454,37 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isNullOrEmpty,
|
isNullOrEmpty,
|
||||||
|
resolvePageQuery() {
|
||||||
|
if (this.$yroute && this.$yroute.query) {
|
||||||
|
return this.$yroute.query
|
||||||
|
}
|
||||||
|
if (this.$route && this.$route.query) {
|
||||||
|
return this.$route.query
|
||||||
|
}
|
||||||
|
if (this._route && this._route.query) {
|
||||||
|
return this._route.query
|
||||||
|
}
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
isLotteryOrder() {
|
||||||
|
const cartInfo = Array.isArray(this.orderGroupInfo && this.orderGroupInfo.cartInfo)
|
||||||
|
? this.orderGroupInfo.cartInfo
|
||||||
|
: []
|
||||||
|
return Boolean(
|
||||||
|
this.lotteryRecordId ||
|
||||||
|
this.pageQuery.from === 'countyLottery' ||
|
||||||
|
Number(this.pageQuery.drawActivityId || 0) > 0 ||
|
||||||
|
cartInfo.some(item => Number(
|
||||||
|
item.drawActivityId ||
|
||||||
|
(item.productInfo && item.productInfo.drawActivityId) ||
|
||||||
|
0
|
||||||
|
) > 0)
|
||||||
|
)
|
||||||
|
},
|
||||||
|
getOrderCouponId() {
|
||||||
|
if (this.isLotteryOrder()) return 0
|
||||||
|
return this.couponList.usable.length === 0 ? 0 : (this.couponId || 0)
|
||||||
|
},
|
||||||
couponMax(e) {
|
couponMax(e) {
|
||||||
// this.couponTitle = e.couponTitle
|
// this.couponTitle = e.couponTitle
|
||||||
// this.couponId = this.$yroute.query.couponId || uni.getStorageSync('couponId') || 0
|
// this.couponId = this.$yroute.query.couponId || uni.getStorageSync('couponId') || 0
|
||||||
@@ -456,7 +492,7 @@ export default {
|
|||||||
showStoreList() {
|
showStoreList() {
|
||||||
this.$store.commit("get_to", "orders")
|
this.$store.commit("get_to", "orders")
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/shop/StoreList/index"
|
path: "/pagesShop/shop/StoreList/index"
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
force2Decimal(value) {
|
force2Decimal(value) {
|
||||||
@@ -474,18 +510,23 @@ export default {
|
|||||||
postOrderComputed(this.orderGroupInfo.orderKey, {
|
postOrderComputed(this.orderGroupInfo.orderKey, {
|
||||||
addressId: this.addressInfo.id,
|
addressId: this.addressInfo.id,
|
||||||
useIntegral: this.useIntegral ? 1 : 0,
|
useIntegral: this.useIntegral ? 1 : 0,
|
||||||
couponId: this.couponList.usable.length === 0 ? 0 : this.couponId,
|
couponId: this.getOrderCouponId(),
|
||||||
usePoints: this.usePointsCheck ? 1 : 0,
|
usePoints: this.usePointsCheck ? 1 : 0,
|
||||||
shipping_type: parseInt(this.shipping_type) + 1
|
shipping_type: parseInt(this.shipping_type) + 1
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.couponList = res.data.result.couponList
|
this.couponList = res.data.result.couponList
|
||||||
if(!f) {
|
if (this.isLotteryOrder()) {
|
||||||
|
this.couponTitle = ''
|
||||||
|
if (this.couponId !== 0) {
|
||||||
|
this.couponId = 0
|
||||||
|
}
|
||||||
|
} else if(!f) {
|
||||||
this.couponId = res.data.result.defaultCouponId
|
this.couponId = res.data.result.defaultCouponId
|
||||||
}
|
}
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
if (data.status === "EXTEND_ORDER") {
|
if (data.status === "EXTEND_ORDER") {
|
||||||
this.$yrouter.replace({
|
this.$yrouter.replace({
|
||||||
path: "/pages/order/OrderDetails/index",
|
path: "/pagesOrder/order/OrderDetails/index",
|
||||||
query: {
|
query: {
|
||||||
id: data.result.orderId
|
id: data.result.orderId
|
||||||
}
|
}
|
||||||
@@ -540,8 +581,8 @@ export default {
|
|||||||
}
|
}
|
||||||
_this.systemStore = data.systemStore || {}
|
_this.systemStore = data.systemStore || {}
|
||||||
_this.storeSelfMention = data.storeSelfMention
|
_this.storeSelfMention = data.storeSelfMention
|
||||||
if(_this.$yroute.query.address !== undefined ) {
|
if(_this.pageQuery.address !== undefined ) {
|
||||||
_this.addressInfo = JSON.parse(_this.$yroute.query.address) || {}
|
_this.addressInfo = JSON.parse(_this.pageQuery.address) || {}
|
||||||
_this.computedPrice()
|
_this.computedPrice()
|
||||||
} else {
|
} else {
|
||||||
// _this.addressInfo = uni.getStorageSync('sourceAddress') || data.addressInfo || {}
|
// _this.addressInfo = uni.getStorageSync('sourceAddress') || data.addressInfo || {}
|
||||||
@@ -600,11 +641,7 @@ export default {
|
|||||||
},
|
},
|
||||||
subscribePay() {
|
subscribePay() {
|
||||||
uni.requestSubscribeMessage({
|
uni.requestSubscribeMessage({
|
||||||
tmplIds: [
|
tmplIds: settings.SubscribeMessageTmplIds,
|
||||||
'7O3wKw7_D4t7yfSOlvecKuOQP8QEPY88uBx2FJg43HE',
|
|
||||||
'TSmTnGibZ8IxWCiRWOvLxha6-0u7tE-V1-WbDCiPkKU',
|
|
||||||
'9Q6xLHe6HyjkU5Zn5k_2zxYPf2y4MxVyUbOSW8pcZRU'
|
|
||||||
],
|
|
||||||
complete: () => this.createOrder(false)
|
complete: () => this.createOrder(false)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -684,7 +721,7 @@ export default {
|
|||||||
phone: this.contactsTel,
|
phone: this.contactsTel,
|
||||||
addressId: this.addressInfo.id,
|
addressId: this.addressInfo.id,
|
||||||
useIntegral: this.useIntegral ? 1 : 0,
|
useIntegral: this.useIntegral ? 1 : 0,
|
||||||
couponId: this.couponList.usable.length === 0 ? 0 : this.couponId || 0,
|
couponId: this.getOrderCouponId(),
|
||||||
usePoints: this.usePointsNumber || 0,
|
usePoints: this.usePointsNumber || 0,
|
||||||
payType: this.active,
|
payType: this.active,
|
||||||
pinkId: this.pinkId,
|
pinkId: this.pinkId,
|
||||||
@@ -707,6 +744,7 @@ export default {
|
|||||||
createOrder(this.orderGroupInfo.orderKey, params).then(res => {
|
createOrder(this.orderGroupInfo.orderKey, params).then(res => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
const data = res.data
|
const data = res.data
|
||||||
|
const orderId = data && data.result ? data.result.orderId : ''
|
||||||
switch (data.status) {
|
switch (data.status) {
|
||||||
case "ORDER_EXIST":
|
case "ORDER_EXIST":
|
||||||
case "EXTEND_ORDER":
|
case "EXTEND_ORDER":
|
||||||
@@ -716,9 +754,9 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
})
|
})
|
||||||
this.$yrouter.replace({
|
this.$yrouter.replace({
|
||||||
path: "/pages/order/OrderDetails/index",
|
path: "/pagesOrder/order/OrderDetails/index",
|
||||||
query: {
|
query: {
|
||||||
id: data.result.orderId
|
id: orderId
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
@@ -743,21 +781,7 @@ export default {
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
})
|
})
|
||||||
if (this.orderGroupInfo.cartInfo && this.orderGroupInfo.cartInfo.length === 1) {
|
this.paySuccessToMyOrderOrDetail(orderId)
|
||||||
this.$yrouter.replace({
|
|
||||||
path: "/pages/order/OrderDetails/index",
|
|
||||||
query: {
|
|
||||||
id: data.result.orderId
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.$yrouter.replace({
|
|
||||||
path: "/pages/order/MyOrder/index",
|
|
||||||
query: {
|
|
||||||
type: 2
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case "WECHAT_H5_PAY":
|
case "WECHAT_H5_PAY":
|
||||||
// H5支付
|
// H5支付
|
||||||
@@ -770,24 +794,18 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case "WECHAT_PAY":
|
case "WECHAT_PAY":
|
||||||
// 小程序支付
|
// 小程序支付
|
||||||
weappPay(data.result.jsConfig).finally(() => {
|
weappPay(data.result.jsConfig).then(() => {
|
||||||
this.$yrouter.replace({
|
this.paySuccessToMyOrderOrDetail(orderId)
|
||||||
path: "/pages/order/MyOrder/index",
|
}).catch(() => {
|
||||||
query: {
|
this.paySuccessToMyOrderOrDetail(orderId)
|
||||||
type: 1
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
case "WECHAT_APP_PAY":
|
case "WECHAT_APP_PAY":
|
||||||
// APP支付
|
// APP支付
|
||||||
weappPay(data.result.jsConfig).finally(() => {
|
weappPay(data.result.jsConfig).then(() => {
|
||||||
this.$yrouter.replace({
|
this.paySuccessToMyOrderOrDetail(orderId)
|
||||||
path: "/pages/order/MyOrder/index",
|
}).catch(() => {
|
||||||
query: {
|
this.paySuccessToMyOrderOrDetail(orderId)
|
||||||
type: 1
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -802,20 +820,42 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
})
|
})
|
||||||
}).finally(function () {
|
}).finally(function () {
|
||||||
that.isShowPayPwdPop = false
|
if (that.$refs.payPwdPop) {
|
||||||
that.$refs.payPwdPop.clear()
|
that.$refs.payPwdPop.clear()
|
||||||
that.$refs.payPwdPop.close()
|
that.$refs.payPwdPop.close()
|
||||||
|
}
|
||||||
|
that.isShowPayPwdPop = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
paySuccessToMyOrderOrDetail(orderId) {
|
||||||
|
this.afterPaySuccess(orderId, (drawTicketResult) => {
|
||||||
|
if (this.orderGroupInfo.cartInfo && this.orderGroupInfo.cartInfo.length === 1) {
|
||||||
|
this.$yrouter.replace({
|
||||||
|
path: "/pagesOrder/order/OrderDetails/index",
|
||||||
|
query: this.buildOrderDetailQuery(orderId, drawTicketResult)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$yrouter.replace({
|
||||||
|
path: "/pages/order/MyOrder/index",
|
||||||
|
query: {
|
||||||
|
type: 2,
|
||||||
|
query: this.buildOrderDetailQuery(orderId, drawTicketResult)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.show = !this.show
|
this.show = !this.show
|
||||||
},
|
},
|
||||||
showCouponsPopup() {
|
showCouponsPopup() {
|
||||||
|
if (this.isLotteryOrder()) return
|
||||||
if (this.couponList.usable.length === 0) return
|
if (this.couponList.usable.length === 0) return
|
||||||
this.show = !this.show
|
this.show = !this.show
|
||||||
},
|
},
|
||||||
// v9-2
|
// v9-2
|
||||||
changeCoupons(item) {
|
changeCoupons(item) {
|
||||||
|
if (this.isLotteryOrder()) return
|
||||||
if(!item) return
|
if(!item) return
|
||||||
if (this.couponList.usable.length === 0) return
|
if (this.couponList.usable.length === 0) return
|
||||||
this.show = !this.show
|
this.show = !this.show
|
||||||
@@ -1007,4 +1047,5 @@ export default {
|
|||||||
padding: 20rpx 0 0 0;
|
padding: 20rpx 0 0 0;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="payment-status">
|
|
||||||
<!--失败时: 用icon-iconfontguanbi fail替换icon-duihao2 bg-color-red-->
|
|
||||||
<view class="iconfont icon-duihao2 bg-color-red"></view>
|
|
||||||
<!-- 失败时:订单支付失败 -->
|
|
||||||
<view class="status">订单支付成功</view>
|
|
||||||
<view class="wrapper">
|
|
||||||
<view class="item acea-row row-between-wrapper">
|
|
||||||
<view>订单编号</view>
|
|
||||||
<view class="itemCom">wx3265361456134568</view>
|
|
||||||
</view>
|
|
||||||
<view class="item acea-row row-between-wrapper">
|
|
||||||
<view>下单时间</view>
|
|
||||||
<view class="itemCom">2019-01-09 18:05</view>
|
|
||||||
</view>
|
|
||||||
<view class="item acea-row row-between-wrapper">
|
|
||||||
<view>支付方式</view>
|
|
||||||
<view class="itemCom">微信支付</view>
|
|
||||||
</view>
|
|
||||||
<view class="item acea-row row-between-wrapper">
|
|
||||||
<view>支付金额</view>
|
|
||||||
<view class="itemCom">2222.00</view>
|
|
||||||
</view>
|
|
||||||
<!--失败时加上这个 -->
|
|
||||||
<!--<view class='item acea-row row-between-wrapper'>-->
|
|
||||||
<!--<view>失败原因</view>-->
|
|
||||||
<!--<view class='itemCom'>账户余额不足</view>-->
|
|
||||||
<!--</view>-->
|
|
||||||
</view>
|
|
||||||
<!--失败时: 重新购买 -->
|
|
||||||
<view class="returnBnt bg-color-red">返回查看订单</view>
|
|
||||||
<view class="returnBnt cart-color">返回首页</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
@@ -32,9 +32,9 @@
|
|||||||
<image :src="webUrl+'/20210806121714655368.png'" mode="" style="width: 36rpx;height: 36rpx;"></image>
|
<image :src="webUrl+'/20210806121714655368.png'" mode="" style="width: 36rpx;height: 36rpx;"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="couponListLimit2ToShow.length > 0 || attr.productSelect.earnPoints" class="v12-mt-1 v12-mb-1">
|
<view v-if="(!isCountyLotteryGoodsDetail() && couponListLimit2ToShow.length > 0) || attr.productSelect.earnPoints" class="v12-mt-1 v12-mb-1">
|
||||||
<view class="cell flex jc-between ai-center">
|
<view class="cell flex jc-between ai-center">
|
||||||
<view v-if="couponListLimit2ToShow.length > 0" class="v12-justify-start">
|
<view v-if="!isCountyLotteryGoodsDetail() && couponListLimit2ToShow.length > 0" class="v12-justify-start">
|
||||||
<view
|
<view
|
||||||
v-for="(item, index) in couponListLimit2ToShow"
|
v-for="(item, index) in couponListLimit2ToShow"
|
||||||
:key="index"
|
:key="index"
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view
|
<view
|
||||||
v-if="couponListLimit2ToShow.length > 0"
|
v-if="!isCountyLotteryGoodsDetail() && couponListLimit2ToShow.length > 0"
|
||||||
class="value value2 v12-font-24 v12-primary-text"
|
class="value value2 v12-font-24 v12-primary-text"
|
||||||
@click="changeCoupons()"
|
@click="changeCoupons()"
|
||||||
>
|
>
|
||||||
@@ -201,7 +201,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- v9 优惠券开始 -->
|
<!-- v9 优惠券开始 -->
|
||||||
<u-popup :show="show" :round="10" mode="bottom" closeOnClickOverlay @close="changeCoupons()">
|
<u-popup v-if="!isCountyLotteryGoodsDetail()" :show="show" :round="10" mode="bottom" closeOnClickOverlay @close="changeCoupons()">
|
||||||
<CouponsPopup
|
<CouponsPopup
|
||||||
:two-list="couponList"
|
:two-list="couponList"
|
||||||
@ok="setCoupon"
|
@ok="setCoupon"
|
||||||
@@ -309,7 +309,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- v6服务项目结束 -->
|
<!-- v6服务项目结束 -->
|
||||||
<view class="store-section goods-section" v-if="systemStore">
|
<view class="store-section goods-section" v-if="systemStore && appProductHideMerchant !== '1'">
|
||||||
<view class="flex jc-between ai-center">
|
<view class="flex jc-between ai-center">
|
||||||
<view class="title bold flex ai-center">
|
<view class="title bold flex ai-center">
|
||||||
<view>
|
<view>
|
||||||
@@ -493,6 +493,7 @@
|
|||||||
ref="attrWindow"
|
ref="attrWindow"
|
||||||
:attr="attr"
|
:attr="attr"
|
||||||
:cartNum="cart_num"
|
:cartNum="cart_num"
|
||||||
|
:hideQuantityControls="source === 'countyLottery' && Number(activityId) > 0"
|
||||||
@changeFun="changeFun"
|
@changeFun="changeFun"
|
||||||
:isNegotiable="storeInfo.isNegotiable === 1"
|
:isNegotiable="storeInfo.isNegotiable === 1"
|
||||||
@gift="gift"
|
@gift="gift"
|
||||||
@@ -539,7 +540,7 @@ import {
|
|||||||
getProductSkuBySelected
|
getProductSkuBySelected
|
||||||
} from '@/api/store'
|
} from '@/api/store'
|
||||||
import { userBindParent } from '@/api/user'
|
import { userBindParent } from '@/api/user'
|
||||||
import { handleQrCode, isWeixin } from '@/utils'
|
import { handleLoginFailure, handleQrCode, isWeixin } from '@/utils'
|
||||||
import { getHomeData } from '@/api/public'
|
import { getHomeData } from '@/api/public'
|
||||||
import {
|
import {
|
||||||
getDailyGoods,
|
getDailyGoods,
|
||||||
@@ -578,6 +579,7 @@ export default {
|
|||||||
mixins: [pageListenMixins],
|
mixins: [pageListenMixins],
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
|
appProductHideMerchant: '0',
|
||||||
isGift: false,
|
isGift: false,
|
||||||
giftBg: '',
|
giftBg: '',
|
||||||
// 商品信息是否展开
|
// 商品信息是否展开
|
||||||
@@ -654,7 +656,8 @@ export default {
|
|||||||
pageKeyId: '',
|
pageKeyId: '',
|
||||||
couponListLimit2ToShow: [],
|
couponListLimit2ToShow: [],
|
||||||
qualifications: [],
|
qualifications: [],
|
||||||
couponId: null
|
couponId: null,
|
||||||
|
submitActionLock: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: mapGetters(['isLogin', 'location', 'userInfo']),
|
computed: mapGetters(['isLogin', 'location', 'userInfo']),
|
||||||
@@ -730,6 +733,7 @@ export default {
|
|||||||
console.log("getLaunchOptionsSync", uni.getLaunchOptionsSync())
|
console.log("getLaunchOptionsSync", uni.getLaunchOptionsSync())
|
||||||
console.log("getEnterOptionsSync", uni.getEnterOptionsSync())
|
console.log("getEnterOptionsSync", uni.getEnterOptionsSync())
|
||||||
uni.removeStorageSync('couponId')
|
uni.removeStorageSync('couponId')
|
||||||
|
const pageQuery = Object.assign({}, this.resolvePageQuery(), options || {})
|
||||||
const from = options.from
|
const from = options.from
|
||||||
const id = options.id
|
const id = options.id
|
||||||
switch (from) {
|
switch (from) {
|
||||||
@@ -777,10 +781,10 @@ export default {
|
|||||||
if (url && url.productId) {
|
if (url && url.productId) {
|
||||||
this.id = url.productId
|
this.id = url.productId
|
||||||
} else if (options.id) {
|
} else if (options.id) {
|
||||||
this.id = options.id || null
|
this.id = pageQuery.id || options.id || null
|
||||||
this.partnerId = options.partnerId || null
|
this.partnerId = pageQuery.partnerId || options.partnerId || null
|
||||||
this.activityId = this._route.query.activityId
|
this.activityId = Number(pageQuery.activityId || pageQuery.drawActivityId || 0)
|
||||||
this.source = this._route.query.from || ''
|
this.source = pageQuery.from || ''
|
||||||
} else {
|
} else {
|
||||||
const obj = uni.getEnterOptionsSync()
|
const obj = uni.getEnterOptionsSync()
|
||||||
if (options.scene != null || obj.query.scene != null) {
|
if (options.scene != null || obj.query.scene != null) {
|
||||||
@@ -820,6 +824,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
this.submitActionLock = false
|
||||||
this.getMapData()
|
this.getMapData()
|
||||||
getGiftCardSendBackground().then(res => {
|
getGiftCardSendBackground().then(res => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
@@ -844,6 +849,18 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
resolvePageQuery() {
|
||||||
|
if (this.$yroute && this.$yroute.query) {
|
||||||
|
return this.$yroute.query
|
||||||
|
}
|
||||||
|
if (this.$route && this.$route.query) {
|
||||||
|
return this.$route.query
|
||||||
|
}
|
||||||
|
if (this._route && this._route.query) {
|
||||||
|
return this._route.query
|
||||||
|
}
|
||||||
|
return {}
|
||||||
|
},
|
||||||
gift() {
|
gift() {
|
||||||
this.goCat(2)
|
this.goCat(2)
|
||||||
},
|
},
|
||||||
@@ -875,14 +892,23 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
goRoom() {
|
goRoom() {
|
||||||
console.log(this.storeInfo);
|
if (!this.isLogin) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请先登录后联系客服',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
handleLoginFailure()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
console.log(this.attr);
|
||||||
const params = {
|
const params = {
|
||||||
goodsId: this.id,
|
goodsId: this.id,
|
||||||
goodsName: this.attr.productSelect.store_name,
|
goodsName: this.attr.productSelect.store_name,
|
||||||
skuStr: this.attrValue,
|
skuStr: this.attrValue,
|
||||||
price: this.attr.productSelect.price,
|
price: this.attr.productSelect.price,
|
||||||
seckillId: this.activityId,
|
seckillId: this.activityId,
|
||||||
cover: this.attr.productSelect.image,
|
cover: this.attr.productSelect.image || this.storeInfo.image,
|
||||||
goodsData: '',
|
goodsData: '',
|
||||||
seckillData: '',
|
seckillData: '',
|
||||||
isNegotiable: this.storeInfo.isNegotiable
|
isNegotiable: this.storeInfo.isNegotiable
|
||||||
@@ -1070,12 +1096,12 @@ export default {
|
|||||||
},
|
},
|
||||||
goStoreList() {
|
goStoreList() {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: '/pages/shop/StoreList/index'
|
path: '/pagesShop/shop/StoreList/index'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goEvaluateList(id) {
|
goEvaluateList(id) {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: '/pages/shop/EvaluateList/index',
|
path: '/pagesShop/shop/EvaluateList/index',
|
||||||
query: {
|
query: {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
@@ -1185,6 +1211,7 @@ export default {
|
|||||||
this.posterData.price = this.storeInfo.price
|
this.posterData.price = this.storeInfo.price
|
||||||
this.posterData.code = this.storeInfo.codeBase
|
this.posterData.code = this.storeInfo.codeBase
|
||||||
this.systemStore = data.systemStore
|
this.systemStore = data.systemStore
|
||||||
|
this.appProductHideMerchant = data.appProductHideMerchant
|
||||||
const good_list = data.goodList || []
|
const good_list = data.goodList || []
|
||||||
const goodArray = []
|
const goodArray = []
|
||||||
const count = Math.ceil(good_list.length / 6)
|
const count = Math.ceil(good_list.length / 6)
|
||||||
@@ -1251,7 +1278,7 @@ export default {
|
|||||||
'store_name',
|
'store_name',
|
||||||
this.storeInfo.storeName
|
this.storeInfo.storeName
|
||||||
)
|
)
|
||||||
this.$set(this.attr.productSelect, 'image', productSelect.image)
|
this.$set(this.attr.productSelect, 'image', productSelect.image || this.storeInfo.image)
|
||||||
this.$set(this.attr.productSelect, 'price', productSelect.price)
|
this.$set(this.attr.productSelect, 'price', productSelect.price)
|
||||||
this.$set(this.attr.productSelect, 'otPrice', productSelect.otPrice)
|
this.$set(this.attr.productSelect, 'otPrice', productSelect.otPrice)
|
||||||
this.$set(this.attr.productSelect, 'stock', productSelect.stock)
|
this.$set(this.attr.productSelect, 'stock', productSelect.stock)
|
||||||
@@ -1378,7 +1405,7 @@ export default {
|
|||||||
subItem.check = true
|
subItem.check = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.$set(this.attr.productSelect, 'image', productSelect.image)
|
this.$set(this.attr.productSelect, 'image', productSelect.image || this.storeInfo.image)
|
||||||
this.$set(this.attr.productSelect, 'price', productSelect.price)
|
this.$set(this.attr.productSelect, 'price', productSelect.price)
|
||||||
this.$set(this.attr.productSelect, 'otPrice', productSelect.otPrice)
|
this.$set(this.attr.productSelect, 'otPrice', productSelect.otPrice)
|
||||||
this.$set(this.attr.productSelect, 'stock', productSelect.stock)
|
this.$set(this.attr.productSelect, 'stock', productSelect.stock)
|
||||||
@@ -1495,28 +1522,55 @@ export default {
|
|||||||
case "day":
|
case "day":
|
||||||
q.dailyGoodsId = Number(this.activityId)
|
q.dailyGoodsId = Number(this.activityId)
|
||||||
break
|
break
|
||||||
|
case "countyLottery":
|
||||||
|
q.drawActivityId = Number(this.activityId || 0)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
if (that.submitActionLock) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
that.submitActionLock = true
|
||||||
postCartAdd(q).then(function (res) {
|
postCartAdd(q).then(function (res) {
|
||||||
that.isOpen = false
|
that.isOpen = false
|
||||||
that.attr.cartAttr = false
|
that.attr.cartAttr = false
|
||||||
if (news === 1) {
|
if (news === 1) {
|
||||||
that.$yrouter.push({
|
const orderQuery = {
|
||||||
path: "/pages/order/OrderSubmission/index",
|
|
||||||
query: {
|
|
||||||
id: res.data.cartId,
|
id: res.data.cartId,
|
||||||
discount: that.storeInfo.discount,
|
discount: that.storeInfo.discount,
|
||||||
}
|
}
|
||||||
|
if (that.source === 'countyLottery') {
|
||||||
|
orderQuery.from = 'countyLottery'
|
||||||
|
orderQuery.drawActivityId = Number(that.activityId || 0)
|
||||||
|
}
|
||||||
|
that.$yrouter.push({
|
||||||
|
path: "/pages/order/OrderSubmission/index",
|
||||||
|
query: orderQuery
|
||||||
})
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
that.submitActionLock = false
|
||||||
|
}, 1500)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(news === 2) {
|
if(news === 2) {
|
||||||
const coupId = that.couponId ? that.couponId : (that.couponList.usable[0] && that.couponList.usable[0].id || '')
|
const coupId = that.couponId ? that.couponId : (that.couponList.usable[0] && that.couponList.usable[0].id || '')
|
||||||
|
let giftUrl = '/pkg_user/views/gift/gift?cartId=' + res.data.cartId
|
||||||
|
if (that.storeInfo.discount) {
|
||||||
|
giftUrl += '&discount=' + that.storeInfo.discount
|
||||||
|
}
|
||||||
|
if (that.source === 'countyLottery') {
|
||||||
|
giftUrl += '&from=countyLottery'
|
||||||
|
giftUrl += '&drawActivityId=' + Number(that.activityId || 0)
|
||||||
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
// + '&couponId=' + coupId
|
// + '&couponId=' + coupId
|
||||||
url: '/pkg_user/views/gift/gift?cartId=' + res.data.cartId + (that.storeInfo.discount ? '&discount=' + that.storeInfo.discount : '')
|
url: giftUrl
|
||||||
})
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
that.submitActionLock = false
|
||||||
|
}, 1500)
|
||||||
}
|
}
|
||||||
if(news === 0) {
|
if(news === 0) {
|
||||||
|
that.submitActionLock = false
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "添加购物车成功",
|
title: "添加购物车成功",
|
||||||
icon: "success",
|
icon: "success",
|
||||||
@@ -1529,6 +1583,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
that.isOpen = false;
|
that.isOpen = false;
|
||||||
|
that.submitActionLock = false
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: error.msg,
|
title: error.msg,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
@@ -1564,11 +1619,16 @@ export default {
|
|||||||
listenerActionClose() {
|
listenerActionClose() {
|
||||||
this.posters = false
|
this.posters = false
|
||||||
},
|
},
|
||||||
|
isCountyLotteryGoodsDetail() {
|
||||||
|
return this.source === 'countyLottery' && Number(this.activityId || 0) > 0
|
||||||
|
},
|
||||||
// v9-2
|
// v9-2
|
||||||
changeCoupons(e) {
|
changeCoupons(e) {
|
||||||
|
if (this.isCountyLotteryGoodsDetail()) return
|
||||||
this.show = !this.show
|
this.show = !this.show
|
||||||
},
|
},
|
||||||
setCoupon(couponId) {
|
setCoupon(couponId) {
|
||||||
|
if (this.isCountyLotteryGoodsDetail()) return
|
||||||
this.couponId = couponId
|
this.couponId = couponId
|
||||||
},
|
},
|
||||||
async checkFavorite() {
|
async checkFavorite() {
|
||||||
@@ -1874,7 +1934,8 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.btn-buy-disabled {
|
.btn-buy-disabled {
|
||||||
background: #9D9D9D;
|
background: #9D9D9D !important;
|
||||||
|
color: #FFFFFF !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2102,6 +2163,7 @@ export default {
|
|||||||
.product-con .footer{
|
.product-con .footer{
|
||||||
height: 140rpx !important;
|
height: 140rpx !important;
|
||||||
padding-bottom: 20rpx;
|
padding-bottom: 20rpx;
|
||||||
|
// z-index: 1002 !important;
|
||||||
}
|
}
|
||||||
.product-con .product-intro .conter view {
|
.product-con .product-intro .conter view {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="my-hdeader-bottom">
|
<view class="my-hdeader-bottom">
|
||||||
<view class="item" @click="linkTo('/pages/user/UserBill/index')">
|
<view class="item" @click="linkTo('/pagesUser/user/UserBill/index')">
|
||||||
<view v-if="!isNoLogin" class="number">
|
<view v-if="!isNoLogin" class="number">
|
||||||
{{ userInfo.nowMoney ? force2Decimal(userInfo.nowMoney) : 0.00 }}
|
{{ userInfo.nowMoney ? force2Decimal(userInfo.nowMoney) : 0.00 }}
|
||||||
</view>
|
</view>
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
余额
|
余额
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item" @click="linkTo('/pages/user/Points/index')">
|
<view class="item" @click="linkTo('/pagesUser/user/Points/index')">
|
||||||
<view v-if="!isNoLogin" class="number">
|
<view v-if="!isNoLogin" class="number">
|
||||||
{{ userInfo.integral || 0 }}
|
{{ userInfo.integral || 0 }}
|
||||||
</view>
|
</view>
|
||||||
@@ -215,6 +215,16 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view
|
||||||
|
v-if="(store.getters.token || userInfo.uid) &&
|
||||||
|
drawConfig.myTicketImageEnable === 1 &&
|
||||||
|
drawConfig.myTicketImage
|
||||||
|
"
|
||||||
|
class="my-ticket-entry"
|
||||||
|
@click="goMyTicketList"
|
||||||
|
>
|
||||||
|
<image :src="drawConfig.myTicketImage" mode="widthFix" class="img" />
|
||||||
|
</view>
|
||||||
<!-- 我的服务开始 -->
|
<!-- 我的服务开始 -->
|
||||||
<view class="myService" style="margin-top: 30rpx !important;">
|
<view class="myService" style="margin-top: 30rpx !important;">
|
||||||
<view class="title acea-row row-middle">
|
<view class="title acea-row row-middle">
|
||||||
@@ -301,6 +311,7 @@ import {
|
|||||||
noticeList,
|
noticeList,
|
||||||
getUserCenterBanner
|
getUserCenterBanner
|
||||||
} from "@/api/user"
|
} from "@/api/user"
|
||||||
|
import { getDrawConfig } from '@/api/lottery'
|
||||||
import {isWeixin} from "@/utils"
|
import {isWeixin} from "@/utils"
|
||||||
import cookie from "@/utils/store/cookie"
|
import cookie from "@/utils/store/cookie"
|
||||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||||
@@ -364,7 +375,7 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '账户明细',
|
text: '账户明细',
|
||||||
url: '/pages/user/UserBill/index',
|
url: '/pagesUser/user/UserBill/index',
|
||||||
icon: '/icon/icon-coin.png',
|
icon: '/icon/icon-coin.png',
|
||||||
allowEnter: true
|
allowEnter: true
|
||||||
},
|
},
|
||||||
@@ -376,19 +387,23 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '团队管理',
|
text: '团队管理',
|
||||||
url: '/pages/user/promotion/UserPromotion/index',
|
url: '/pagesUser/user/promotion/UserPromotion/index',
|
||||||
icon: '/icon/icon-users.png',
|
icon: '/icon/icon-users.png',
|
||||||
allowEnter: true
|
allowEnter: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '商品足迹',
|
text: '商品足迹',
|
||||||
url: '/pages/user/History/index',
|
url: '/pagesUser/user/History/index',
|
||||||
icon: '/icon/icon-help.png',
|
icon: '/icon/icon-help.png',
|
||||||
allowEnter: true
|
allowEnter: true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
bannerBgUrl: '',
|
bannerBgUrl: '',
|
||||||
userCenterBannerUrl: '',
|
userCenterBannerUrl: '',
|
||||||
|
drawConfig: {
|
||||||
|
myTicketImage: '',
|
||||||
|
myTicketImageEnable: 0
|
||||||
|
},
|
||||||
pageKeyId: Object.freeze('userIndex'),
|
pageKeyId: Object.freeze('userIndex'),
|
||||||
nowrap: true,
|
nowrap: true,
|
||||||
// 是否已登录
|
// 是否已登录
|
||||||
@@ -413,6 +428,7 @@ export default {
|
|||||||
this.getUserLevelInfoReq()
|
this.getUserLevelInfoReq()
|
||||||
this.isWeixin = isWeixin()
|
this.isWeixin = isWeixin()
|
||||||
// this.getUnreadMsgList()
|
// this.getUnreadMsgList()
|
||||||
|
this.getDrawConfigReq()
|
||||||
} else {
|
} else {
|
||||||
this.isNoLogin = true
|
this.isNoLogin = true
|
||||||
/*
|
/*
|
||||||
@@ -429,6 +445,19 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['updateAuthorizationPage']),
|
...mapMutations(['updateAuthorizationPage']),
|
||||||
|
getDrawConfigReq() {
|
||||||
|
getDrawConfig().then(res => {
|
||||||
|
if (res && res.data) {
|
||||||
|
this.drawConfig = {
|
||||||
|
myTicketImage: res.data.myTicketImage || '',
|
||||||
|
myTicketImageEnable: Number(res.data.myTicketImageEnable) || 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
goMyTicketList() {
|
||||||
|
this.linkTo('/pkg-video/views/county-my-tickets')
|
||||||
|
},
|
||||||
// 新增方法:计算文本像素长度
|
// 新增方法:计算文本像素长度
|
||||||
getTextWidth() {
|
getTextWidth() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
@@ -486,7 +515,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
goReturnList() {
|
goReturnList() {
|
||||||
this.$yrouter.push('/pages/order/ReturnList/index')
|
this.$yrouter.push('/pagesOrder/order/ReturnList/index')
|
||||||
},
|
},
|
||||||
goMyOrder(type) {
|
goMyOrder(type) {
|
||||||
if (this.isNoLogin) {
|
if (this.isNoLogin) {
|
||||||
@@ -509,7 +538,7 @@ export default {
|
|||||||
},
|
},
|
||||||
goUserAccount() {
|
goUserAccount() {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: '/pages/user/UserAccount/index'
|
path: '/pagesUser/user/UserAccount/index'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goPersonalData() {
|
goPersonalData() {
|
||||||
@@ -681,6 +710,14 @@ export default {
|
|||||||
}
|
}
|
||||||
.my-wrapper {
|
.my-wrapper {
|
||||||
padding: 30upx;
|
padding: 30upx;
|
||||||
|
.my-ticket-entry {
|
||||||
|
margin-top: 30rpx;
|
||||||
|
.img {
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
&.wrapper {
|
&.wrapper {
|
||||||
padding: 0 0 30rpx 0 !important;
|
padding: 0 0 30rpx 0 !important;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -219,7 +219,6 @@ import CitySelect from "@/components/CitySelect";
|
|||||||
import tmUpload from '@/components/tm-upload/tm-upload.vue';
|
import tmUpload from '@/components/tm-upload/tm-upload.vue';
|
||||||
import {getCity} from "@/api/user";
|
import {getCity} from "@/api/user";
|
||||||
import {chooseImage, isWeixin} from "@/utils";
|
import {chooseImage, isWeixin} from "@/utils";
|
||||||
import {getHomeData} from "@/api/public";
|
|
||||||
import {VUE_APP_API_URL} from "@/config"
|
import {VUE_APP_API_URL} from "@/config"
|
||||||
import {getHotelTypeList, postHotelApply, postHotelReApply} from "@/api/inn.js";
|
import {getHotelTypeList, postHotelApply, postHotelReApply} from "@/api/inn.js";
|
||||||
|
|
||||||
@@ -440,81 +439,7 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getIndex(value, arr) {
|
submit() {
|
||||||
var idx = -1;
|
|
||||||
for (var i = 0; i < arr.length; i++) {
|
|
||||||
if (arr[i].n == value) {
|
|
||||||
idx = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return idx;
|
|
||||||
},
|
|
||||||
getCityList: function () {
|
|
||||||
let that = this;
|
|
||||||
getCity()
|
|
||||||
.then(res => {
|
|
||||||
that.district = res.data;
|
|
||||||
// that.ready = true;
|
|
||||||
|
|
||||||
// if(this.id){
|
|
||||||
// //设置city_id
|
|
||||||
// var pIdx = that.getIndex(that.address.province,that.district);
|
|
||||||
// if(pIdx>-1){
|
|
||||||
// var citys = that.district[pIdx].c;
|
|
||||||
// var cIdx = that.getIndex(that.address.city,citys);
|
|
||||||
// if(cIdx>-1){
|
|
||||||
// var city = citys[cIdx];
|
|
||||||
// that.address.city_id = city.v;
|
|
||||||
// console.log('city_id:'+city.v);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
that.$dialog.error(err.msg);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
chooseQrcodeImg: function () {
|
|
||||||
chooseImage(img => {
|
|
||||||
console.log(img)
|
|
||||||
that.$set(that.innApplyInfo, 'qrcode', img);
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
|
||||||
chooseLogoImg: function () {
|
|
||||||
chooseImage(img => {
|
|
||||||
console.log(img)
|
|
||||||
|
|
||||||
that.innApplyInfo.logo = img;
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
|
||||||
chooseCoverImg: function () {
|
|
||||||
chooseImage(img => {
|
|
||||||
console.log(img)
|
|
||||||
|
|
||||||
that.innApplyInfo.cover = img;
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//文件上传结果
|
|
||||||
uploadedImgChange: function (uploadedFilesList) {
|
|
||||||
this.uploadedFilesArray = uploadedFilesList;
|
|
||||||
},
|
|
||||||
submit: function () {
|
|
||||||
|
|
||||||
if (this.innApplyInfo.name.length == 0) {
|
|
||||||
this.$dialog.error("请输入店铺名称");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.innApplyInfo.type.length == 0) {
|
|
||||||
this.$dialog.error("请选择店铺类型");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.addressText.length == 0) {
|
if (this.addressText.length == 0) {
|
||||||
this.$dialog.error("请选择店铺所在省市区");
|
this.$dialog.error("请选择店铺所在省市区");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -588,7 +588,8 @@ export default {
|
|||||||
pageKeyId: '',
|
pageKeyId: '',
|
||||||
shareImg: '',
|
shareImg: '',
|
||||||
videoPlayers: [],
|
videoPlayers: [],
|
||||||
isView: false
|
isView: false,
|
||||||
|
skipRefreshOnShow: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 必须在页面加 onPageScroll(e){} ,才能滑动显示背景
|
// 必须在页面加 onPageScroll(e){} ,才能滑动显示背景
|
||||||
@@ -679,6 +680,10 @@ export default {
|
|||||||
if (!this.isLoad) {
|
if (!this.isLoad) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (this.skipRefreshOnShow) {
|
||||||
|
this.skipRefreshOnShow = false
|
||||||
|
return
|
||||||
|
}
|
||||||
this.fetchInnDetail()
|
this.fetchInnDetail()
|
||||||
if(this.isView) return
|
if(this.isView) return
|
||||||
if(this.activeIndex === 1) {
|
if(this.activeIndex === 1) {
|
||||||
@@ -834,6 +839,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
infoClick: function (info) {
|
infoClick: function (info) {
|
||||||
|
this.skipRefreshOnShow = true
|
||||||
this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id)
|
this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id)
|
||||||
},
|
},
|
||||||
coverPlay(){
|
coverPlay(){
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -76,7 +76,7 @@ export default {
|
|||||||
},
|
},
|
||||||
goOrderDetails(order) {
|
goOrderDetails(order) {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/order/OrderDetails/index",
|
path: "/pagesOrder/order/OrderDetails/index",
|
||||||
query: {id: order.orderId}
|
query: {id: order.orderId}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -39,6 +39,9 @@
|
|||||||
:src="historyItem.image"
|
:src="historyItem.image"
|
||||||
mode="scaleToFill"
|
mode="scaleToFill"
|
||||||
/>
|
/>
|
||||||
|
<view v-if="isInvalidItem(historyItem)" class="invalid-mask">
|
||||||
|
<text class="invalid-mask-text">商品已下架</text>
|
||||||
|
</view>
|
||||||
<view class="good-info">
|
<view class="good-info">
|
||||||
<view
|
<view
|
||||||
v-if="historyItem.couponName"
|
v-if="historyItem.couponName"
|
||||||
@@ -179,6 +182,13 @@ export default {
|
|||||||
return str.replace(regx, '')
|
return str.replace(regx, '')
|
||||||
},
|
},
|
||||||
goodsDetail (item) {
|
goodsDetail (item) {
|
||||||
|
if (this.isInvalidItem(item)) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '商品已下架',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: '/pages/shop/GoodsCon/index',
|
path: '/pages/shop/GoodsCon/index',
|
||||||
query: {
|
query: {
|
||||||
@@ -186,6 +196,11 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
isInvalidItem(item) {
|
||||||
|
if (!item) return false
|
||||||
|
if (item.isInvalid === true || item.isInvalid === 'true') return true
|
||||||
|
return Number(item.isInvalid) === 1
|
||||||
|
},
|
||||||
deleteHistoryItem(historyItem) {
|
deleteHistoryItem(historyItem) {
|
||||||
const id = historyItem.id
|
const id = historyItem.id
|
||||||
if (!id) return
|
if (!id) return
|
||||||
@@ -276,6 +291,26 @@ export default {
|
|||||||
width: 226rpx;
|
width: 226rpx;
|
||||||
height: 226rpx;
|
height: 226rpx;
|
||||||
}
|
}
|
||||||
|
.invalid-mask{
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(0, 0, 0, 0.45);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
z-index: 1;
|
||||||
|
.invalid-mask-text{
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24rpx;
|
||||||
|
padding: 8rpx 16rpx;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.7);
|
||||||
|
border-radius: 24rpx;
|
||||||
|
background: rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
}
|
||||||
.good-info {
|
.good-info {
|
||||||
padding: 12rpx 12rpx 20rpx 12rpx;
|
padding: 12rpx 12rpx 20rpx 12rpx;
|
||||||
.price {
|
.price {
|
||||||
@@ -97,13 +97,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
dataFormat,
|
dataFormat,
|
||||||
toDetail(mid){
|
toDetail(mid){
|
||||||
this.$yrouter.push('/pages/user/MessageDetail/MessageDetail?id='+mid);
|
this.$yrouter.push('/pagesUser/user/MessageDetail/MessageDetail?id='+mid);
|
||||||
// this.$yrouter.push({
|
|
||||||
// path: "/pages/user/MessageDetail/MessageDetail",
|
|
||||||
// query: {
|
|
||||||
// id:mid
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad:function(e){
|
onLoad:function(e){
|
||||||
@@ -198,7 +198,7 @@ export default {
|
|||||||
},
|
},
|
||||||
goOrderDetails(order) {
|
goOrderDetails(order) {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: '/pages/order/OrderDetails/index',
|
path: '/pagesOrder/order/OrderDetails/index',
|
||||||
query: {
|
query: {
|
||||||
id: order.orderId
|
id: order.orderId
|
||||||
}
|
}
|
||||||
+1
-1
@@ -129,7 +129,7 @@ export default {
|
|||||||
//显示协议内容
|
//显示协议内容
|
||||||
toggleProtocolPage() {
|
toggleProtocolPage() {
|
||||||
//this.$refs.popup.open();
|
//this.$refs.popup.open();
|
||||||
this.$yrouter.push('/pages/user/UpgradeProtocolDetail/UpgradeProtocolDetail')
|
this.$yrouter.push('/pagesUser/user/UpgradeProtocolDetail/UpgradeProtocolDetail')
|
||||||
|
|
||||||
},
|
},
|
||||||
chooseIdCardFrontImage() {
|
chooseIdCardFrontImage() {
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
<view style="color: #fff;">总资产(元)</view>
|
<view style="color: #fff;">总资产(元)</view>
|
||||||
<view class="money">{{ now_money }}</view>
|
<view class="money">{{ now_money }}</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <navigator url="/pages/user/Recharge/index" class="recharge font-color-red">充值</navigator> -->
|
<!-- <navigator url="/pagesUser/user/Recharge/index" class="recharge font-color-red">充值</navigator> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="cumulative acea-row row-top">
|
<view class="cumulative acea-row row-top">
|
||||||
<view class="item">
|
<view class="item">
|
||||||
@@ -66,7 +66,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
goUserBill(types) {
|
goUserBill(types) {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/user/UserBill/index",
|
path: "/pagesUser/user/UserBill/index",
|
||||||
query: { types }
|
query: { types }
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
-1
@@ -26,7 +26,6 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
goUserPromotion() {
|
goUserPromotion() {
|
||||||
this.$yrouter.back();
|
this.$yrouter.back();
|
||||||
// this.$yrouter.push({ path: "/pages/user/promotion/UserPromotion/index" });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
+2
-2
@@ -23,7 +23,7 @@
|
|||||||
<view class="item acea-row row-between-wrapper">
|
<view class="item acea-row row-between-wrapper">
|
||||||
<view class="name">提现</view>
|
<view class="name">提现</view>
|
||||||
<view class="input">
|
<view class="input">
|
||||||
<input :placeholder="'最低提现金额' + minPrice" v-model="post.money" />
|
<input v-model="post.money" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="tip">当前可提现金额: {{ commissionCount }}</view>
|
<view class="tip">当前可提现金额: {{ commissionCount }}</view>
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
<view class="item acea-row row-between-wrapper">
|
<view class="item acea-row row-between-wrapper">
|
||||||
<view class="name">提现</view>
|
<view class="name">提现</view>
|
||||||
<view class="input">
|
<view class="input">
|
||||||
<input :placeholder="'最低提现金额' + minPrice" v-model="post.money" />
|
<input placeholder="请输入提现金额" v-model="post.money" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="tip">当前可提现金额: {{ commissionCount }}</view>
|
<view class="tip">当前可提现金额: {{ commissionCount }}</view>
|
||||||
+4
-4
@@ -127,19 +127,19 @@ export default {
|
|||||||
return this.$force2Decimal(v);
|
return this.$force2Decimal(v);
|
||||||
},
|
},
|
||||||
goPoster() {
|
goPoster() {
|
||||||
this.$yrouter.push("/pages/user/promotion/Poster/index");
|
this.$yrouter.push("/pagesUser/user/promotion/Poster/index");
|
||||||
},
|
},
|
||||||
goCashRecord() {
|
goCashRecord() {
|
||||||
this.$yrouter.push('/pkg_user/views/withdrawalLog');
|
this.$yrouter.push('/pkg_user/views/withdrawalLog');
|
||||||
},
|
},
|
||||||
goPromoterList() {
|
goPromoterList() {
|
||||||
this.$yrouter.push("/pages/user/promotion/PromoterList/index");
|
this.$yrouter.push("/pagesUser/user/promotion/PromoterList/index");
|
||||||
},
|
},
|
||||||
goCommissionDetails() {
|
goCommissionDetails() {
|
||||||
this.$yrouter.push("/pages/user/promotion/CommissionDetails/index");
|
this.$yrouter.push("/pagesUser/user/promotion/CommissionDetails/index");
|
||||||
},
|
},
|
||||||
goPromoterOrder() {
|
goPromoterOrder() {
|
||||||
this.$yrouter.push("/pages/user/promotion/PromoterOrder/index");
|
this.$yrouter.push("/pagesUser/user/promotion/PromoterOrder/index");
|
||||||
},
|
},
|
||||||
getInfo: function() {
|
getInfo: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
@@ -1,924 +0,0 @@
|
|||||||
{
|
|
||||||
"easycom": {
|
|
||||||
"^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue"
|
|
||||||
},
|
|
||||||
"pages": [
|
|
||||||
{
|
|
||||||
"path": "pages/Loading/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "香道滇",
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/authorization/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "微信授权"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/Login/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "登录"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/RetrievePassword/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "重置密码"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/home/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "香道滇",
|
|
||||||
"navigationStyle": "custom",
|
|
||||||
"navigationBarTextStyle": "white"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "components/chose-city/chose-city",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "选择城市"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/foodInfomation/information",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "彩云资讯"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/foodInfomation/foodInfomation",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "美食攻略",
|
|
||||||
"navigationStyle": "custom",
|
|
||||||
"navigationBarTextStyle": "white",
|
|
||||||
"enablePullDownRefresh": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/foodInfomation/foodInfomationDetail",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "资讯详情",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/shop/GoodSearch/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "搜索商品"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/shop/GoodsClass/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "分类",
|
|
||||||
"navigationStyle": "custom",
|
|
||||||
"navigationBarTextStyle": "white"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/shop/ShoppingCart/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "购物车",
|
|
||||||
"navigationStyle": "custom",
|
|
||||||
"navigationBarTextStyle": "white"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/shop/StoreList/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商家列表"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/shop/GoodsList/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商品列表"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/NotDefined/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "404"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// "path": "pages/cloud/cloud",
|
|
||||||
// "style": {
|
|
||||||
// "navigationBarTitleText": "七彩云上"
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
"path": "pages/cloud/haveFun",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "寻趣味",
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/User/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "我的",
|
|
||||||
"navigationStyle": "custom",
|
|
||||||
"navigationBarTextStyle": "white"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/shop/GoodsCollection/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商品收藏"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/shop/EvaluateList/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "评价列表"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/shop/GoodsEvaluate/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商品评价"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/shop/GoodsPromotion/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "促销商品"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/shop/HotNewGoods/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "热门商品"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/shop/GoodsCon/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商品详情",
|
|
||||||
"navigationStyle": "custom",
|
|
||||||
"navigationBarTextStyle": "white"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/address/AddAddress/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "新增收货地址"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/UserAccount/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "账户余额"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/address/AddressManagement/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "收货地址"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/Poster/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "推广名片"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/signIn/Sign/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "签到"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/signIn/SignRecord/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "签到记录"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/CashAudit/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "提现结果"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/PromoterOrder/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "分销详情"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/PromoterList/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "分销列表",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/UserPromotion/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "团队管理",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/UserBill/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "账单记录"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/CashRecord/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "提现记录"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/CommissionDetails/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "佣金明细"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/signIn/Integral/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "我的积分"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/UserVip/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "用户vip"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/coupon/UserCoupon/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "优惠券"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/coupon/GetCoupon/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "领取优惠券"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/UserCash/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "提现"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/CustomerList/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "客服列表"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/Recharge/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "充值"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/order/MyOrder/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "我的订单",
|
|
||||||
"navigationBarBackgroundColor": "#fff"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/order/Logistics/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "查看物流"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/order/OrderDetails/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "订单详情"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/order/OrderSubmission/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "提交订单",
|
|
||||||
"navigationBarBackgroundColor": "#fff"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/order/PaymentStatus/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "支付状态"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/order/GoodsReturn/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商品退货"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/order/ReturnList/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "退货列表"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/orderAdmin/OrderIndex/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商家订单统计"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/orderAdmin/AdminOrderList/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "订单"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/orderAdmin/GoodsDeliver/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "发货"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/orderAdmin/AdminOrder/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商家订单列表"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/orderAdmin/Statistics/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商家统计数据"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/orderAdmin/OrderCancellation/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商家取消订单"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/activity/Poster/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "推广海报"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/activity/DargainDetails/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "帮砍价"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/activity/GoodsBargain/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "砍价列表"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/activity/BargainRecord/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "砍价记录"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/activity/GoodsGroup/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "团购商品列表"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/activity/GroupDetails/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "团购商品详情"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/activity/GroupRule/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "团购规则"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/activity/GoodsSeckill/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "秒杀"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/activity/SeckillDetails/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "秒杀详情"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/map/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "地图"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/Message/Message",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "消息",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/MessageDetail/MessageDetail",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "消息详情",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/MemberUpgradeIntro/MemberUpgradeIntro",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "升级说明",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/VideoPlayBackList/VideoPlayBackList",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "寻看点",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/VideoPlayBackList/VideoPlayBackDetail",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "视频详情",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/UpgradeElectronicProtocol/UpgradeElectronicProtocol",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "升级",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/UpgradeProtocolDetail/UpgradeProtocolDetail",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "共享股东协议"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/LiveAndShortVideo/LiveAndShortVideo",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "直播/视频"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/LiveBroadcastList/LiveBroadcastList",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "直播列表"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/UserFavorite/UserFavorite",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "我的喜欢"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"subPackages": [
|
|
||||||
{
|
|
||||||
"root": "pagesInn",
|
|
||||||
"pages": [
|
|
||||||
{
|
|
||||||
"path": "inn/innHome",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "",
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "inn/innApply",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "店铺申请"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "inn/innInfoPublish",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "发布店铺动态"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "inn/innProfileEdit",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "修改店铺资料"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "inn/innInfoDetail",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "资讯详情"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "inn/innPartnerAgreement",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "店主合伙人条款协议"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"root": "pkg_common",
|
|
||||||
"pages": [
|
|
||||||
{
|
|
||||||
"path": "views/pdf",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "详情"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/room",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "客服"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/roomLogs",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "历史会话"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/xiaoZhi",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"root": "pkg_join",
|
|
||||||
"pages": [
|
|
||||||
{
|
|
||||||
"path": "views/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商户入驻"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/shop",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "店铺入驻"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/supplier",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "供应商入驻"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/wholesaler",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "采购批发商入驻"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"root": "pkg_orders",
|
|
||||||
"pages": [
|
|
||||||
{
|
|
||||||
"path": "views/refund",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "申请退款"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"root": "pkg_product",
|
|
||||||
"pages": [
|
|
||||||
{
|
|
||||||
"path": "views/healthList",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "康养 · 食材"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/giftList",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "特色礼品",
|
|
||||||
"onReachBottomDistance": 100
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/landMark",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "地标好物"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/famousList",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "千县名品"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/famousStory",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "名品故事"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/famousHot",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "爆款主推"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/scenicSpot",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "景点门票"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/seckill",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "天天秒杀"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/sharpList",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "尖货推荐"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/nativeList",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "特产",
|
|
||||||
"navigationBarTextStyle": "white",
|
|
||||||
"navigationBarBackgroundColor": "#FF564A"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/seasonList",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "时令尝鲜"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/season",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "时令尝鲜"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"root": "pkg_user",
|
|
||||||
"pages": [
|
|
||||||
{
|
|
||||||
"path": "views/bankCardList",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "银行卡列表",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/addBankCard",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "添加银行卡",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/withdrawal",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "提现",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/personalData",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "个人资料"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/bindPhone",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "绑定手机号"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/payPassword",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "修改支付密码"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"root": "v4",
|
|
||||||
"pages": [
|
|
||||||
{
|
|
||||||
"path": "views/preSale/preSale",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "预售"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/seckill/seckill",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "限时秒杀"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/offer/offer",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "每天特价"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "components/select-city",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/specialty/specialty",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "特产",
|
|
||||||
"enablePullDownRefresh": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/shop/shop",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "店铺"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/shop/detail",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "店铺详情"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/trial/trial",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "体验店"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/live/live",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "直播"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/attract/attract",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "招商"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/attract/project",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "招商项目"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/attract/projectList",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "招商项目"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/luck/luck",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "幸运抽奖"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/luck/logs",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "抽奖记录"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/luck/receive",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "选择收货地址"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"root": "wenwan",
|
|
||||||
"pages": [
|
|
||||||
{
|
|
||||||
"path": "views/goodsClass",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "文玩"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/store",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "文玩店铺详情",
|
|
||||||
"navigationStyle": "custom",
|
|
||||||
"navigationBarTextStyle": "white"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "views/storeList",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "文玩"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"preloadRule": {
|
|
||||||
"pages/user/User/index": {
|
|
||||||
"network": "all",
|
|
||||||
"packages": [
|
|
||||||
"pagesInn"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"globalStyle": {
|
|
||||||
"navigationBarTextStyle": "black",
|
|
||||||
"navigationBarTitleText": "uni-app",
|
|
||||||
"navigationBarBackgroundColor": "#F8F8F8",
|
|
||||||
"backgroundColor": "#F8F8F8"
|
|
||||||
},
|
|
||||||
"tabBar": {
|
|
||||||
"color": "#8B8F99",
|
|
||||||
"selectedColor": "#FF564A",
|
|
||||||
"borderStyle": "black",
|
|
||||||
"backgroundColor": "#ffffff",
|
|
||||||
"list": [
|
|
||||||
{
|
|
||||||
"pagePath": "pages/home/index",
|
|
||||||
"iconPath": "static/tabbar/icon-home.png",
|
|
||||||
"selectedIconPath": "static/tabbar/icon-home-hot.png",
|
|
||||||
"text": "首页"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pagePath": "pages/shop/ShoppingCart/index",
|
|
||||||
"iconPath": "static/tabbar/icon-cart.png",
|
|
||||||
"selectedIconPath": "static/tabbar/icon-cart-hot.png",
|
|
||||||
"text": "购物车"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pagePath": "pages/cloud/haveFun",
|
|
||||||
"iconPath": "static/tabbar/icon-cloud.png",
|
|
||||||
"selectedIconPath": "static/tabbar/icon-cloud-hot.png",
|
|
||||||
"text": "寻趣味"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pagePath": "pages/user/User/index",
|
|
||||||
"iconPath": "static/tabbar/icon-user.png",
|
|
||||||
"selectedIconPath": "static/tabbar/icon-user-hot.png",
|
|
||||||
"text": "我的"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"condition": {
|
|
||||||
"current": 0,
|
|
||||||
"list": [
|
|
||||||
{
|
|
||||||
"name": "商品详情",
|
|
||||||
"path": "pages/shop/GoodsCon/index",
|
|
||||||
"query": "id=369"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "DEBUG",
|
|
||||||
"path": "pages/shop/ShoppingCart/index",
|
|
||||||
"query": "id=297"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "No.8",
|
|
||||||
"path": "pages/shop/GoodsEvaluate/index",
|
|
||||||
"query": "id=eb30f8a98b1c4952addbdccb1d37533d"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "时令尝鲜",
|
|
||||||
"path": "pkg_product/views/season",
|
|
||||||
"query": "id=20"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,880 @@
|
|||||||
|
<template>
|
||||||
|
<view class="claim-page">
|
||||||
|
<!-- <view class="custom-header" :style="{ paddingTop: `${statusBarHeight}px` }">
|
||||||
|
<view class="header-inner">
|
||||||
|
<view class="header-back" @click="goBack">
|
||||||
|
<u-icon name="arrow-left" size="24" color="#333" class="header-back-icon"></u-icon>
|
||||||
|
</view>
|
||||||
|
<view class="header-title">填写收货地址</view>
|
||||||
|
<view class="header-right">
|
||||||
|
<view class="dot"></view>
|
||||||
|
<view class="ring"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
|
||||||
|
<scroll-view class="page-body" scroll-y >
|
||||||
|
<view class="card prize-card">
|
||||||
|
<view class="section-title">奖品信息</view>
|
||||||
|
<view class="prize-content">
|
||||||
|
<view class="prize-image-wrap">
|
||||||
|
<image class="prize-image" :src="prizeImage" mode="aspectFill" />
|
||||||
|
</view>
|
||||||
|
<view class="prize-info">
|
||||||
|
<view class="prize-name">{{ form.prizeName || '神秘奖品' }}</view>
|
||||||
|
<view class="prize-desc">{{ form.prizeAttrName || '默认' }}</view>
|
||||||
|
<view class="prize-code">抽奖码:{{ form.ticketCode || '--' }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="card form-card">
|
||||||
|
<view class="form-card-header">
|
||||||
|
<view class="form-card-title">填写收货地址</view>
|
||||||
|
<view class="select-address-entry" @click="chooseExistingAddress">
|
||||||
|
<text class="select-address-text" style="margin-bottom: 4rpx;">选择现有地址 </text>
|
||||||
|
<u-icon name="arrow-right" size="14" color="#BD3124"></u-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="form-row">
|
||||||
|
<text class="label">收货人</text>
|
||||||
|
<input v-model="form.realName" class="input" placeholder="请填写收货人" placeholder-style="color:#b2b2b2;" />
|
||||||
|
</view>
|
||||||
|
<view class="form-row">
|
||||||
|
<text class="label">手机号码</text>
|
||||||
|
<input
|
||||||
|
v-model="form.phone"
|
||||||
|
class="input"
|
||||||
|
type="number"
|
||||||
|
maxlength="11"
|
||||||
|
placeholder="请填写收货手机号"
|
||||||
|
placeholder-style="color:#b2b2b2;"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view class="form-row">
|
||||||
|
<text class="label">所在地区</text>
|
||||||
|
<view class="city-wrap">
|
||||||
|
<view class="city-select" :class="{'has-val': !!addressText}">
|
||||||
|
<CitySelect
|
||||||
|
ref="cityselect"
|
||||||
|
:defaultValue="addressText || '请选择'"
|
||||||
|
:items="district"
|
||||||
|
@callback="onCityChange"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<image class="locate-icon" :src="`${webUrl}/home/dingwei.png`" mode="aspectFit" @click="getCurAddressFn"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="form-row no-border">
|
||||||
|
<text class="label">详细地址</text>
|
||||||
|
<input v-model="form.detail" class="input" placeholder="请填写具体地址" placeholder-style="color:#b2b2b2;" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="analysis-box">
|
||||||
|
<textarea
|
||||||
|
:value="addressInput"
|
||||||
|
@input="onAddressInput"
|
||||||
|
placeholder="请粘贴收件人手机号、姓名、收货地址并用空格区分,系统将自动识别地址信息"
|
||||||
|
placeholder-style="font-size:24rpx;color:#999;"
|
||||||
|
class="analysis-textarea"
|
||||||
|
/>
|
||||||
|
<view class="analysis-actions">
|
||||||
|
<view class="action-btn btn-clear" @click="clearAddressInput">清空</view>
|
||||||
|
<view class="action-btn btn-recognize" :class="{ disabled: !addressInput }" @click="recognizeAddress">识别</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="tips">*请仔细核对收货信息,提交后不可修改,奖品将在{{ shipDayText }}个工作日内寄出</view>
|
||||||
|
</scroll-view>
|
||||||
|
|
||||||
|
<view class="submit-wrap">
|
||||||
|
<view class="submit-btn" @click="submit">确认提交</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="popup-mask" v-if="showRealnamePopup" @click="closePopup">
|
||||||
|
<view class="popup-panel auth-panel" @click.stop>
|
||||||
|
<view class="popup-close" @click="closePopup">×</view>
|
||||||
|
<view class="popup-icon-wrap">
|
||||||
|
<image class="popup-realname-icon" :src="webUrl + '/home/shiming.png'" mode="aspectFit" />
|
||||||
|
</view>
|
||||||
|
<view class="popup-title">实名认证</view>
|
||||||
|
<view class="popup-desc">根据平台活动规则,领取电子数码产品需要进行实名认证</view>
|
||||||
|
<view class="popup-actions">
|
||||||
|
<view class="popup-btn btn-confirm btn-wide" @click="goRealname">去实名认证</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="popup-mask" v-if="showSubmitSuccessPopup" @click="confirmSuccess">
|
||||||
|
<view class="popup-panel success-panel" @click.stop>
|
||||||
|
<view class="popup-close" @click="confirmSuccess">×</view>
|
||||||
|
<view class="popup-icon-wrap">
|
||||||
|
<image class="popup-success-icon" :src="webUrl + '/home/qingzhu.png'" mode="aspectFit" />
|
||||||
|
</view>
|
||||||
|
<view class="popup-title">提交成功</view>
|
||||||
|
<view class="popup-desc">奖品将在{{ shipDayText }}个工作日内寄出</view>
|
||||||
|
<view class="popup-actions">
|
||||||
|
<view class="popup-btn btn-ghost" @click="confirmSuccess">返回</view>
|
||||||
|
<view class="popup-btn btn-confirm" @click="goMyTicket">查看</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import CitySelect from '@/components/CitySelect'
|
||||||
|
import { getCity, analysisAddress, postAddress } from '@/api/user'
|
||||||
|
import { claimCoupon, claimPrize, getDrawRealname } from '@/api/lottery'
|
||||||
|
import { getCurAddress, getLocation } from '@/utils/common'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'CountyClaimAddressPage',
|
||||||
|
components: { CitySelect },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
|
statusBarHeight: 20,
|
||||||
|
district: [],
|
||||||
|
addressText: '',
|
||||||
|
addressInput: '',
|
||||||
|
address: {
|
||||||
|
province: '',
|
||||||
|
city: '',
|
||||||
|
district: ''
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
lotteryRecordId: '',
|
||||||
|
prizeName: '',
|
||||||
|
prizeAttrName: '',
|
||||||
|
prizeType: '',
|
||||||
|
prizeTypeName: '',
|
||||||
|
prizeImage: '',
|
||||||
|
ticketCode: '',
|
||||||
|
realName: '',
|
||||||
|
phone: '',
|
||||||
|
detail: ''
|
||||||
|
},
|
||||||
|
showRealnamePopup: false,
|
||||||
|
showSubmitSuccessPopup: false,
|
||||||
|
shipDay: 7,
|
||||||
|
prizeInfo: {},
|
||||||
|
prizeOrderId: '',
|
||||||
|
userInfo: {},
|
||||||
|
realnameStatus: 0,
|
||||||
|
waitSubmitAfterRealname: false,
|
||||||
|
submitting: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
prizeImage() {
|
||||||
|
return this.form.prizeImage || ''
|
||||||
|
},
|
||||||
|
shipDayText() {
|
||||||
|
const day = Number(this.shipDay)
|
||||||
|
if (!day || Number.isNaN(day) || day < 1) return 7
|
||||||
|
return day
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
const routeParams = this.decodeRouteParams(options)
|
||||||
|
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 20
|
||||||
|
this.prizeInfo = routeParams
|
||||||
|
this.form = {
|
||||||
|
...this.form,
|
||||||
|
...routeParams,
|
||||||
|
lotteryRecordId: this.resolveLotteryRecordId(routeParams),
|
||||||
|
prizeName: routeParams.prizeName || '',
|
||||||
|
prizeAttrName: routeParams.prizeAttrName || '',
|
||||||
|
prizeType: routeParams.prizeType || '',
|
||||||
|
prizeTypeName: routeParams.prizeTypeName || '',
|
||||||
|
prizeImage: routeParams.prizeImage || '',
|
||||||
|
ticketCode: routeParams.ticketCode || ''
|
||||||
|
}
|
||||||
|
this.shipDay = Number(routeParams.shipDay || 0) || 7
|
||||||
|
this.getCityList()
|
||||||
|
this.fetchRealnameStatus()
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.handleChooseAddress()
|
||||||
|
const done = uni.getStorageSync('countyClaimAuthDone')
|
||||||
|
const needAutoSubmit = uni.getStorageSync('countyClaimNeedAutoSubmit')
|
||||||
|
if (done && (this.waitSubmitAfterRealname || needAutoSubmit)) {
|
||||||
|
uni.removeStorageSync('countyClaimAuthDone')
|
||||||
|
uni.removeStorageSync('countyClaimNeedAutoSubmit')
|
||||||
|
this.fetchRealnameStatus().then(() => {
|
||||||
|
this.submitPhysicalClaim()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
decodeRouteParams(options = {}) {
|
||||||
|
return Object.keys(options).reduce((result, key) => {
|
||||||
|
const value = options[key]
|
||||||
|
if (value === undefined || value === null) return result
|
||||||
|
try {
|
||||||
|
result[key] = decodeURIComponent(value)
|
||||||
|
} catch (e) {
|
||||||
|
result[key] = value
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}, {})
|
||||||
|
},
|
||||||
|
resolveLotteryRecordId(data = {}) {
|
||||||
|
return data.lotteryRecordId || data.id || data.ticketId || data.recordId || ''
|
||||||
|
},
|
||||||
|
goBack() {
|
||||||
|
uni.navigateBack()
|
||||||
|
},
|
||||||
|
chooseExistingAddress() {
|
||||||
|
uni.setStorageSync('sourceAddress', {
|
||||||
|
realName: this.form.realName || '',
|
||||||
|
phone: this.form.phone || '',
|
||||||
|
userAddress: `${this.address.province || ''}${this.address.city || ''}${this.address.district || ''}${this.form.detail || ''}`,
|
||||||
|
province: this.address.province || '',
|
||||||
|
city: this.address.city || '',
|
||||||
|
district: this.address.district || '',
|
||||||
|
detail: this.form.detail || ''
|
||||||
|
})
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pages/user/address/AddressManagement/index',
|
||||||
|
query: {
|
||||||
|
choosMode: 1
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleChooseAddress() {
|
||||||
|
const chooseAddress = uni.getStorageSync('chooseAddress') || {}
|
||||||
|
if (!chooseAddress.id) return
|
||||||
|
uni.setStorageSync('chooseAddress', {})
|
||||||
|
this.fillAddressForm(chooseAddress)
|
||||||
|
},
|
||||||
|
fillAddressForm(address = {}) {
|
||||||
|
this.form.realName = address.realName || address.real_name || ''
|
||||||
|
this.form.phone = address.phone || ''
|
||||||
|
this.form.detail = address.detail || ''
|
||||||
|
this.address = {
|
||||||
|
province: address.province || '',
|
||||||
|
city: address.city || '',
|
||||||
|
district: address.district || '',
|
||||||
|
city_id: address.city_id || address.cityId || address.city_id
|
||||||
|
}
|
||||||
|
this.addressText = `${this.address.province} ${this.address.city} ${this.address.district}`.trim()
|
||||||
|
},
|
||||||
|
getCityList() {
|
||||||
|
getCity().then(res => {
|
||||||
|
this.district = res.data || []
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fetchRealnameStatus() {
|
||||||
|
return getDrawRealname().then((res) => {
|
||||||
|
const data = (res && res.data) || {}
|
||||||
|
this.realnameStatus = Number(data.status || 0)
|
||||||
|
}).catch(() => {
|
||||||
|
this.realnameStatus = 0
|
||||||
|
})
|
||||||
|
},
|
||||||
|
isDigitalPrize() {
|
||||||
|
const typeVal = String(this.form.prizeType || '').toLowerCase()
|
||||||
|
const typeName = String(this.form.prizeTypeName || '').toLowerCase()
|
||||||
|
const prizeName = String(this.form.prizeName || '').toLowerCase()
|
||||||
|
if (['1', 'electronic', 'digital', 'electronics'].includes(typeVal)) return true
|
||||||
|
if (/电子|数码/.test(typeName)) return true
|
||||||
|
return /电子|数码/.test(prizeName)
|
||||||
|
},
|
||||||
|
hasRealNameAuth() {
|
||||||
|
if (Number(this.realnameStatus) === 1) return true
|
||||||
|
const user = this.userInfo || {}
|
||||||
|
const flag = [
|
||||||
|
user.isRealName,
|
||||||
|
user.realNameAuth,
|
||||||
|
user.isAuth,
|
||||||
|
user.authStatus,
|
||||||
|
user.realNameStatus,
|
||||||
|
user.idAuthStatus
|
||||||
|
]
|
||||||
|
if (flag.some(v => Number(v) === 1 || v === true || String(v).toUpperCase() === 'Y')) return true
|
||||||
|
if (Number(user.authStatus) === 2 || Number(user.realNameStatus) === 2 || Number(user.idAuthStatus) === 2) return true
|
||||||
|
return !!(String(user.realName || '').trim() && String(user.idCard || user.idcard || '').trim())
|
||||||
|
},
|
||||||
|
isCouponPrize() {
|
||||||
|
const typeVal = String(this.form.prizeType || '').toLowerCase()
|
||||||
|
const typeName = String(this.form.prizeTypeName || '')
|
||||||
|
const prizeName = String(this.form.prizeName || '')
|
||||||
|
if (['3', 'coupon'].includes(typeVal)) return true
|
||||||
|
return /券/.test(typeName) || /券/.test(prizeName)
|
||||||
|
},
|
||||||
|
async createAddress() {
|
||||||
|
const payload = {
|
||||||
|
id: '',
|
||||||
|
real_name: this.form.realName,
|
||||||
|
phone: this.form.phone,
|
||||||
|
address: this.address,
|
||||||
|
detail: this.form.detail,
|
||||||
|
is_default: false,
|
||||||
|
post_code: ''
|
||||||
|
}
|
||||||
|
const res = await postAddress(payload)
|
||||||
|
const addressId = Number(res && res.data && res.data.id)
|
||||||
|
if (!addressId) {
|
||||||
|
throw new Error('地址保存失败,请重试')
|
||||||
|
}
|
||||||
|
return addressId
|
||||||
|
},
|
||||||
|
validatePhysicalForm() {
|
||||||
|
if (!this.form.realName) {
|
||||||
|
uni.showToast({ title: '请填写收货人', icon: 'none' })
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!/^1\d{10}$/.test(this.form.phone)) {
|
||||||
|
uni.showToast({ title: '请输入正确手机号', icon: 'none' })
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.addressText) {
|
||||||
|
uni.showToast({ title: '请选择所在地区', icon: 'none' })
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.form.detail) {
|
||||||
|
uni.showToast({ title: '请填写详细地址', icon: 'none' })
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
async submitCouponClaim() {
|
||||||
|
const ticketId = Number(this.resolveLotteryRecordId(this.form))
|
||||||
|
if (!ticketId) {
|
||||||
|
uni.showToast({ title: '缺少抽奖券ID', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
await claimCoupon(ticketId)
|
||||||
|
this.shipDay = Number(this.prizeInfo.shipDay || 0) || 7
|
||||||
|
this.prizeOrderId = ''
|
||||||
|
this.showSubmitSuccessPopup = true
|
||||||
|
},
|
||||||
|
async submitPhysicalClaim() {
|
||||||
|
if (this.submitting) return
|
||||||
|
if (!this.validatePhysicalForm()) return
|
||||||
|
const ticketId = Number(this.resolveLotteryRecordId(this.form))
|
||||||
|
if (!ticketId) {
|
||||||
|
uni.showToast({ title: '缺少抽奖券ID', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.submitting = true
|
||||||
|
uni.showLoading({ title: '提交中...' })
|
||||||
|
try {
|
||||||
|
if (this.isDigitalPrize()) {
|
||||||
|
await this.fetchRealnameStatus()
|
||||||
|
if (!this.hasRealNameAuth()) {
|
||||||
|
this.waitSubmitAfterRealname = true
|
||||||
|
this.showRealnamePopup = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const addressId = await this.createAddress()
|
||||||
|
const res = await claimPrize(ticketId, addressId)
|
||||||
|
const data = (res && res.data) || {}
|
||||||
|
this.shipDay = Number(data.shipDay || 0) || 7
|
||||||
|
this.prizeOrderId = String(data.orderId || '')
|
||||||
|
this.waitSubmitAfterRealname = false
|
||||||
|
this.showSubmitSuccessPopup = true
|
||||||
|
} catch (e) {
|
||||||
|
uni.showToast({
|
||||||
|
title: (e && e.msg) || (e && e.message) || '提交失败',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading()
|
||||||
|
this.submitting = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onCityChange(values) {
|
||||||
|
this.address = {
|
||||||
|
province: values.province.name || '',
|
||||||
|
city: values.city.name || '',
|
||||||
|
district: values.district.name || '',
|
||||||
|
city_id: values.city.id
|
||||||
|
}
|
||||||
|
this.addressText = `${this.address.province} ${this.address.city} ${this.address.district}`
|
||||||
|
},
|
||||||
|
async getCurAddressFn() {
|
||||||
|
uni.showLoading({ title: '定位中...' })
|
||||||
|
try {
|
||||||
|
const map = await getLocation()
|
||||||
|
if (map.length > 1) {
|
||||||
|
const { latitude, longitude } = map[1]
|
||||||
|
getCurAddress(latitude, longitude, (addr) => {
|
||||||
|
this.address = {
|
||||||
|
province: addr.province || '',
|
||||||
|
city: addr.city || '',
|
||||||
|
district: addr.county || ''
|
||||||
|
}
|
||||||
|
this.addressText = `${this.address.province} ${this.address.city} ${this.address.district}`
|
||||||
|
this.form.detail = addr.formattedAddress || this.form.detail
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onAddressInput(e) {
|
||||||
|
this.addressInput = (e.detail && e.detail.value ? e.detail.value : '').trim()
|
||||||
|
},
|
||||||
|
clearAddressInput() {
|
||||||
|
this.addressInput = ''
|
||||||
|
},
|
||||||
|
recognizeAddress() {
|
||||||
|
if (!this.addressInput) return
|
||||||
|
uni.showLoading({ title: '识别中...' })
|
||||||
|
analysisAddress({ content: this.addressInput }).then((res) => {
|
||||||
|
uni.hideLoading()
|
||||||
|
const data = (res && res.data) || {}
|
||||||
|
this.form.realName = data.realName || this.form.realName
|
||||||
|
this.form.phone = data.phone || this.form.phone
|
||||||
|
this.form.detail = data.detail || this.form.detail
|
||||||
|
this.address = {
|
||||||
|
province: data.province || '',
|
||||||
|
city: data.city || '',
|
||||||
|
district: data.district || '',
|
||||||
|
city_id: data.cityId
|
||||||
|
}
|
||||||
|
this.addressText = `${this.address.province} ${this.address.city} ${this.address.district}`.trim()
|
||||||
|
}).catch(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({
|
||||||
|
title: '识别失败,请手动填写',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async submit() {
|
||||||
|
if (this.isCouponPrize()) {
|
||||||
|
this.submitting = true
|
||||||
|
uni.showLoading({ title: '领取中...' })
|
||||||
|
try {
|
||||||
|
await this.submitCouponClaim()
|
||||||
|
} catch (e) {
|
||||||
|
uni.showToast({
|
||||||
|
title: (e && e.msg) || (e && e.message) || '领取失败',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading()
|
||||||
|
this.submitting = false
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.submitPhysicalClaim()
|
||||||
|
},
|
||||||
|
closePopup() {
|
||||||
|
this.showRealnamePopup = false
|
||||||
|
this.showSubmitSuccessPopup = false
|
||||||
|
},
|
||||||
|
goRealname() {
|
||||||
|
this.showRealnamePopup = false
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pkg-video/views/county-realname'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
confirmSuccess() {
|
||||||
|
this.showSubmitSuccessPopup = false
|
||||||
|
uni.redirectTo({
|
||||||
|
url: '/pkg-video/views/county-my-tickets'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goMyTicket() {
|
||||||
|
this.showSubmitSuccessPopup = false
|
||||||
|
uni.redirectTo({
|
||||||
|
url: `/pagesOrder/order/OrderDetails/index?id=${this.prizeOrderId}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.claim-page {
|
||||||
|
min-height: 100vh;
|
||||||
|
background: #F0F0F0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-header {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-inner {
|
||||||
|
height: 88rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-back {
|
||||||
|
width: 56rpx;
|
||||||
|
height: 56rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-back-icon {
|
||||||
|
font-size: 60rpx;
|
||||||
|
color: #111;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-title {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #222;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-right {
|
||||||
|
width: 88rpx;
|
||||||
|
height: 44rpx;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
border: 2rpx solid #d8d8d8;
|
||||||
|
background: #fff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dot {
|
||||||
|
width: 8rpx;
|
||||||
|
height: 8rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #111;
|
||||||
|
margin-right: 14rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ring {
|
||||||
|
width: 18rpx;
|
||||||
|
height: 18rpx;
|
||||||
|
border: 2rpx solid #111;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-body {
|
||||||
|
height: 100vh;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 20rpx 24rpx 220rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
color: #9b9b9b;
|
||||||
|
font-size: 28rpx;
|
||||||
|
margin-bottom: 18rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
margin-bottom: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prize-card {
|
||||||
|
padding: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prize-content {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prize-image-wrap {
|
||||||
|
width: 182rpx;
|
||||||
|
height: 182rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
border: 2rpx solid #f0f0f0;
|
||||||
|
margin-right: 24rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prize-image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prize-info {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prize-name {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #2f2f2f;
|
||||||
|
margin-bottom: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prize-desc,
|
||||||
|
.prize-code {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #9c9c9c;
|
||||||
|
margin-top: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-card {
|
||||||
|
padding: 0 24rpx 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-card-header {
|
||||||
|
min-height: 88rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
border-bottom: 2rpx dashed #e5e5e5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-card-title {
|
||||||
|
color: #262626;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-address-entry {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
color: #BD3124;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-address-text {
|
||||||
|
font-size: 26rpx;
|
||||||
|
margin-right: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-row {
|
||||||
|
min-height: 92rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border-bottom: 2rpx dashed #e5e5e5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-row.no-border {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
width: 180rpx;
|
||||||
|
color: #262626;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
flex: 1;
|
||||||
|
color: #333;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.city-wrap {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.city-select {
|
||||||
|
flex: 1;
|
||||||
|
color: #b2b2b2;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.city-select.has-val {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.locate-icon {
|
||||||
|
width: 42rpx;
|
||||||
|
height: 42rpx;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.analysis-box {
|
||||||
|
background: #f8f8f8;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
padding: 20rpx 20rpx 16rpx;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.analysis-textarea {
|
||||||
|
width: 100%;
|
||||||
|
height: 110rpx;
|
||||||
|
color: #333;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.analysis-actions {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-btn {
|
||||||
|
font-size: 24rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-clear {
|
||||||
|
color: #BD3124;
|
||||||
|
border: 2rpx solid #BD3124;
|
||||||
|
padding: 6rpx 32rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-recognize {
|
||||||
|
color: #fff;
|
||||||
|
background: #BD3124;
|
||||||
|
border: 2rpx solid #BD3124;
|
||||||
|
padding: 6rpx 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-recognize.disabled {
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
color: #2f2f2f;
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 1.5;
|
||||||
|
margin: 20rpx 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit-wrap {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
padding: 24rpx 40rpx calc(30rpx + env(safe-area-inset-bottom));
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit-btn {
|
||||||
|
height: 92rpx;
|
||||||
|
border-radius: 46rpx;
|
||||||
|
background: #BD3124;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 92rpx;
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: 18rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-mask {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.48);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
z-index: 100;
|
||||||
|
padding: 0 52rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-panel {
|
||||||
|
width: 540rpx;
|
||||||
|
height: 550rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 40rpx 32rpx;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-title {
|
||||||
|
text-align: center;
|
||||||
|
color: #333;
|
||||||
|
font-size: 50rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-desc {
|
||||||
|
color: #666;
|
||||||
|
font-size: 28rpx;
|
||||||
|
line-height: 1.6;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-close {
|
||||||
|
position: absolute;
|
||||||
|
right: 20rpx;
|
||||||
|
top: 16rpx;
|
||||||
|
width: 44rpx;
|
||||||
|
height: 44rpx;
|
||||||
|
border: 4rpx solid #333;
|
||||||
|
border-radius: 50%;
|
||||||
|
font-size: 32rpx;
|
||||||
|
line-height: 44rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #333;
|
||||||
|
font-weight: 700;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-icon-wrap {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-icon {
|
||||||
|
font-size: 54rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-realname-icon {
|
||||||
|
width: 92rpx;
|
||||||
|
height: 92rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-success-icon {
|
||||||
|
width: 92rpx;
|
||||||
|
height: 92rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 120rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-btn {
|
||||||
|
min-width: 180rpx;
|
||||||
|
height: 72rpx;
|
||||||
|
line-height: 72rpx;
|
||||||
|
border-radius: 36rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-confirm {
|
||||||
|
color: #fff;
|
||||||
|
background: #BD3124;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-wide {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-ghost {
|
||||||
|
color: #BD3124;
|
||||||
|
border: 2rpx solid #BD3124;
|
||||||
|
background: #fff;
|
||||||
|
margin-right: 22rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,171 @@
|
|||||||
|
<template>
|
||||||
|
<view class="county-lottery-rules-page">
|
||||||
|
<!-- <view class="custom-header" :style="{ paddingTop: `${statusBarHeight}px` }">
|
||||||
|
<view class="header-inner">
|
||||||
|
<view class="header-back" @click="goBack">
|
||||||
|
<u-icon name="arrow-left" size="24" color="#333" class="header-back-icon"></u-icon>
|
||||||
|
</view>
|
||||||
|
<view class="header-title">活动规则</view>
|
||||||
|
<view class="header-right">
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
|
||||||
|
<view class="page-body" >
|
||||||
|
<view class="rule-card">
|
||||||
|
<view class="rule-content">
|
||||||
|
<rich-text v-if="ruleContent" :nodes="ruleContent" />
|
||||||
|
<view class="state-text" v-else>{{ loading ? '规则加载中...' : '暂无活动规则' }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getDrawRuleConfig } from '@/api/lottery'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'CountyLotteryRulesPage',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
statusBarHeight: 20,
|
||||||
|
loading: true,
|
||||||
|
ruleContent: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 20
|
||||||
|
this.fetchRuleConfig()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fetchRuleConfig() {
|
||||||
|
this.loading = true
|
||||||
|
getDrawRuleConfig().then(res => {
|
||||||
|
const data = res.data || {}
|
||||||
|
this.ruleContent = data.ruleContent || ''
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goBack() {
|
||||||
|
if (getCurrentPages().length > 1) {
|
||||||
|
uni.navigateBack()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/home/index'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.county-lottery-rules-page {
|
||||||
|
min-height: 100vh;
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-header {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
background: #f5f5f5;
|
||||||
|
z-index: 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-inner {
|
||||||
|
height: 88rpx;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-back {
|
||||||
|
width: 56rpx;
|
||||||
|
height: 56rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-back-icon {
|
||||||
|
font-size: 44rpx;
|
||||||
|
color: #111;
|
||||||
|
line-height: 1;
|
||||||
|
margin-top: -4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-title {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
margin-left: 56rpx;
|
||||||
|
font-size: 34rpx;
|
||||||
|
color: #333;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-right {
|
||||||
|
width: 88rpx;
|
||||||
|
height: 44rpx;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
border: 2rpx solid #d8d8d8;
|
||||||
|
background: #fff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right-dot {
|
||||||
|
width: 8rpx;
|
||||||
|
height: 8rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #111;
|
||||||
|
margin-right: 14rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right-ring {
|
||||||
|
width: 18rpx;
|
||||||
|
height: 18rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 2rpx solid #111;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-body {
|
||||||
|
padding: 24rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rule-card {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rule-title {
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #333;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rule-content {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #444;
|
||||||
|
line-height: 1.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.state-text {
|
||||||
|
color: #999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .rule-content p {
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,913 @@
|
|||||||
|
<template>
|
||||||
|
<view class="county-lottery-page">
|
||||||
|
<view class="banner-wrapper">
|
||||||
|
<view class="top-banner" :style="topBannerStyle">
|
||||||
|
<view class="banner-content">
|
||||||
|
<view class="banner-date">开奖时间:{{ openDateText }}</view>
|
||||||
|
<view class="banner-countdown">
|
||||||
|
<text class="text">距离开奖还有</text>
|
||||||
|
<text class="num">{{ countdownData.day }}</text>
|
||||||
|
<text class="text">天</text>
|
||||||
|
<text class="num">{{ countdownData.time }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="side-entry rules" @click="openRulesModel">活动规则</view>
|
||||||
|
<view class="side-entry mine" @click="navToLog">我的抽奖码</view>
|
||||||
|
|
||||||
|
<view class="winners-wrap">
|
||||||
|
<view class="winners-text" v-if="!winnerSortedList.length">暂时无人中奖</view>
|
||||||
|
<view class="winners-text one-t" v-else-if="winnerSortedList.length === 1">
|
||||||
|
恭喜 <text class="blue">{{ winnerSortedList[0].name }}</text>
|
||||||
|
在第 <text class="blue">{{ winnerSortedList[0].periodNo }}</text> 期抽奖活动中获得
|
||||||
|
<text class="red">{{ winnerSortedList[0].prizeName }}</text>
|
||||||
|
</view>
|
||||||
|
<swiper
|
||||||
|
v-else
|
||||||
|
class="winner-swiper"
|
||||||
|
vertical
|
||||||
|
circular
|
||||||
|
autoplay
|
||||||
|
:interval="3000"
|
||||||
|
:duration="500"
|
||||||
|
>
|
||||||
|
<swiper-item v-for="(winner, index) in winnerSortedList" :key="index">
|
||||||
|
<view class="winners-text one-t">
|
||||||
|
恭喜 <text class="blue">{{ winner.name }}</text>
|
||||||
|
在第 <text class="blue">{{ winner.periodNo }}</text> 期抽奖活动中获得
|
||||||
|
<text class="red">{{ winner.prizeName }}</text>
|
||||||
|
</view>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
<view class="winners-btn" @click="navToWinners">查看全部 <text class="arrow">➔</text></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="pool-wrap">
|
||||||
|
<view class="pool-header" style="background: linear-gradient(to bottom, #fff 50%, #CB302C 50%);">
|
||||||
|
<view class="pool-title-wrap">
|
||||||
|
<view class="pool-title">奖品池 <text class="sub">/ prize pool</text></view>
|
||||||
|
</view>
|
||||||
|
<view class="pool-desc">实付满{{ buyThresholdText }}元(不包括优惠券金额)即可获得抽奖码,定时统一开奖</view>
|
||||||
|
</view>
|
||||||
|
<view class="pool-body">
|
||||||
|
<swiper
|
||||||
|
class="pool-swiper"
|
||||||
|
:autoplay="prizeList.length > 1"
|
||||||
|
:circular="prizeList.length > 1"
|
||||||
|
:interval="3000"
|
||||||
|
:duration="500"
|
||||||
|
previous-margin="180rpx"
|
||||||
|
next-margin="180rpx"
|
||||||
|
@change="onSwiperChange"
|
||||||
|
v-if="prizeList.length"
|
||||||
|
>
|
||||||
|
<swiper-item v-for="(prize, gIndex) in prizeList" :key="gIndex">
|
||||||
|
<view class="pool-list-group">
|
||||||
|
<view
|
||||||
|
class="pool-item"
|
||||||
|
:class="{ 'is-active': currentSwiperIndex === gIndex }"
|
||||||
|
style="margin: 0 auto;"
|
||||||
|
>
|
||||||
|
<view class="item-inner">
|
||||||
|
<view class="item-dashed">
|
||||||
|
<image class="pool-image" :src="prize.prizeImage" mode="aspectFit" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<image class="prize-tag" :src="prize.levelIcon" v-if="prize.levelIcon" mode="aspectFit" />
|
||||||
|
<view class="pool-name-wrap">
|
||||||
|
<view class="pool-name one-t">{{ prize.prizeName }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="goods-section">
|
||||||
|
<view class="goods-header-box">
|
||||||
|
<view class="goods-title-pill">
|
||||||
|
<view style="background: #ffb611;
|
||||||
|
padding: 8rpx 40rpx;
|
||||||
|
border-radius: 40rpx;"><text class="dot">·</text> 活动商品 <text class="dot">·</text></view>
|
||||||
|
</view>
|
||||||
|
<view class="goods-sub">—— 购买即得抽奖码 ——</view>
|
||||||
|
</view>
|
||||||
|
<view class="goods-list">
|
||||||
|
<view
|
||||||
|
v-for="(item, index) in activityGoodsList"
|
||||||
|
:key="index"
|
||||||
|
class="goods-item"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
v-if="Number(item.isGiftCard) === 1"
|
||||||
|
class="goods-gift-tag"
|
||||||
|
:src="webUrl + '/home/gift-tag.png'"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
<image class="goods-image" :src="item.image" mode="aspectFill" @click="goGoodsDetail(item)" />
|
||||||
|
<view class="goods-name more-t">{{ item.storeName }}</view>
|
||||||
|
<view class="goods-bottom">
|
||||||
|
<text class="goods-price">¥{{ item.price }}</text>
|
||||||
|
<view class="goods-cart" @click.stop="openGoodsSku(item)">购</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<ProductWindow
|
||||||
|
ref="attrWindow"
|
||||||
|
:attr="attr"
|
||||||
|
:cartNum="cart_num"
|
||||||
|
:hideQuantityControls="true"
|
||||||
|
:showOk="true"
|
||||||
|
:okText="currentGoodsItem && Number(currentGoodsItem.isGiftCard) === 1 ? '立即下单' : '立即下单'"
|
||||||
|
@changeFun="changeFun"
|
||||||
|
paddingBottom="80rpx"
|
||||||
|
@ok="submitFromSku()"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getDrawActivityInfo, getDrawLatestWinners } from '@/api/lottery'
|
||||||
|
import { postCartAdd } from '@/api/store'
|
||||||
|
import ProductWindow from '@/components/ProductWindow'
|
||||||
|
import goCartMixin from '@/mixins/goCartMixins'
|
||||||
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'CountyLotteryPage',
|
||||||
|
components: {
|
||||||
|
ProductWindow
|
||||||
|
},
|
||||||
|
mixins: [pageListenMixins, goCartMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
ready: false,
|
||||||
|
activityInfo: {
|
||||||
|
drawImage: '',
|
||||||
|
drawTime: '',
|
||||||
|
winnerList: [],
|
||||||
|
prizePool: [],
|
||||||
|
products: []
|
||||||
|
},
|
||||||
|
latestWinnerList: [],
|
||||||
|
activityId: 0,
|
||||||
|
onlyOneToAddCart: false,
|
||||||
|
statusBarHeight: 20,
|
||||||
|
countdownData: {
|
||||||
|
day: '--',
|
||||||
|
time: '--:--:--'
|
||||||
|
},
|
||||||
|
countdownTimer: null,
|
||||||
|
currentSwiperIndex: 0,
|
||||||
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
|
currentGoodsItem: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
topBannerStyle() {
|
||||||
|
const drawImage = String(this.activityInfo.drawImage || '').trim()
|
||||||
|
if (!drawImage) return ''
|
||||||
|
return `background-image:url(${drawImage});background-size:100% 100%;background-repeat:no-repeat;background-position:center top;`
|
||||||
|
},
|
||||||
|
prizeList() {
|
||||||
|
return this.activityInfo.prizePool || []
|
||||||
|
},
|
||||||
|
activityGoodsList() {
|
||||||
|
const list = this.activityInfo.products || []
|
||||||
|
if (list.length > 0) {
|
||||||
|
return list.map(item => ({
|
||||||
|
id: item.productId || item.id || 0,
|
||||||
|
image: item.productImage || item.image || item.pic || '',
|
||||||
|
storeName: item.storeName || '',
|
||||||
|
productName: item.productName || item.name || item.prizeName || '',
|
||||||
|
price: item.productPrice || item.price || item.salePrice || 0,
|
||||||
|
isGiftCard: Number(item.isGiftCard || 0)
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
return this.prizeList.map(item => ({
|
||||||
|
id: item.productId || 0,
|
||||||
|
image: item.prizeImage || '',
|
||||||
|
name: item.prizeName || '',
|
||||||
|
price: item.productPrice || item.price || 0,
|
||||||
|
isGiftCard: Number(item.isGiftCard || 0)
|
||||||
|
}))
|
||||||
|
},
|
||||||
|
winnerSortedList() {
|
||||||
|
const list = this.latestWinnerList || []
|
||||||
|
if (!list.length) return []
|
||||||
|
const mapped = list.map(item => ({
|
||||||
|
name: item.realName || item.phone || '用户',
|
||||||
|
periodNo: item.periodNo || '-',
|
||||||
|
prizeName: item.prizeName || '神秘奖品'
|
||||||
|
}))
|
||||||
|
return mapped.sort((a, b) => this.getPeriodNoValue(b.periodNo) - this.getPeriodNoValue(a.periodNo))
|
||||||
|
},
|
||||||
|
buyThresholdText() {
|
||||||
|
const spendThreshold = this.activityInfo.spendThreshold || 0
|
||||||
|
return spendThreshold
|
||||||
|
},
|
||||||
|
openDateText() {
|
||||||
|
const target = this.getTargetDate()
|
||||||
|
if (!target) return '--'
|
||||||
|
const year = target.getFullYear()
|
||||||
|
const month = String(target.getMonth() + 1).padStart(2, '0')
|
||||||
|
const day = String(target.getDate()).padStart(2, '0')
|
||||||
|
return `${year}年${month}月${day}日`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
this.activityId = Number(options.activityId || options.areaId) || 0
|
||||||
|
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 20
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
onUnload() {
|
||||||
|
this.clearCountdownTimer()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
|
if (!this.activityId) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '缺少活动ID',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Promise.all([
|
||||||
|
getDrawActivityInfo(this.activityId),
|
||||||
|
getDrawLatestWinners()
|
||||||
|
]).then(([activityRes, winnersRes]) => {
|
||||||
|
if (activityRes && activityRes.success) {
|
||||||
|
const data = activityRes.data || {}
|
||||||
|
|
||||||
|
// 如果活动已开奖(或已过开奖时间),直接重定向至中奖名单页
|
||||||
|
const targetTime = data.drawTime || ''
|
||||||
|
let isPassed = false
|
||||||
|
if (targetTime) {
|
||||||
|
const date = new Date(String(targetTime).replace(/-/g, '/'))
|
||||||
|
if (!Number.isNaN(date.getTime()) && date.getTime() <= Date.now()) {
|
||||||
|
isPassed = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isPassed || Number(data.status) === 2 || Number(data.status) === 3) {
|
||||||
|
uni.redirectTo({ url: `/pkg-video/views/county-winners?activityId=${this.activityId}` })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.activityInfo = {
|
||||||
|
...this.activityInfo,
|
||||||
|
...data,
|
||||||
|
drawImage: data.drawImage || ''
|
||||||
|
}
|
||||||
|
this.ready = true
|
||||||
|
this.startCountdown()
|
||||||
|
}
|
||||||
|
const winnersData = winnersRes && winnersRes.data
|
||||||
|
const list = Array.isArray(winnersData)
|
||||||
|
? winnersData
|
||||||
|
: (Array.isArray(winnersData && winnersData.list) ? winnersData.list : [])
|
||||||
|
this.latestWinnerList = list
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getTargetDate() {
|
||||||
|
const targetTime = this.activityInfo.drawTime || ''
|
||||||
|
if (!targetTime) return null
|
||||||
|
const date = new Date(String(targetTime).replace(/-/g, '/'))
|
||||||
|
if (Number.isNaN(date.getTime())) return null
|
||||||
|
return date
|
||||||
|
},
|
||||||
|
startCountdown() {
|
||||||
|
this.clearCountdownTimer()
|
||||||
|
const calc = () => {
|
||||||
|
const target = this.getTargetDate()
|
||||||
|
if (!target) {
|
||||||
|
this.countdownData = { day: '--', time: '--:--:--' }
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let diff = target.getTime() - Date.now()
|
||||||
|
if (diff <= 0) {
|
||||||
|
this.countdownData = { day: '00', time: '00:00:00' }
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const day = Math.floor(diff / (24 * 60 * 60 * 1000))
|
||||||
|
diff -= day * 24 * 60 * 60 * 1000
|
||||||
|
const hour = Math.floor(diff / (60 * 60 * 1000))
|
||||||
|
diff -= hour * 60 * 60 * 1000
|
||||||
|
const minute = Math.floor(diff / (60 * 1000))
|
||||||
|
diff -= minute * 60 * 1000
|
||||||
|
const second = Math.floor(diff / 1000)
|
||||||
|
const dd = String(day).padStart(2, '0')
|
||||||
|
const hh = String(hour).padStart(2, '0')
|
||||||
|
const mm = String(minute).padStart(2, '0')
|
||||||
|
const ss = String(second).padStart(2, '0')
|
||||||
|
this.countdownData = {
|
||||||
|
day: dd,
|
||||||
|
time: `${hh}:${mm}:${ss}`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
calc()
|
||||||
|
this.countdownTimer = setInterval(calc, 1000)
|
||||||
|
},
|
||||||
|
clearCountdownTimer() {
|
||||||
|
if (this.countdownTimer) {
|
||||||
|
clearInterval(this.countdownTimer)
|
||||||
|
this.countdownTimer = null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getPeriodNoValue(periodNo) {
|
||||||
|
const text = String(periodNo || '')
|
||||||
|
const match = text.match(/\d+/g)
|
||||||
|
if (!match || !match.length) return 0
|
||||||
|
return Number(match.join('')) || 0
|
||||||
|
},
|
||||||
|
openRulesModel() {
|
||||||
|
uni.navigateTo({ url: '/pkg-video/views/county-lottery-rules' })
|
||||||
|
},
|
||||||
|
navToWinners() {
|
||||||
|
const targetDate = this.getTargetDate()
|
||||||
|
const isNotOpened = targetDate && targetDate.getTime() > Date.now()
|
||||||
|
const url = isNotOpened
|
||||||
|
? '/pkg-video/views/county-winners'
|
||||||
|
: `/pkg-video/views/county-winners?activityId=${this.activityId}`
|
||||||
|
uni.navigateTo({ url })
|
||||||
|
},
|
||||||
|
navToLog() {
|
||||||
|
uni.navigateTo({ url: '/pkg-video/views/county-my-tickets' })
|
||||||
|
},
|
||||||
|
goBack() {
|
||||||
|
if (getCurrentPages().length > 1) {
|
||||||
|
uni.navigateBack()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/home/index'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onSwiperChange(e) {
|
||||||
|
this.currentSwiperIndex = e.detail.current
|
||||||
|
},
|
||||||
|
goGoodsDetail(item) {
|
||||||
|
if (!item.id) return
|
||||||
|
uni.navigateTo({ url: `/pages/shop/GoodsCon/index?id=${item.id}&from=countyLottery&activityId=${this.activityId}` })
|
||||||
|
},
|
||||||
|
openGoodsSku(item) {
|
||||||
|
if (!item.id) return
|
||||||
|
this.currentGoodsItem = item
|
||||||
|
this.cart_num = 1
|
||||||
|
if (this.attr && this.attr.productSelect) {
|
||||||
|
this.$set(this.attr.productSelect, 'cart_num', 1)
|
||||||
|
}
|
||||||
|
this.addToCart(item)
|
||||||
|
},
|
||||||
|
submitFromSku() {
|
||||||
|
const productSelect = this.getAttrItemData(this.attrValue)
|
||||||
|
const currentSelect = {
|
||||||
|
...(productSelect || {}),
|
||||||
|
...(this.attr.productSelect || {})
|
||||||
|
}
|
||||||
|
// const isGiftOrder = Number(this.currentGoodsItem && this.currentGoodsItem.isGiftCard) === 1
|
||||||
|
const isGiftOrder = false
|
||||||
|
|
||||||
|
const stock = Number(currentSelect.stock || 0)
|
||||||
|
const hasNo = (this.attr.productAttr.length && !productSelect && this.isOpen) || stock <= 0
|
||||||
|
if (hasNo) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '产品库存不足,请选择其他商品',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const q = {
|
||||||
|
productId: this.m_id,
|
||||||
|
cartNum: 1,
|
||||||
|
new: 1,
|
||||||
|
uniqueId: currentSelect.unique || ''
|
||||||
|
}
|
||||||
|
if (this.activityId) {
|
||||||
|
q.drawActivityId = Number(this.activityId)
|
||||||
|
}
|
||||||
|
postCartAdd(q).then(res => {
|
||||||
|
this.isOpen = false
|
||||||
|
this.attr.cartAttr = false
|
||||||
|
this.$set(this.attr.productSelect, 'cart_num', 1)
|
||||||
|
this.cart_num = 1
|
||||||
|
const cartId = (res.data && res.data.cartId) || ''
|
||||||
|
if (!cartId) return
|
||||||
|
if (isGiftOrder) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pkg_user/views/gift/gift?cartId=${cartId}&from=countyLottery&drawActivityId=${this.activityId || 0}`
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/order/OrderSubmission/index?id=${cartId}`
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.county-lottery-page {
|
||||||
|
min-height: 100vh;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
padding-bottom: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-header {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 30;
|
||||||
|
background: rgba(255, 255, 255, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-header-inner {
|
||||||
|
height: 88rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-back {
|
||||||
|
width: 64rpx;
|
||||||
|
height: 64rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: rgba(0, 0, 0, .35);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-back-icon {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 56rpx;
|
||||||
|
line-height: 1;
|
||||||
|
margin-top: -6rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.banner-wrapper {
|
||||||
|
position: relative;
|
||||||
|
background: #f5f5f5;
|
||||||
|
padding-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
.banner-red-curve {
|
||||||
|
background: #cb302c;
|
||||||
|
height: 40rpx;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
border-bottom-left-radius: 60rpx;
|
||||||
|
border-bottom-right-radius: 60rpx;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-banner {
|
||||||
|
// background-color: #ffb611;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
height: 530rpx;
|
||||||
|
position: relative;
|
||||||
|
border-bottom-left-radius: 40rpx;
|
||||||
|
border-bottom-right-radius: 40rpx;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.banner-content {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 40rpx;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.banner-date {
|
||||||
|
position: relative;
|
||||||
|
background: #3b7cf6;
|
||||||
|
color: #fff;
|
||||||
|
border: 4rpx solid #fff;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
padding: 6rpx 30rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
margin-bottom: 24rpx;
|
||||||
|
box-shadow: 0 -10rpx 0 #3b7cf6;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
bottom: -14rpx;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
border-width: 14rpx 14rpx 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #fff transparent transparent transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
bottom: -8rpx;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
border-width: 10rpx 10rpx 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #3b7cf6 transparent transparent transparent;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.banner-countdown {
|
||||||
|
background: #cb302c;
|
||||||
|
color: #fff;
|
||||||
|
border: 6rpx solid #fff;
|
||||||
|
border-radius: 60rpx;
|
||||||
|
padding: 10rpx 40rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
box-shadow: inset 0 0 0 6rpx rgba(0, 0, 0, 0.1);
|
||||||
|
|
||||||
|
.text {
|
||||||
|
font-size: 38rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.num {
|
||||||
|
font-size: 38rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 0 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-entry {
|
||||||
|
position: fixed;
|
||||||
|
right: 0;
|
||||||
|
background: #fff;
|
||||||
|
color: #333;
|
||||||
|
font-size: 24rpx;
|
||||||
|
width: 44rpx;
|
||||||
|
padding: 24rpx 0;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 24rpx 24rpx 0 24rpx;
|
||||||
|
z-index: 10;
|
||||||
|
writing-mode: vertical-rl;
|
||||||
|
letter-spacing: 6rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
box-shadow: -2rpx 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
||||||
|
line-height: 44rpx;
|
||||||
|
&::after{
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
bottom: -12rpx;
|
||||||
|
right: 0; /* 修改为对齐右侧,以匹配侧边栏的布局 */
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-width: 14rpx 0 0 14rpx; /* 将三角形反转:顶部和左侧保留宽度,形成一个斜边向右下的直角三角形 */
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #fff transparent transparent transparent; /* 顶部为白色 */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-entry.rules {
|
||||||
|
top: 60rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-entry.mine {
|
||||||
|
top: 260rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.winners-wrap {
|
||||||
|
margin: 0 24rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
padding: 0rpx 0rpx 0rpx 30rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
border: 2rpx solid #333;
|
||||||
|
|
||||||
|
.winners-text {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #333;
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
.blue {
|
||||||
|
color: #3b7cf6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.red {
|
||||||
|
color: #cb302c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.winner-swiper {
|
||||||
|
flex: 1;
|
||||||
|
height: 36rpx;
|
||||||
|
margin-right: 8rpx;
|
||||||
|
margin-top: 4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.winners-btn {
|
||||||
|
background: #3b7cf6;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24rpx;
|
||||||
|
padding: 16rpx 20rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
white-space: nowrap;
|
||||||
|
margin-left: 16rpx;
|
||||||
|
|
||||||
|
.arrow {
|
||||||
|
margin-left: 4rpx;
|
||||||
|
font-size: 22rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.pool-wrap {
|
||||||
|
margin: 24rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 40rpx 40rpx 40rpx 40rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
|
||||||
|
|
||||||
|
.pool-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: stretch;
|
||||||
|
.pool-title-wrap{
|
||||||
|
background: #CB302C;
|
||||||
|
border-top-right-radius: 40rpx;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.pool-title {
|
||||||
|
background: #ffb611;
|
||||||
|
color: #333;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 34rpx;
|
||||||
|
padding: 10rpx 14rpx;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
margin: 10rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.sub {
|
||||||
|
font-size: 20rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-left: 8rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.pool-desc {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #666;
|
||||||
|
flex: 1;
|
||||||
|
background: #fff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 20rpx 0 30rpx;
|
||||||
|
border-bottom-left-radius: 40rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.pool-body {
|
||||||
|
padding: 30rpx 0 40rpx 20rpx;
|
||||||
|
background: #cb302c;
|
||||||
|
border-radius: 0 40rpx 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pool-swiper {
|
||||||
|
height: 374rpx;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pool-list-group {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100%;
|
||||||
|
padding: 0;
|
||||||
|
transform: scale(1.1);
|
||||||
|
transform-origin: center center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pool-item {
|
||||||
|
width: 220rpx; /* 恢复正常大小 */
|
||||||
|
margin: 0 auto;
|
||||||
|
position: relative;
|
||||||
|
flex-shrink: 0;
|
||||||
|
transform: scale(0.85); /* 默认两侧缩小 */
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
color: #333;
|
||||||
|
|
||||||
|
&.is-active {
|
||||||
|
transform: scale(1.2); /* 当前项放大 */
|
||||||
|
z-index: 10;
|
||||||
|
color: #cb302c;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-inner {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 16rpx 48rpx 16rpx 16rpx;
|
||||||
|
padding: 12rpx;
|
||||||
|
height: 270rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border: 10rpx solid #ffb611;
|
||||||
|
border-bottom-width: 60rpx;
|
||||||
|
// box-shadow: 10rpx 10rpx 0 #ffb611;
|
||||||
|
|
||||||
|
.item-dashed {
|
||||||
|
// border: 2rpx dashed #ccc;
|
||||||
|
border-radius: 8rpx 36rpx 8rpx 8rpx;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.pool-image {
|
||||||
|
width: 150rpx;
|
||||||
|
height: 150rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.prize-tag {
|
||||||
|
position: absolute;
|
||||||
|
left: -25rpx;
|
||||||
|
bottom: 20rpx;
|
||||||
|
width: 90rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
z-index: 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pool-name-wrap {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 10rpx;
|
||||||
|
right: -10rpx;
|
||||||
|
z-index: 3;
|
||||||
|
max-width: 99%;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: -10rpx;
|
||||||
|
right: 0;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-bottom: 10rpx solid #A19669;
|
||||||
|
border-right: 10rpx solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pool-name {
|
||||||
|
background: #fff;
|
||||||
|
font-size: 22rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 6rpx 10rpx;
|
||||||
|
border-radius: 30rpx 0 0 30rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-section {
|
||||||
|
margin: 60rpx 24rpx 24rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
position: relative;
|
||||||
|
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
|
||||||
|
|
||||||
|
.goods-header-box {
|
||||||
|
background: #cb302c;
|
||||||
|
border-radius: 24rpx 24rpx 0 0;
|
||||||
|
padding: 50rpx 0 20rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.goods-title-pill {
|
||||||
|
position: absolute;
|
||||||
|
top: -34rpx;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
background: #ffb611;
|
||||||
|
color: #333;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
border: 6rpx solid #fff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
white-space: nowrap;
|
||||||
|
box-shadow: 0 -6rpx 0 #CB302C;
|
||||||
|
|
||||||
|
.dot {
|
||||||
|
margin: 0 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
bottom: -16rpx;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%) rotate(-45deg);
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
border: 6rpx solid #fff;
|
||||||
|
background: #ffb611;
|
||||||
|
/* 为了不让这个三角形的边框跑到上方的背景前,可以设置层级或者利用边框隐藏等,目前看原来的效果是直接叠加在底下的。
|
||||||
|
由于要模拟原本的 .triangle 元素层级,我们用 z-index: -1 把它垫在 pill 下面即可 */
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-sub {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-list {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-item {
|
||||||
|
width: 316rpx;
|
||||||
|
background: #fff;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.goods-gift-tag {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 120rpx;
|
||||||
|
z-index: 2;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-image {
|
||||||
|
width: 100%;
|
||||||
|
height: 316rpx;
|
||||||
|
background: #f8f8f8;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-name {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #333;
|
||||||
|
line-height: 1.4;
|
||||||
|
margin: 16rpx 0;
|
||||||
|
height: 72rpx;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-bottom {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.goods-price {
|
||||||
|
color: #cb302c;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-cart {
|
||||||
|
width: 48rpx;
|
||||||
|
height: 48rpx;
|
||||||
|
background-color: #cb302c;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z'/%3E%3C/svg%3E");
|
||||||
|
background-size: 28rpx 28rpx;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
color: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,806 @@
|
|||||||
|
<template>
|
||||||
|
<view class="county-my-tickets-page">
|
||||||
|
<view class="custom-header">
|
||||||
|
<view class="tabs">
|
||||||
|
<view
|
||||||
|
v-for="tab in tabs"
|
||||||
|
:key="tab.key"
|
||||||
|
class="tab-item v12-font-bold"
|
||||||
|
:class="{ active: activeTab === tab.key }"
|
||||||
|
@click="onChangeTab(tab.key)"
|
||||||
|
>
|
||||||
|
{{ tab.label }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<scroll-view class="page-body" scroll-y>
|
||||||
|
<view class="tip-bar">
|
||||||
|
<view class="tip-text" v-if="!winnerSortedList.length">暂时无人中奖</view>
|
||||||
|
<view class="tip-text one-t" v-else-if="winnerSortedList.length === 1">
|
||||||
|
恭喜 <text class="blue">{{ winnerSortedList[0].name }}</text>
|
||||||
|
在第 <text class="blue">{{ winnerSortedList[0].periodNo }}</text> 期抽奖活动中获得
|
||||||
|
<text class="red">{{ winnerSortedList[0].prizeName }}</text>
|
||||||
|
</view>
|
||||||
|
<swiper
|
||||||
|
v-else
|
||||||
|
class="winner-swiper"
|
||||||
|
vertical
|
||||||
|
circular
|
||||||
|
autoplay
|
||||||
|
:interval="3000"
|
||||||
|
:duration="500"
|
||||||
|
>
|
||||||
|
<swiper-item v-for="(winner, index) in winnerSortedList" :key="index">
|
||||||
|
<view class="tip-text one-t">
|
||||||
|
恭喜 <text class="blue">{{ winner.name }}</text>
|
||||||
|
在第 <text class="blue">{{ winner.periodNo }}</text> 期抽奖活动中获得
|
||||||
|
<text class="red">{{ winner.prizeName }}</text>
|
||||||
|
</view>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
<view class="tip-btn" @click="goWinnersPage">查看全部 <text class="icon-expand">➔</text></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="ticket-list" v-if="displayList.length">
|
||||||
|
<view class="ticket-card" v-for="item in displayList" :key="item.id">
|
||||||
|
<view class="ticket-head">
|
||||||
|
<view class="ticket-code">
|
||||||
|
<image class="code-icon" :src="`${webUrl}/home/juan.png`" mode="aspectFit" />
|
||||||
|
<text class="code-label">抽奖码:</text>
|
||||||
|
<text class="code-value">{{ item.ticketCode || '--' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="ticket-status" :class="[ `status-${item.status}`, item.status === 0 ? 'status-pill' : '', item.status === 1 && item.claimStatus === 1 ? 'status-claimed' : '' ]">{{ getStatusText(item) }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="ticket-info-row">
|
||||||
|
<text class="label">来源订单</text>
|
||||||
|
<text class="value">{{ item.sourceOrderId || '--' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="ticket-info-row">
|
||||||
|
<text class="label">开奖时间</text>
|
||||||
|
<text class="value">{{ formatDrawTime(item.drawTime) }}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="prize-box" v-if="showPrize(item)">
|
||||||
|
恭喜获得:{{ formatPrizeText(item) }}
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="ticket-footer" v-if="item.status === 1">
|
||||||
|
<template v-if="item.claimStatus === 0">
|
||||||
|
<view class="footer-note">注意:请在{{ getClaimDaysText(item) }}内领取,过期不予发放</view>
|
||||||
|
<view class="footer-btn btn-claim" @click="onClaim(item)">立 即 领 取</view>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="item.claimStatus === 1">
|
||||||
|
<view class="footer-note done">奖品已领取</view>
|
||||||
|
<view class="footer-btn btn-order" @click="goOrder(item)">{{ isCouponPrize(item) ? '查看优惠券' : '查看订单' }}</view>
|
||||||
|
</template>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="invalid-reason" v-if="item.status === -1">
|
||||||
|
失效原因:{{ getInvalidReason(item) }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="empty-wrap" v-else>
|
||||||
|
<view class="empty-text">{{ loading ? '加载中...' : '暂无抽奖码记录' }}</view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
|
||||||
|
<view class="coupon-popup-mask" v-if="showCouponSuccessPopup" @click="closeCouponSuccessPopup">
|
||||||
|
<view class="coupon-popup" @click.stop>
|
||||||
|
<view class="popup-close" @click="closeCouponSuccessPopup">×</view>
|
||||||
|
<view class="popup-icon-wrap">
|
||||||
|
<text class="popup-icon">🎉</text>
|
||||||
|
</view>
|
||||||
|
<view class="popup-title">领取成功</view>
|
||||||
|
<view class="popup-desc">您的奖品已经领取成功,请前往“我的优惠券”查看详情</view>
|
||||||
|
<view class="popup-btn" @click="goMyCoupons">去查看我的优惠券</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { claimCoupon, getDrawLatestWinners, getDrawMyTickets } from '@/api/lottery'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'CountyMyTicketsPage',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
|
statusBarHeight: 20,
|
||||||
|
loading: false,
|
||||||
|
activeTab: 'all',
|
||||||
|
activityId: 0,
|
||||||
|
tabs: [
|
||||||
|
{ key: 'all', label: '全部' },
|
||||||
|
{ key: 'wait', label: '待开奖' },
|
||||||
|
{ key: 'opened', label: '已开奖' },
|
||||||
|
{ key: 'invalid', label: '已失效' }
|
||||||
|
],
|
||||||
|
list: [],
|
||||||
|
openedList: [],
|
||||||
|
latestWinnerList: [],
|
||||||
|
showCouponSuccessPopup: false,
|
||||||
|
claiming: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
displayList() {
|
||||||
|
return this.activeTab === 'opened' ? this.openedList : this.list
|
||||||
|
},
|
||||||
|
winnerSortedList() {
|
||||||
|
const list = this.latestWinnerList || []
|
||||||
|
if (!list.length) return []
|
||||||
|
const mapped = list.map(item => ({
|
||||||
|
name: item.realName || item.phone || '用户',
|
||||||
|
periodNo: item.periodNo || '-',
|
||||||
|
prizeName: item.prizeName || '神秘奖品'
|
||||||
|
}))
|
||||||
|
return mapped.sort((a, b) => this.getPeriodNoValue(b.periodNo) - this.getPeriodNoValue(a.periodNo))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
if (options && options.activityId) {
|
||||||
|
this.activityId = Number(options.activityId) || 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 20
|
||||||
|
this.fetchLatestWinners()
|
||||||
|
this.fetchList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getPeriodNoValue(periodNo) {
|
||||||
|
const text = String(periodNo || '')
|
||||||
|
const match = text.match(/\d+/g)
|
||||||
|
if (!match || !match.length) return 0
|
||||||
|
return Number(match.join('')) || 0
|
||||||
|
},
|
||||||
|
async fetchLatestWinners() {
|
||||||
|
try {
|
||||||
|
const res = await getDrawLatestWinners()
|
||||||
|
const winnersData = res && res.data
|
||||||
|
const list = Array.isArray(winnersData)
|
||||||
|
? winnersData
|
||||||
|
: (Array.isArray(winnersData && winnersData.list) ? winnersData.list : [])
|
||||||
|
this.latestWinnerList = list
|
||||||
|
} catch (e) {
|
||||||
|
this.latestWinnerList = []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mapTabToStatus(tab) {
|
||||||
|
const map = {
|
||||||
|
wait: 0,
|
||||||
|
invalid: -1
|
||||||
|
}
|
||||||
|
return map[tab]
|
||||||
|
},
|
||||||
|
mergeTicketListById(list = []) {
|
||||||
|
const map = new Map()
|
||||||
|
list.forEach(item => {
|
||||||
|
if (!item) return
|
||||||
|
const key = item.id || item.ticketId || item.lotteryRecordId || item.recordId || Math.random()
|
||||||
|
map.set(String(key), item)
|
||||||
|
})
|
||||||
|
return Array.from(map.values())
|
||||||
|
},
|
||||||
|
normalizeListData(res) {
|
||||||
|
if (!res) return []
|
||||||
|
if (Array.isArray(res)) return res
|
||||||
|
if (Array.isArray(res.data)) return res.data
|
||||||
|
if (Array.isArray(res.data && res.data.list)) return res.data.list
|
||||||
|
if (Array.isArray(res.list)) return res.list
|
||||||
|
return []
|
||||||
|
},
|
||||||
|
normalizeTicketItem(item = {}) {
|
||||||
|
const statusNum = Number(item.status)
|
||||||
|
const claimStatusNum = Number(item.claimStatus)
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
id: item.id || item.lotteryRecordId || item.ticketId || item.recordId || '',
|
||||||
|
ticketCode: item.ticketCode || item.code || '',
|
||||||
|
status: Number.isNaN(statusNum) ? -999 : statusNum,
|
||||||
|
claimStatus: Number.isNaN(claimStatusNum) ? 0 : claimStatusNum,
|
||||||
|
sourceOrderId: item.sourceOrderId || item.orderId || item.orderNo || '',
|
||||||
|
drawTime: item.drawTime || item.openTime || '',
|
||||||
|
claimDeadline: item.claimDeadline || '',
|
||||||
|
levelName: item.levelName || item.prizeLevelName || item.awardLevelName || '',
|
||||||
|
prizeName: item.prizeName || item.awardName || '',
|
||||||
|
prizeType: item.prizeType || item.awardType || '',
|
||||||
|
prizeTypeName: item.prizeTypeName || item.awardTypeName || ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
filterByActivity(list = []) {
|
||||||
|
if (!this.activityId) return list
|
||||||
|
return list.filter(item => Number(item.activityId || item.drawActivityId || 0) === this.activityId)
|
||||||
|
},
|
||||||
|
filterByTab(list = []) {
|
||||||
|
if (this.activeTab === 'wait') {
|
||||||
|
return list.filter(item => item.status === 0)
|
||||||
|
}
|
||||||
|
if (this.activeTab === 'opened') {
|
||||||
|
return list.filter(item => item.status === 1 || item.status === 2)
|
||||||
|
}
|
||||||
|
if (this.activeTab === 'invalid') {
|
||||||
|
return list.filter(item => item.status === -1)
|
||||||
|
}
|
||||||
|
return list
|
||||||
|
},
|
||||||
|
onChangeTab(tab) {
|
||||||
|
if (this.activeTab === tab) return
|
||||||
|
this.activeTab = tab
|
||||||
|
this.fetchList()
|
||||||
|
},
|
||||||
|
goWinnersPage() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pkg-video/views/county-winners?activityId=${this.activityId}`
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async fetchList() {
|
||||||
|
this.loading = true
|
||||||
|
try {
|
||||||
|
// 已开奖需要包含:1-已中奖、2-未中奖
|
||||||
|
if (this.activeTab === 'opened') {
|
||||||
|
const [winRes, loseRes] = await Promise.all([
|
||||||
|
getDrawMyTickets(1),
|
||||||
|
getDrawMyTickets(2)
|
||||||
|
])
|
||||||
|
const winList = this.normalizeListData(winRes).map(this.normalizeTicketItem)
|
||||||
|
const loseList = this.normalizeListData(loseRes).map(this.normalizeTicketItem)
|
||||||
|
const merged = this.mergeTicketListById([...winList, ...loseList])
|
||||||
|
const openedAllList = this.filterByActivity(merged)
|
||||||
|
this.openedList = openedAllList
|
||||||
|
this.list = openedAllList
|
||||||
|
} else {
|
||||||
|
const status = this.mapTabToStatus(this.activeTab)
|
||||||
|
const res = await getDrawMyTickets(status)
|
||||||
|
const allList = this.filterByActivity(this.normalizeListData(res).map(this.normalizeTicketItem))
|
||||||
|
this.openedList = allList.filter(item => item.status === 1 || item.status === 2)
|
||||||
|
this.list = this.filterByTab(allList)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.list = []
|
||||||
|
this.openedList = []
|
||||||
|
uni.showToast({
|
||||||
|
title: '抽奖码加载失败',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getStatusText(item) {
|
||||||
|
const status = Number(item.status)
|
||||||
|
if (status === 0) return '等待开奖'
|
||||||
|
if (status === 1) return item.claimStatus === 1 ? '已领取' : '已开奖'
|
||||||
|
if (status === 2) return '未中奖'
|
||||||
|
if (status === -1) return '已失效'
|
||||||
|
return '--'
|
||||||
|
},
|
||||||
|
showPrize(item) {
|
||||||
|
return [1, 2, -1].includes(Number(item.status)) && !!item.prizeName
|
||||||
|
},
|
||||||
|
getInvalidReason(item) {
|
||||||
|
return item.invalidReason || ''
|
||||||
|
},
|
||||||
|
formatPrizeText(item = {}) {
|
||||||
|
const prizeName = item.prizeName || '神秘奖品'
|
||||||
|
const levelName = String(item.levelName || '').trim()
|
||||||
|
if (!levelName) return prizeName
|
||||||
|
if (/等奖$/.test(levelName)) {
|
||||||
|
return `${levelName}${prizeName}`
|
||||||
|
}
|
||||||
|
return `${levelName}等奖${prizeName}`
|
||||||
|
},
|
||||||
|
isCouponPrize(item = {}) {
|
||||||
|
const prizeType = String(item.prizeType || '').toLowerCase()
|
||||||
|
const prizeTypeName = String(item.prizeTypeName || '')
|
||||||
|
const prizeName = String(item.prizeName || '')
|
||||||
|
if (prizeType === 'coupon' || prizeType === '3') return true
|
||||||
|
return /券/.test(prizeTypeName) || /券/.test(prizeName)
|
||||||
|
},
|
||||||
|
formatDrawTime(time) {
|
||||||
|
if (!time) return '--'
|
||||||
|
const date = new Date(String(time).replace(/-/g, '/'))
|
||||||
|
if (Number.isNaN(date.getTime())) return time
|
||||||
|
const y = date.getFullYear()
|
||||||
|
const m = String(date.getMonth() + 1).padStart(2, '0')
|
||||||
|
const d = String(date.getDate()).padStart(2, '0')
|
||||||
|
const hh = String(date.getHours()).padStart(2, '0')
|
||||||
|
const mm = String(date.getMinutes()).padStart(2, '0')
|
||||||
|
return `${y}年${m}月${d}日 ${hh}:${mm}`
|
||||||
|
},
|
||||||
|
formatDateTime(time) {
|
||||||
|
if (!time) return '--'
|
||||||
|
const text = String(time).trim()
|
||||||
|
const date = new Date(text.replace(/-/g, '/'))
|
||||||
|
if (Number.isNaN(date.getTime())) return text
|
||||||
|
const y = date.getFullYear()
|
||||||
|
const m = String(date.getMonth() + 1).padStart(2, '0')
|
||||||
|
const d = String(date.getDate()).padStart(2, '0')
|
||||||
|
const hh = String(date.getHours()).padStart(2, '0')
|
||||||
|
const mm = String(date.getMinutes()).padStart(2, '0')
|
||||||
|
const ss = String(date.getSeconds()).padStart(2, '0')
|
||||||
|
return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
|
||||||
|
},
|
||||||
|
getClaimDeadlineText(item = {}) {
|
||||||
|
return this.formatDateTime(item.claimDeadline || '')
|
||||||
|
},
|
||||||
|
getClaimDaysText(item = {}) {
|
||||||
|
const drawTime = String(item.drawTime || '').trim()
|
||||||
|
const claimDeadline = String(item.claimDeadline || '').trim()
|
||||||
|
if (!drawTime || !claimDeadline) return '--'
|
||||||
|
const drawDate = new Date(drawTime.replace(/-/g, '/'))
|
||||||
|
const deadlineDate = new Date(claimDeadline.replace(/-/g, '/'))
|
||||||
|
if (Number.isNaN(drawDate.getTime()) || Number.isNaN(deadlineDate.getTime())) return '--'
|
||||||
|
const diff = deadlineDate.getTime() - drawDate.getTime()
|
||||||
|
if (diff <= 0) return '0天'
|
||||||
|
const days = Math.ceil(diff / (24 * 60 * 60 * 1000))
|
||||||
|
return `${days}天`
|
||||||
|
},
|
||||||
|
async onClaim(item) {
|
||||||
|
if (!item.id) return
|
||||||
|
if (this.claiming) return
|
||||||
|
if (this.isCouponPrize(item)) {
|
||||||
|
this.claiming = true
|
||||||
|
uni.showLoading({ title: '领取中...' })
|
||||||
|
try {
|
||||||
|
await claimCoupon(Number(item.id))
|
||||||
|
this.showCouponSuccessPopup = true
|
||||||
|
this.fetchList()
|
||||||
|
} catch (e) {
|
||||||
|
uni.showToast({
|
||||||
|
title: (e && e.msg) || (e && e.message) || '领取失败',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading()
|
||||||
|
this.claiming = false
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const queryParams = {
|
||||||
|
...item,
|
||||||
|
lotteryRecordId: item.lotteryRecordId || item.id || ''
|
||||||
|
}
|
||||||
|
const query = Object.keys(queryParams)
|
||||||
|
.filter((key) => queryParams[key] !== undefined && queryParams[key] !== null && typeof queryParams[key] !== 'object')
|
||||||
|
.map((key) => `${key}=${encodeURIComponent(queryParams[key])}`)
|
||||||
|
.join('&')
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pkg-video/views/county-claim-address?${query}`
|
||||||
|
})
|
||||||
|
},
|
||||||
|
closeCouponSuccessPopup() {
|
||||||
|
this.showCouponSuccessPopup = false
|
||||||
|
},
|
||||||
|
goMyCoupons() {
|
||||||
|
this.showCouponSuccessPopup = false
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pkg_user/views/myCoupons'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goOrder(item) {
|
||||||
|
if (this.isCouponPrize(item)) {
|
||||||
|
this.goMyCoupons()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!item.prizeOrderId) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '缺少订单号',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pagesOrder/order/OrderDetails/index?id=${item.prizeOrderId}`
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goBack() {
|
||||||
|
if (getCurrentPages().length > 1) {
|
||||||
|
uni.navigateBack()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/home/index'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.county-my-tickets-page {
|
||||||
|
min-height: 100vh;
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-header {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 20;
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-inner {
|
||||||
|
height: 88rpx;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-back {
|
||||||
|
width: 56rpx;
|
||||||
|
height: 56rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-back-icon {
|
||||||
|
font-size: 60rpx;
|
||||||
|
color: #111;
|
||||||
|
line-height: 1;
|
||||||
|
margin-top: -4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-title {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
margin-left: 56rpx;
|
||||||
|
font-size: 34rpx;
|
||||||
|
color: #333;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-right {
|
||||||
|
width: 88rpx;
|
||||||
|
height: 44rpx;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
border: 2rpx solid #d8d8d8;
|
||||||
|
background: #fff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right-dot {
|
||||||
|
width: 8rpx;
|
||||||
|
height: 8rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #111;
|
||||||
|
margin-right: 14rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right-ring {
|
||||||
|
width: 18rpx;
|
||||||
|
height: 18rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 2rpx solid #111;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabs {
|
||||||
|
height: 80rpx;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-item {
|
||||||
|
margin-right: 20rpx;
|
||||||
|
padding: 8rpx 24rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
color: #666;
|
||||||
|
font-size: 26rpx;
|
||||||
|
background: #fff;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-item.active {
|
||||||
|
color: #BD3124;
|
||||||
|
background: rgba(220,60,53,0.39);
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-body {
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: calc(100vh - 120rpx);
|
||||||
|
margin-top: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tip-bar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 10rpx 24rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #666;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 160rpx;
|
||||||
|
margin: 0 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tip-text {
|
||||||
|
flex: 1;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #333;
|
||||||
|
|
||||||
|
.blue {
|
||||||
|
color: #3b7cf6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.red {
|
||||||
|
color: #cb302c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.winner-swiper {
|
||||||
|
flex: 1;
|
||||||
|
height: 36rpx;
|
||||||
|
margin-right: 8rpx;
|
||||||
|
margin-top: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tip-btn {
|
||||||
|
background: #FCF9EA;
|
||||||
|
padding: 6rpx 16rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #333;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-expand {
|
||||||
|
font-size: 20rpx;
|
||||||
|
margin-left: 4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-list {
|
||||||
|
padding-top: 10rpx;
|
||||||
|
padding-bottom: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-card {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
margin: 0 24rpx 20rpx;
|
||||||
|
padding: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-head {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
border-bottom: 2rpx dashed #eee;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-code {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-icon {
|
||||||
|
margin-right: 8rpx;
|
||||||
|
width: 44rpx;
|
||||||
|
height: 44rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-label {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
margin-right: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-value {
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: 1rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-status {
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-pill {
|
||||||
|
background: #BD3124;
|
||||||
|
color: #fff;
|
||||||
|
padding: 4rpx 16rpx;
|
||||||
|
border-radius: 20rpx 0 0 20rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: normal;
|
||||||
|
position: absolute;
|
||||||
|
right: -24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-0 {
|
||||||
|
/* handled by pill */
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-1,
|
||||||
|
.status-2 {
|
||||||
|
color: #BD3124;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-claimed {
|
||||||
|
color: #999 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status--1 {
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-info-row {
|
||||||
|
margin-top: 14rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-info-row .label {
|
||||||
|
color: #999;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-info-row .value {
|
||||||
|
color: #333;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prize-box {
|
||||||
|
margin-top: 24rpx;
|
||||||
|
border: 2rpx solid #BD3124;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
color: #BD3124;
|
||||||
|
font-size: 30rpx;
|
||||||
|
text-align: center;
|
||||||
|
padding: 16rpx 0;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-footer {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-note {
|
||||||
|
flex: 1;
|
||||||
|
color: #BD3124;
|
||||||
|
font-size: 22rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-note.done {
|
||||||
|
color: #BD3124;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-btn {
|
||||||
|
width: 170rpx;
|
||||||
|
height: 54rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 26rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-claim {
|
||||||
|
background: #BD3124;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-order {
|
||||||
|
background: #BD3124;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invalid-reason {
|
||||||
|
margin-top: 14rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #BD3124;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-wrap {
|
||||||
|
padding-top: 120rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-text {
|
||||||
|
color: #999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.coupon-popup-mask {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 1000;
|
||||||
|
background: rgba(0, 0, 0, 0.55);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.coupon-popup {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 620rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 32rpx;
|
||||||
|
padding: 26rpx 34rpx 42rpx;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-close {
|
||||||
|
position: absolute;
|
||||||
|
right: 18rpx;
|
||||||
|
top: 18rpx;
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 2rpx solid #333;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #333;
|
||||||
|
text-align: center;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-icon-wrap {
|
||||||
|
width: 112rpx;
|
||||||
|
height: 112rpx;
|
||||||
|
margin: 20rpx auto 8rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-icon {
|
||||||
|
font-size: 70rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-title {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 60rpx;
|
||||||
|
font-weight: 900;
|
||||||
|
color: #222;
|
||||||
|
margin-top: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-desc {
|
||||||
|
margin: 38rpx auto 42rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 28rpx;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: #9a9a9a;
|
||||||
|
width: 92%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-btn {
|
||||||
|
width: 86%;
|
||||||
|
height: 96rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
border-radius: 48rpx;
|
||||||
|
background: #c43124;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: 900;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 96rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,300 @@
|
|||||||
|
<template>
|
||||||
|
<view class="realname-page">
|
||||||
|
<!-- <view class="custom-header" :style="{ paddingTop: `${statusBarHeight}px` }">
|
||||||
|
<view class="header-inner">
|
||||||
|
<view class="header-back" @click="goBack">
|
||||||
|
<u-icon name="arrow-left" size="24" color="#333" class="header-back-icon"></u-icon>
|
||||||
|
</view>
|
||||||
|
<view class="header-title">实名认证</view>
|
||||||
|
<view class="header-right">
|
||||||
|
<view class="dot"></view>
|
||||||
|
<view class="ring"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
|
||||||
|
<view class="page-body">
|
||||||
|
<view class="body-title">请完善以下信息</view>
|
||||||
|
<view class="body-desc">根据平台活动规则,领取电子数码产品需要进行实名认。
|
||||||
|
我们会对信息进行严格保密</view>
|
||||||
|
|
||||||
|
<view class="form-wrap">
|
||||||
|
<view class="form-row">
|
||||||
|
<text class="required">*</text>
|
||||||
|
<text class="label">真实姓名</text>
|
||||||
|
<input v-model="form.realName" class="input" placeholder="请输入真实姓名" placeholder-style="color:#999;" />
|
||||||
|
</view>
|
||||||
|
<view class="form-row">
|
||||||
|
<text class="required">*</text>
|
||||||
|
<text class="label">身份证号</text>
|
||||||
|
<input v-model="form.idCard" class="input" placeholder="请输入身份证号码" placeholder-style="color:#999;" />
|
||||||
|
</view>
|
||||||
|
<view class="form-row">
|
||||||
|
<text class="required">*</text>
|
||||||
|
<text class="label">手机号</text>
|
||||||
|
<input
|
||||||
|
v-model="form.phone"
|
||||||
|
class="input"
|
||||||
|
type="number"
|
||||||
|
maxlength="11"
|
||||||
|
placeholder="请输入手机号"
|
||||||
|
placeholder-style="color:#999;"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="submit-wrap">
|
||||||
|
<view class="submit-btn" @click="submitAuth">提交认证</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getDrawRealname, submitDrawRealname } from '@/api/lottery'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'CountyRealnamePage',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
statusBarHeight: 20,
|
||||||
|
form: {
|
||||||
|
realName: '',
|
||||||
|
idCard: '',
|
||||||
|
phone: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 20
|
||||||
|
this.fetchRealnameStatus()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fetchRealnameStatus() {
|
||||||
|
getDrawRealname().then((res) => {
|
||||||
|
const data = (res && res.data) || {}
|
||||||
|
if (Number(data.status) === 1) {
|
||||||
|
uni.setStorageSync('countyClaimAuthDone', 1)
|
||||||
|
uni.showToast({
|
||||||
|
title: data.result || '已完成实名认证',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
this.backToClaimPage()
|
||||||
|
}, 300)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
backToClaimPage() {
|
||||||
|
const targetRoute = 'pkg-video/views/county-claim-address'
|
||||||
|
const pages = getCurrentPages()
|
||||||
|
const targetIndex = pages.findIndex(
|
||||||
|
item =>
|
||||||
|
item.route === targetRoute ||
|
||||||
|
item.route === `/${targetRoute}`
|
||||||
|
)
|
||||||
|
if (targetIndex >= 0) {
|
||||||
|
const delta = pages.length - 1 - targetIndex
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: delta > 0 ? delta : 1
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uni.redirectTo({
|
||||||
|
url: '/pkg-video/views/county-claim-address'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goBack() {
|
||||||
|
uni.navigateBack()
|
||||||
|
},
|
||||||
|
async submitAuth() {
|
||||||
|
if (!this.form.realName) {
|
||||||
|
uni.showToast({ title: '请输入真实姓名', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const idCard = String(this.form.idCard || '').trim().toUpperCase()
|
||||||
|
this.form.idCard = idCard
|
||||||
|
if (!/^\d{15}$|^\d{17}[\dX]$/.test(idCard)) {
|
||||||
|
uni.showToast({ title: '请输入正确身份证号', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!/^1\d{10}$/.test(this.form.phone)) {
|
||||||
|
uni.showToast({ title: '请输入正确手机号', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uni.showLoading({ title: '认证中...' })
|
||||||
|
try {
|
||||||
|
const res = await submitDrawRealname({
|
||||||
|
realName: this.form.realName,
|
||||||
|
idCard,
|
||||||
|
phone: this.form.phone
|
||||||
|
})
|
||||||
|
const data = (res && res.data) || {}
|
||||||
|
if (Number(data.status) !== 1) {
|
||||||
|
uni.showToast({
|
||||||
|
title: data.result || '认证失败,请重试',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uni.setStorageSync('countyClaimAuthDone', 1)
|
||||||
|
uni.showToast({
|
||||||
|
title: data.result || '认证成功',
|
||||||
|
icon: 'success'
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
this.backToClaimPage()
|
||||||
|
}, 350)
|
||||||
|
} catch (e) {
|
||||||
|
uni.showToast({
|
||||||
|
title: (e && e.msg) || (e && e.message) || '认证失败',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
// uni.hideLoading()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.realname-page {
|
||||||
|
min-height: 100vh;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-header {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 20;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-inner {
|
||||||
|
height: 88rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-back {
|
||||||
|
width: 56rpx;
|
||||||
|
height: 56rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-back-icon {
|
||||||
|
font-size: 60rpx;
|
||||||
|
color: #111;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-title {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #222;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-right {
|
||||||
|
width: 88rpx;
|
||||||
|
height: 44rpx;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
border: 2rpx solid #d8d8d8;
|
||||||
|
background: #fff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dot {
|
||||||
|
width: 8rpx;
|
||||||
|
height: 8rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #111;
|
||||||
|
margin-right: 14rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ring {
|
||||||
|
width: 18rpx;
|
||||||
|
height: 18rpx;
|
||||||
|
border: 2rpx solid #111;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-body {
|
||||||
|
padding: 28rpx 24rpx 180rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.body-title {
|
||||||
|
font-size: 40rpx;
|
||||||
|
color: #333;
|
||||||
|
font-weight: 700;
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.body-desc {
|
||||||
|
margin-top: 12rpx;
|
||||||
|
color: #666;
|
||||||
|
font-size: 28rpx;
|
||||||
|
line-height: 1.45;
|
||||||
|
padding: 20rpx;
|
||||||
|
background: rgba(244,244,244,0.39);
|
||||||
|
border-radius: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-wrap {
|
||||||
|
margin-top: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-row {
|
||||||
|
height: 94rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border-bottom: 2rpx solid #efefef;
|
||||||
|
}
|
||||||
|
|
||||||
|
.required {
|
||||||
|
color: #c23225;
|
||||||
|
font-size: 28rpx;
|
||||||
|
margin-right: 4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
width: 150rpx;
|
||||||
|
color: #333;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit-wrap {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
padding: 18rpx 24rpx calc(18rpx + env(safe-area-inset-bottom));
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit-btn {
|
||||||
|
border-radius: 44rpx;
|
||||||
|
background: #bd3124;
|
||||||
|
color: #fff;
|
||||||
|
line-height: 88rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 38rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: 14rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -104,7 +104,7 @@ export default {
|
|||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
console.log('用户点击确定')
|
console.log('用户点击确定')
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/user/Points/index'
|
url: '/pagesUser/user/Points/index'
|
||||||
})
|
})
|
||||||
} else if (res.cancel) {
|
} else if (res.cancel) {
|
||||||
console.log('用户点击取消')
|
console.log('用户点击取消')
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
navToPoint() {
|
navToPoint() {
|
||||||
uni.navigateTo({url: '/pages/user/Points/index'})
|
uni.navigateTo({url: '/pagesUser/user/Points/index'})
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
getDetail().then(res => {
|
getDetail().then(res => {
|
||||||
|
|||||||
+95
-36
@@ -11,7 +11,7 @@
|
|||||||
<view class="name one-t">{{ item.username }}</view>
|
<view class="name one-t">{{ item.username }}</view>
|
||||||
<text class="msg" v-if="item.msg_type===0">{{ item.msg_content }}</text>
|
<text class="msg" v-if="item.msg_type===0">{{ item.msg_content }}</text>
|
||||||
<view class="msg" v-if="item.msg_type===1">
|
<view class="msg" v-if="item.msg_type===1">
|
||||||
<image class="img" :src="item.msg_content" @click="preview(item.msg_content)"></image>
|
<image class="img" :src="imgUrl(item.msg_content)" @click="preview(imgUrl(item.msg_content))"></image>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
<view class="name one-t">{{ item.username }}</view>
|
<view class="name one-t">{{ item.username }}</view>
|
||||||
<text class="msg" v-if="item.msg_type===0">{{ item.msg_content }}</text>
|
<text class="msg" v-if="item.msg_type===0">{{ item.msg_content }}</text>
|
||||||
<view class="msg" v-if="item.msg_type===1">
|
<view class="msg" v-if="item.msg_type===1">
|
||||||
<image class="img" :src="item.msg_content" @click="preview(item.msg_content)"></image>
|
<image class="img" :src="imgUrl(item.msg_content)" @click="preview(imgUrl(item.msg_content))"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="msg v12-d-flex" style="box-sizing: content-box" v-if="item.msg_type===2" @click="toGoods(item)">
|
<view class="msg v12-d-flex" style="box-sizing: content-box" v-if="item.msg_type===2" @click="toGoods(item)">
|
||||||
<view class="goods-logo">
|
<view class="goods-logo">
|
||||||
@@ -108,8 +108,11 @@ export default {
|
|||||||
uploadToken: null, //上传token
|
uploadToken: null, //上传token
|
||||||
|
|
||||||
socketOpen: false,
|
socketOpen: false,
|
||||||
|
socketConnecting: false, // 是否正在建连
|
||||||
socketTask: null,
|
socketTask: null,
|
||||||
socketMsgQueue: [],
|
socketMsgQueue: [],
|
||||||
|
hasConnected: false, // 是否成功建过连接
|
||||||
|
reconnectHistory: false, // 重连后用服务端历史整体替换本地列表,防止消息重复
|
||||||
|
|
||||||
roomId: null, //房间ID
|
roomId: null, //房间ID
|
||||||
content: "", //消息内容
|
content: "", //消息内容
|
||||||
@@ -136,30 +139,22 @@ export default {
|
|||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.content = uni.getStorageSync(this.merName+this.uid+this.storeId)
|
this.content = uni.getStorageSync(this.merName+this.uid+this.storeId)
|
||||||
|
// 已连接/连接中不重复建连;清空 list 会导致图片操作(触发 onHide/onShow)后页面白屏
|
||||||
|
if (!this.socketOpen && !this.socketConnecting) {
|
||||||
this.connectSocketInit();
|
this.connectSocketInit();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
if (this.socketOpen) {
|
this.closeSocket();
|
||||||
this.socketTask.close();
|
|
||||||
}
|
|
||||||
uni.onSocketClose(res => {
|
|
||||||
console.log('WebSocket 已关闭!', res);
|
|
||||||
});
|
|
||||||
uni.setStorageSync(this.merName+this.uid+this.storeId, this.content)
|
uni.setStorageSync(this.merName+this.uid+this.storeId, this.content)
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
if (this.socketOpen) {
|
this.closeSocket();
|
||||||
this.socketTask.close();
|
|
||||||
}
|
|
||||||
uni.onSocketClose(res => {
|
|
||||||
console.log('WebSocket 已关闭!', res);
|
|
||||||
});
|
|
||||||
uni.setStorageSync(this.merName+this.uid+this.storeId, this.content)
|
uni.setStorageSync(this.merName+this.uid+this.storeId, this.content)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toGoods(item) {
|
toGoods(item) {
|
||||||
console.log(item);
|
const itemJson = this.wsJson(item.msg_content)
|
||||||
const itemJson = JSON.parse(item.msg_content)
|
|
||||||
if(!itemJson.goodsId) {
|
if(!itemJson.goodsId) {
|
||||||
// 提示数据错误
|
// 提示数据错误
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
@@ -177,7 +172,18 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
wsJson(json) {
|
wsJson(json) {
|
||||||
return JSON.parse(json)
|
// 兼容脏数据,避免渲染时报错导致白屏
|
||||||
|
try {
|
||||||
|
return JSON.parse(json) || {}
|
||||||
|
} catch (e) {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 拼接图片完整地址:七牛上传后消息里只存 key,需要补上资源域名;http 统一转 https
|
||||||
|
imgUrl(content) {
|
||||||
|
if (!content) return ''
|
||||||
|
if (/^https?:\/\//i.test(content)) return content.replace(/^http:\/\//i, 'https://')
|
||||||
|
return this.webUrl + '/' + content
|
||||||
},
|
},
|
||||||
getUploadToken() {
|
getUploadToken() {
|
||||||
let that = this;
|
let that = this;
|
||||||
@@ -249,33 +255,68 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 进入这个页面的时候创建websocket连接【整个页面随时使用】
|
// 进入页面时创建websocket连接【整个页面随时使用】
|
||||||
connectSocketInit() {
|
connectSocketInit() {
|
||||||
|
if (this.socketOpen || this.socketConnecting) return;
|
||||||
|
this.socketConnecting = true;
|
||||||
|
|
||||||
// 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
|
// 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
|
||||||
this.socketTask = uni.connectSocket({
|
const task = uni.connectSocket({
|
||||||
url: this.$SOCKET_URL,
|
url: this.$SOCKET_URL,
|
||||||
success: () => {
|
success: () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if (!task) {
|
||||||
|
this.socketConnecting = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.socketTask = task;
|
||||||
|
|
||||||
uni.onSocketOpen(res => {
|
// 任务级回调:全局 uni.onSocket* 每次进页面都会重复注册,导致消息重复处理、连接串台
|
||||||
console.log('WebSocket连接已打开!', res);
|
const isCurrent = () => this.socketTask === task;
|
||||||
|
|
||||||
|
task.onOpen(() => {
|
||||||
|
if (!isCurrent()) return;
|
||||||
this.socketOpen = true;
|
this.socketOpen = true;
|
||||||
|
this.socketConnecting = false;
|
||||||
|
// 断线重连后重新加入房间;本地已有历史时用服务端历史整体替换,避免重复
|
||||||
|
this.reconnectHistory = this.hasConnected && this.list.length > 0;
|
||||||
|
this.hasConnected = true;
|
||||||
this.createRoom();
|
this.createRoom();
|
||||||
|
// 补发连接未就绪期间排队的消息(如发图片时连接被隐藏页关闭)
|
||||||
|
if (this.socketMsgQueue.length) {
|
||||||
|
const queue = this.socketMsgQueue.splice(0);
|
||||||
|
queue.forEach(msg => this.sendSocketMessage(msg));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
uni.onSocketError(err => {
|
task.onMessage(res => {
|
||||||
console.log('WebSocket连接打开失败,请检查!', err);
|
if (!isCurrent()) return;
|
||||||
});
|
|
||||||
|
|
||||||
uni.onSocketMessage(res => {
|
|
||||||
console.log('收到服务器内容:', res.data);
|
|
||||||
this.handleMessage(res.data);
|
this.handleMessage(res.data);
|
||||||
});
|
});
|
||||||
|
|
||||||
uni.onSocketClose(res => {
|
task.onError(err => {
|
||||||
console.log('WebSocket 已关闭!', res);
|
console.log('WebSocket连接打开失败,请检查!', err);
|
||||||
|
if (!isCurrent()) return;
|
||||||
|
this.socketOpen = false;
|
||||||
|
this.socketConnecting = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
task.onClose(() => {
|
||||||
|
if (!isCurrent()) return;
|
||||||
|
this.socketOpen = false;
|
||||||
|
this.socketConnecting = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
closeSocket() {
|
||||||
|
this.socketOpen = false;
|
||||||
|
this.socketConnecting = false;
|
||||||
|
if (this.socketTask) {
|
||||||
|
try {
|
||||||
|
this.socketTask.close({});
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
userInput(event) {
|
userInput(event) {
|
||||||
@@ -315,11 +356,14 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
sendSocketMessage(msg) {
|
sendSocketMessage(msg) {
|
||||||
if (this.socketOpen) {
|
if (this.socketOpen && this.socketTask) {
|
||||||
uni.sendSocketMessage({
|
this.socketTask.send({
|
||||||
data: msg,
|
data: msg,
|
||||||
success(res) {
|
fail: () => {
|
||||||
console.log("消息发送成功", res,msg);
|
// 发送失败说明连接可能已断开,重新排队并尝试重连后补发
|
||||||
|
this.socketMsgQueue.push(msg);
|
||||||
|
this.closeSocket();
|
||||||
|
this.connectSocketInit();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -328,7 +372,12 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleMessage(str) {
|
handleMessage(str) {
|
||||||
let data = JSON.parse(str);
|
let data;
|
||||||
|
try {
|
||||||
|
data = JSON.parse(str);
|
||||||
|
} catch (e) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
case "room_id":
|
case "room_id":
|
||||||
this.roomId = data.msg_content;
|
this.roomId = data.msg_content;
|
||||||
@@ -338,13 +387,23 @@ export default {
|
|||||||
case "leave":
|
case "leave":
|
||||||
break;
|
break;
|
||||||
case "msg":
|
case "msg":
|
||||||
|
if (data.msg_content) {
|
||||||
this.list.push(data.msg_content);
|
this.list.push(data.msg_content);
|
||||||
this.scrollLast();
|
this.scrollLast();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "msg_history":
|
case "msg_history": {
|
||||||
this.list = data.msg_content.concat(this.list);
|
const history = data.msg_content || [];
|
||||||
|
if (this.reconnectHistory) {
|
||||||
|
// 重连后服务端重发历史:整体替换,避免消息重复
|
||||||
|
this.reconnectHistory = false;
|
||||||
|
this.list = history;
|
||||||
|
} else {
|
||||||
|
this.list = history.concat(this.list);
|
||||||
|
}
|
||||||
this.scrollLast();
|
this.scrollLast();
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -396,7 +396,7 @@
|
|||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="form.isDraft === 0 && form.reviewStatus !== 1">
|
<view v-if="form.reviewStatus !== 1">
|
||||||
<view
|
<view
|
||||||
class="v12-primary v12-white-text submit-btn"
|
class="v12-primary v12-white-text submit-btn"
|
||||||
:style="{'background': form.reviewStatus === 0 ? '#FA979F !important' : '#4A97FC'}"
|
:style="{'background': form.reviewStatus === 0 ? '#FA979F !important' : '#4A97FC'}"
|
||||||
@@ -405,19 +405,19 @@
|
|||||||
{{ form.reviewStatus === 0 ? '撤销申请' : form.reviewStatus === 2 ? '重新提交' : '提交审核' }}
|
{{ form.reviewStatus === 0 ? '撤销申请' : form.reviewStatus === 2 ? '重新提交' : '提交审核' }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="form.reviewStatus === null || (form.isDraft === 1 && form.reviewStatus === 0)">
|
<!-- <view v-if="form.reviewStatus === null || (form.isDraft === 1 && form.reviewStatus === 0)">
|
||||||
<view
|
<view
|
||||||
class="v12-primary v12-white-text submit-btn"
|
class="v12-primary v12-white-text submit-btn"
|
||||||
@click="submitForm"
|
@click="submitForm"
|
||||||
>
|
>
|
||||||
提交审核
|
提交审核
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<u-popup
|
<u-popup
|
||||||
:show="show"
|
:show="show"
|
||||||
mode="center"
|
mode="center"
|
||||||
round="10"
|
round="10"
|
||||||
@close="show=false"
|
@close="handlePopupClose"
|
||||||
>
|
>
|
||||||
<view class="popup-body">
|
<view class="popup-body">
|
||||||
<view class="tc bold">
|
<view class="tc bold">
|
||||||
@@ -440,7 +440,6 @@
|
|||||||
<u-button
|
<u-button
|
||||||
type="error"
|
type="error"
|
||||||
text="确定"
|
text="确定"
|
||||||
:disabled="!isAgree"
|
|
||||||
@click="savePopup"
|
@click="savePopup"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
@@ -451,7 +450,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import CitySelect from '@/components/CitySelect'
|
import CitySelect from '@/components/CitySelect'
|
||||||
import { getCity, registerVerify } from '@/api/user'
|
import { getCity, registerVerify } from '@/api/user'
|
||||||
import { uploadVideo, uploadImage } from '@/utils'
|
import { uploadVideo, uploadImage, formatRichText } from '@/utils'
|
||||||
import {
|
import {
|
||||||
getShopData,
|
getShopData,
|
||||||
saveExperienceStore,
|
saveExperienceStore,
|
||||||
@@ -480,7 +479,8 @@ export default {
|
|||||||
videos: [],
|
videos: [],
|
||||||
district: [],
|
district: [],
|
||||||
qualificationImg: [],
|
qualificationImg: [],
|
||||||
partnerId: 0,
|
partnerId: '',
|
||||||
|
promoterUid: '',
|
||||||
experienceStoreCategoryList: [],
|
experienceStoreCategoryList: [],
|
||||||
experienceStoreCategoryIndex: 0,
|
experienceStoreCategoryIndex: 0,
|
||||||
form: {
|
form: {
|
||||||
@@ -518,10 +518,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(opts) {
|
onLoad(opts) {
|
||||||
this.partnerId = opts.partnerId
|
this.partnerId = opts.partnerId || ''
|
||||||
|
this.promoterUid = opts.promoterUid || ''
|
||||||
|
uni.showLoading({ title: '加载中...', mask: true })
|
||||||
this.queryCity()
|
this.queryCity()
|
||||||
getShopData().then(({ data }) => {
|
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({ data }) => {
|
||||||
this.notice = data.merchantApplyNotice
|
this.notice = formatRichText(data.merchantApplyNotice)
|
||||||
})
|
})
|
||||||
getExperienceStoreCategoryList().then(({ data }) => {
|
getExperienceStoreCategoryList().then(({ data }) => {
|
||||||
this.experienceStoreCategoryList = data || []
|
this.experienceStoreCategoryList = data || []
|
||||||
@@ -529,6 +531,8 @@ export default {
|
|||||||
this.experienceStoreCategoryIndex = 0
|
this.experienceStoreCategoryIndex = 0
|
||||||
}
|
}
|
||||||
this.initInfo()
|
this.initInfo()
|
||||||
|
}).catch(() => {
|
||||||
|
uni.hideLoading()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
@@ -575,12 +579,31 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.form.isDraft = 1
|
this.form.isDraft = 1
|
||||||
this.show = true
|
this.show = true
|
||||||
|
}).finally(() => {
|
||||||
|
uni.hideLoading()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
changeAgree(e) {
|
changeAgree(e) {
|
||||||
this.isAgree = e.detail.value.includes('yes')
|
this.isAgree = e.detail.value.includes('yes')
|
||||||
},
|
},
|
||||||
savePopup() {
|
savePopup() {
|
||||||
|
if (!this.isAgree) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请先阅读并同意入驻申请须知',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.show = false
|
||||||
|
},
|
||||||
|
handlePopupClose() {
|
||||||
|
if (!this.isAgree) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请先阅读并同意入驻申请须知',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
this.show = false
|
this.show = false
|
||||||
},
|
},
|
||||||
stringToMapArr(str, split = ',') {
|
stringToMapArr(str, split = ',') {
|
||||||
@@ -863,6 +886,25 @@ export default {
|
|||||||
height: 52vh;
|
height: 52vh;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
margin: 30rpx 0;
|
margin: 30rpx 0;
|
||||||
|
|
||||||
|
// 小程序rich-text内块级标签无默认段间距,补充与后台富文本编辑器一致的段落格式
|
||||||
|
::v-deep rich-text {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
p, div, ul, ol {
|
||||||
|
display: block;
|
||||||
|
margin: 0 0 16rpx;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
margin: 0 0 8rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.popup-body .agree-box {
|
.popup-body .agree-box {
|
||||||
margin: 60rpx 0;
|
margin: 60rpx 0;
|
||||||
|
|||||||
+16
-11
@@ -6,32 +6,32 @@
|
|||||||
mode="scaleToFill"
|
mode="scaleToFill"
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
v-show="partnerType === 'province_partner' || partnerType === ''"
|
v-show="partnerType === 'province_partner' || partnerType === '' || partnerType === 'county_agent'"
|
||||||
:src="images.goodSupplierImage"
|
:src="images.goodSupplierImage"
|
||||||
class="img-item"
|
class="img-item"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
@click="goto('goods_supplier')"
|
@click="goto('goods_supplier')"
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
v-show="partnerType === 'pioneer' || partnerType === ''"
|
v-show="partnerType === 'pioneer' || partnerType === '' || partnerType === 'county_agent'"
|
||||||
:src="images.wenwanSupplierImage"
|
:src="images.wenwanSupplierImage"
|
||||||
class="img-item"
|
class="img-item"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
@click="goto('wenwan_supplier')"
|
@click="goto('wenwan_supplier')"
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
v-show="partnerType === 'pioneer' || partnerType === ''"
|
v-show="partnerType === 'pioneer' || partnerType === '' || partnerType === 'county_agent'"
|
||||||
:src="images.hotelImage"
|
:src="images.hotelImage"
|
||||||
class="img-item"
|
class="img-item"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
@click="goto('shop')"
|
@click="goto('shop')"
|
||||||
/>
|
/>
|
||||||
<!-- <image
|
<image
|
||||||
:src="images.wholesalerImage"
|
:src="images.wholesalerImage"
|
||||||
class="img-item"
|
class="img-item"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
@click="goto('wholesaler')"
|
@click="goto('wholesaler')"
|
||||||
/> -->
|
/>
|
||||||
<image
|
<image
|
||||||
:src="images.travelImage"
|
:src="images.travelImage"
|
||||||
class="img-item"
|
class="img-item"
|
||||||
@@ -57,6 +57,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
partnerId: '',
|
partnerId: '',
|
||||||
|
promoterUid: '',
|
||||||
partnerType: '',
|
partnerType: '',
|
||||||
hotelId: null,
|
hotelId: null,
|
||||||
hasHotel: null,
|
hasHotel: null,
|
||||||
@@ -71,8 +72,12 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.partnerId = options.partnerId || ''
|
this.partnerId = options.partnerId || ''
|
||||||
|
this.promoterUid = options.promoterUid || ''
|
||||||
getImages().then(({data}) => this.images = data)
|
getImages().then(({data}) => this.images = data)
|
||||||
getShopData(this.partnerId).then(({data}) => {
|
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => {
|
||||||
this.partnerType = data.partnerType
|
this.partnerType = data.partnerType
|
||||||
this.hotelId = data.hotelId
|
this.hotelId = data.hotelId
|
||||||
this.hasHotel = data.hasHotel
|
this.hasHotel = data.hasHotel
|
||||||
@@ -91,7 +96,7 @@ export default {
|
|||||||
if (this.hasTravel === 1) {
|
if (this.hasTravel === 1) {
|
||||||
this.$global.goSupplierMini()
|
this.$global.goSupplierMini()
|
||||||
} else {
|
} else {
|
||||||
this.$yrouter.push('/pkg_join/views/travelResidence?partnerId=' + this.partnerId)
|
this.$yrouter.push('/pkg_join/views/travelResidence?partnerId=' + this.partnerId + '&promoterUid=' + this.promoterUid)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -104,14 +109,14 @@ export default {
|
|||||||
if (this.hasSupplier === 1) {
|
if (this.hasSupplier === 1) {
|
||||||
this.$global.goSupplierMini()
|
this.$global.goSupplierMini()
|
||||||
} else {
|
} else {
|
||||||
this.$yrouter.push(`/pkg_join/views/supplier?type=goods_supplier&partnerId=${this.partnerId}`)
|
this.$yrouter.push(`/pkg_join/views/supplier?type=goods_supplier&partnerId=${this.partnerId}&promoterUid=${this.promoterUid}`)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'wenwan_supplier':
|
case 'wenwan_supplier':
|
||||||
if (this.hasSupplier === 1) {
|
if (this.hasSupplier === 1) {
|
||||||
this.$global.goSupplierMini()
|
this.$global.goSupplierMini()
|
||||||
} else {
|
} else {
|
||||||
this.$yrouter.push(`/pkg_join/views/supplier?type=wenwan_supplier&partnerId=${this.partnerId}`)
|
this.$yrouter.push(`/pkg_join/views/supplier?type=wenwan_supplier&partnerId=${this.partnerId}&promoterUid=${this.promoterUid}`)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'shop':
|
case 'shop':
|
||||||
@@ -129,13 +134,13 @@ export default {
|
|||||||
this.$global.goSupplierMini()
|
this.$global.goSupplierMini()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$yrouter.push('/pkg_join/views/experienceStore?partnerId=' + this.partnerId)
|
this.$yrouter.push('/pkg_join/views/experienceStore?partnerId=' + this.partnerId + '&promoterUid=' + this.promoterUid)
|
||||||
break
|
break
|
||||||
case 'wholesaler':
|
case 'wholesaler':
|
||||||
if (this.hasWholesaler === 1) {
|
if (this.hasWholesaler === 1) {
|
||||||
this.$global.goSupplierMini()
|
this.$global.goSupplierMini()
|
||||||
} else {
|
} else {
|
||||||
this.$yrouter.push(`/pkg_join/views/wholesaler`)
|
this.$yrouter.push(`/pkg_join/views/wholesaler?partnerId=${this.partnerId}&promoterUid=${this.promoterUid}`)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user