Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
475972e7d0 | ||
|
|
4c84f63a93 | ||
|
|
f1173ae292 | ||
|
|
83c34d473e | ||
|
|
4708fce5a5 | ||
|
|
47ab649122 | ||
|
|
e7e9ba0ec5 | ||
|
|
49a19fe57d | ||
|
|
2f29a42f9b | ||
|
|
1065fc0c37 | ||
|
|
26ff0d2dd8 | ||
|
|
856d89a42f | ||
|
|
720b7b330c | ||
|
|
a883e7d56f | ||
|
|
d5b7e8e2e8 | ||
|
|
208930ba63 | ||
|
|
318a0f2294 | ||
|
|
f354c9d3b2 | ||
|
|
afc1c9d519 | ||
|
|
cd458a6ec6 | ||
|
|
05bd367e04 | ||
|
|
7c7d19bd16 |
@@ -112,10 +112,6 @@ export default {
|
||||
keyboardHeight: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
voiceException: {
|
||||
type: String,
|
||||
default: '没有听清您说了什么,请再说一遍'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -266,11 +262,11 @@ export default {
|
||||
fail: err => {
|
||||
console.log(err)
|
||||
uni.hideLoading()
|
||||
_this.$toast(_this.voiceException)
|
||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
_this.$toast(_this.voiceException)
|
||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -286,7 +282,7 @@ export default {
|
||||
_this.getTransResultReq()
|
||||
}).catch(() => {
|
||||
uni.hideLoading()
|
||||
_this.$toast(_this.voiceException)
|
||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
||||
})
|
||||
},
|
||||
getTransResultReq() {
|
||||
@@ -300,7 +296,7 @@ export default {
|
||||
uni.hideLoading()
|
||||
_this.clearIntervalFn()
|
||||
if (data === '__NULL__') {
|
||||
_this.$toast(_this.voiceException)
|
||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
||||
} else {
|
||||
if (data.length > 0) {
|
||||
const prompt = data[0].Text
|
||||
@@ -312,7 +308,7 @@ export default {
|
||||
}
|
||||
}).catch(() => {
|
||||
uni.hideLoading()
|
||||
_this.$toast(_this.voiceException)
|
||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
||||
})
|
||||
}, 1000)
|
||||
},
|
||||
|
||||
@@ -112,9 +112,7 @@
|
||||
<script>
|
||||
import {
|
||||
getChatList,
|
||||
deleteChatListByType,
|
||||
getCountyAiChatList,
|
||||
deleteCountyChatListByType
|
||||
deleteChatListByType
|
||||
} from '@/api/chat/index'
|
||||
export default {
|
||||
name: 'AiHistoryList',
|
||||
@@ -127,10 +125,6 @@ export default {
|
||||
formModule: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
countyId: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -148,17 +142,7 @@ export default {
|
||||
this.getChatListReq()
|
||||
},
|
||||
getChatListReq() {
|
||||
let reqFn = null
|
||||
let params = {}
|
||||
if (this.countyId) {
|
||||
reqFn = getCountyAiChatList
|
||||
params = {
|
||||
countyId: this.countyId
|
||||
}
|
||||
} else {
|
||||
reqFn = getChatList
|
||||
}
|
||||
reqFn(params).then(res => {
|
||||
getChatList().then(res => {
|
||||
const { success, data } = res
|
||||
if (success) {
|
||||
this.todayList = data['今天'] || []
|
||||
@@ -168,15 +152,7 @@ export default {
|
||||
})
|
||||
},
|
||||
deleteRecords(type) {
|
||||
let reqFn = null
|
||||
let params = ''
|
||||
if (this.countyId) {
|
||||
reqFn = deleteCountyChatListByType
|
||||
params = `?countyId=${this.countyId}&type=${type}`
|
||||
} else {
|
||||
reqFn = deleteChatListByType
|
||||
}
|
||||
reqFn(type, params).then(res => {
|
||||
deleteChatListByType(type).then(res => {
|
||||
const { success } = res
|
||||
if (success) {
|
||||
this.getChatListReq()
|
||||
@@ -184,7 +160,7 @@ export default {
|
||||
})
|
||||
},
|
||||
historyItemClick(item) {
|
||||
const paramsStr = `?chatNumber=${item.chatNumber}&title=${item.title}&click=1&countyId=${this.countyId}`
|
||||
const paramsStr = `?chatNumber=${item.chatNumber}&title=${item.title}&click=1`
|
||||
if (!this.formModule) {
|
||||
uni.navigateTo({
|
||||
url: '/aiChat/views/history' + paramsStr
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
<view class="total">
|
||||
共{{ item.totalNum }}件商品
|
||||
<text v-if="item.isGiftCardReceiveBlind === 0" class="total-txt">
|
||||
总金额<text class="color-red">¥{{ item.payPrice }}</text>
|
||||
总金额<text class="color-red">¥{{ item.totalPrice }}</text>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -100,7 +100,10 @@ export const chatMixins = {
|
||||
}.bind(this)).exec()
|
||||
},
|
||||
onUnload() {
|
||||
this.audioStopHandle()
|
||||
if (this.audioContext) {
|
||||
this.audioContext.stop()
|
||||
}
|
||||
wx.getBackgroundAudioManager().stop()
|
||||
this.closeWsFn()
|
||||
},
|
||||
created() {
|
||||
@@ -444,15 +447,9 @@ export const chatMixins = {
|
||||
this.audioAyy = []
|
||||
if (this.audioContext) {
|
||||
this.audioContext.stop()
|
||||
this.audioContext.destroy() // 强制销毁释放资源
|
||||
this.audioContext = null
|
||||
}
|
||||
this.isPlayAudio = false
|
||||
|
||||
// 强制关闭微信小程序背景音频
|
||||
if (typeof wx !== 'undefined' && wx.getBackgroundAudioManager) {
|
||||
wx.getBackgroundAudioManager().stop()
|
||||
}
|
||||
},
|
||||
ttsHandle(item) {
|
||||
this.audioAyy = []
|
||||
|
||||
+76
-314
@@ -3,18 +3,9 @@ import {
|
||||
getCompletionsV3,
|
||||
deleteChatItemByConversationId,
|
||||
// getAnalyzeKeywordsV1,
|
||||
getAnalyzeKeywordsChangeV3,
|
||||
getSseCountyAiConfigV1,
|
||||
getCountyAiCompletionsV1,
|
||||
getGiftRecommendOptions,
|
||||
getGiftRecommendPrompt
|
||||
getAnalyzeKeywordsChangeV3
|
||||
} from '@/api/chat/index'
|
||||
import {
|
||||
getExceptionConfig,
|
||||
getBottomNavigationConfigList
|
||||
} from '@/api/public'
|
||||
import {
|
||||
getProductDetail,
|
||||
postCartAdd
|
||||
} from '@/api/store'
|
||||
import { VUE_APP_API_URL } from '@/config'
|
||||
@@ -30,7 +21,29 @@ export const chatMixinsV2 = {
|
||||
token: cookie.get('login_status'),
|
||||
userInfo: cookie.get('userInfo'),
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
bottomTools: [],
|
||||
bottomTools: Object.freeze([
|
||||
{
|
||||
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: {},
|
||||
scrollTop: 0,
|
||||
isScrollToBottom: false,
|
||||
@@ -44,19 +57,31 @@ export const chatMixinsV2 = {
|
||||
loading: false,
|
||||
chatNumber: '',
|
||||
infoResData: {},
|
||||
chatMessageList: [],
|
||||
chatMessageList: [
|
||||
/*
|
||||
{
|
||||
type: -2,
|
||||
isError: false,
|
||||
showCursor: false,
|
||||
conversationId: '',
|
||||
prompt: '',
|
||||
nodes: '-------------监听 WebSocket 接受到服务器的消息事件',
|
||||
content: '-------------监听 WebSocket 接受到服务器的消息事件',
|
||||
listQuestion: [
|
||||
'监听 WebSocket 接受到服务器的消息事件',
|
||||
'监听 WebSocket 接受到服务器的消息事件',
|
||||
'监听 WebSocket 接受到服务器的消息事件'
|
||||
]
|
||||
}
|
||||
*/
|
||||
],
|
||||
errorMsg: Object.freeze('您提的问题未能理解,云灵思想跑偏啦,重新整理一下问题或者重新提问,让云灵再试试!'),
|
||||
audioAyy: [],
|
||||
isPlayAudio: false,
|
||||
audioContext: null,
|
||||
audioPlayId: '',
|
||||
showGiftBtn: false,
|
||||
buyLoading: false,
|
||||
exceptionConfig: {
|
||||
model_exception: '您提的问题未能理解,云灵思想跑偏啦,重新整理一下问题或者重新提问,让云灵再试试!',
|
||||
voice_exception: ''
|
||||
},
|
||||
giftStepLoading: false,
|
||||
onlyOneToAddCart: false
|
||||
buyLoading: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -81,12 +106,12 @@ export const chatMixinsV2 = {
|
||||
}.bind(this)).exec()
|
||||
},
|
||||
onUnload() {
|
||||
this.audioStopHandle()
|
||||
if (this.audioContext) {
|
||||
this.audioContext.stop()
|
||||
}
|
||||
wx.getBackgroundAudioManager().stop()
|
||||
this.closeWsFn()
|
||||
},
|
||||
onHide() {
|
||||
this.audioStopHandle()
|
||||
},
|
||||
created() {
|
||||
const _this = this
|
||||
uni.getSystemInfo({
|
||||
@@ -106,37 +131,7 @@ export const chatMixinsV2 = {
|
||||
},
|
||||
methods: {
|
||||
createdCallbak() {
|
||||
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('首页/历史详情页面单独请求接口逻辑')
|
||||
console.log('页面初始话回调')
|
||||
},
|
||||
inputFocusHandle(value) {
|
||||
this.onFocus = value === 1
|
||||
@@ -220,16 +215,7 @@ export const chatMixinsV2 = {
|
||||
handleLoginFailure()
|
||||
return
|
||||
}
|
||||
if (params.prompt.length > 500) {
|
||||
uni.showToast({
|
||||
title: "字数已超出限制",
|
||||
icon: "none",
|
||||
duration: 5000
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.loading) return
|
||||
const prompt = params.prompt.substr(0, 500)
|
||||
const prompt = params.prompt
|
||||
if (params.init !== 1) {
|
||||
_this.chatMessageList.push({
|
||||
prompt,
|
||||
@@ -271,49 +257,21 @@ export const chatMixinsV2 = {
|
||||
})
|
||||
_this.loading = true
|
||||
_this.showCursor = false
|
||||
let reqFn = null
|
||||
let postData = {}
|
||||
if (_this.countyId) {
|
||||
reqFn = getSseCountyAiConfigV1
|
||||
postData = {
|
||||
'countyId': _this.countyId,
|
||||
getSseConfigV1({
|
||||
'chatNumber': _this.chatNumber,
|
||||
prompt
|
||||
}
|
||||
} else {
|
||||
reqFn = getSseConfigV1
|
||||
postData = {
|
||||
'chatNumber': _this.chatNumber,
|
||||
prompt
|
||||
}
|
||||
}
|
||||
reqFn(postData).then(resConfig => {
|
||||
}).then(resConfig => {
|
||||
const conversationId = resConfig.data.conversationId
|
||||
_this.chatNumber = resConfig.data.chatNumber || ''
|
||||
_this.chatMessageList[_this.chatMessageListLength - 1].showCursor = true
|
||||
_this.chatMessageList[_this.chatMessageListLength - 1].conversationId = conversationId
|
||||
if (conversationId) {
|
||||
_this.initWebSocket(conversationId, () => {
|
||||
|
||||
let completionsReqFn = null
|
||||
let completionsPostData = {}
|
||||
if (_this.countyId) {
|
||||
completionsReqFn = getCountyAiCompletionsV1
|
||||
completionsPostData = {
|
||||
conversationId,
|
||||
countyId: _this.countyId,
|
||||
ws: true,
|
||||
isNoNeedPublicErrorNotification: 1
|
||||
}
|
||||
} else {
|
||||
completionsReqFn = getCompletionsV3
|
||||
completionsPostData = {
|
||||
getCompletionsV3({
|
||||
conversationId,
|
||||
ws: true,
|
||||
isNoNeedPublicErrorNotification: 1
|
||||
}
|
||||
}
|
||||
completionsReqFn(completionsPostData).then(sseRes => {
|
||||
}).then(sseRes => {
|
||||
console.log(sseRes)
|
||||
// _this.closeWsFn()
|
||||
}).catch(err => {
|
||||
@@ -525,59 +483,16 @@ export const chatMixinsV2 = {
|
||||
})
|
||||
},
|
||||
productItemBuyNowClickHandle(item) {
|
||||
this.audioStopHandle()
|
||||
this.showGiftBtn = false
|
||||
this.productItemBuyNowOrGiftBuy(item, 1)
|
||||
this.cart_num = 1
|
||||
this.addToCart(item)
|
||||
},
|
||||
productItemGiftBuyClickHandle(item) {
|
||||
this.showGiftBtn = true
|
||||
this.productItemBuyNowOrGiftBuy(item, 2)
|
||||
},
|
||||
productItemBuyNowOrGiftBuy(item, BuyNowOrGiftBuyType) {
|
||||
this.audioStopHandle()
|
||||
this.showGiftBtn = true
|
||||
this.cart_num = 1
|
||||
this.m_id = item.id
|
||||
getProductDetail(item.id).then(res => {
|
||||
const { data } = res
|
||||
this.storeInfo = {...data.storeInfo}
|
||||
if(data.storeInfo.stock === 0) {
|
||||
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.addToCart(item)
|
||||
},
|
||||
buyNowOrGiftBuyReq(type) {
|
||||
const _this = this
|
||||
@@ -655,8 +570,8 @@ export const chatMixinsV2 = {
|
||||
},
|
||||
chatErrorSetContent() {
|
||||
this.chatMessageList[this.chatMessageListLength - 1].isError = true
|
||||
this.chatMessageList[this.chatMessageListLength - 1].content = this.exceptionConfig.model_exception
|
||||
this.chatMessageList[this.chatMessageListLength - 1].nodes = this.exceptionConfig.model_exception
|
||||
this.chatMessageList[this.chatMessageListLength - 1].content = this.errorMsg
|
||||
this.chatMessageList[this.chatMessageListLength - 1].nodes = this.errorMsg
|
||||
this.closeWsFn()
|
||||
},
|
||||
closeWsFn() {
|
||||
@@ -674,26 +589,13 @@ export const chatMixinsV2 = {
|
||||
})
|
||||
},
|
||||
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
|
||||
this.audioAyy = []
|
||||
if (this.audioContext) {
|
||||
this.audioContext.stop()
|
||||
this.audioContext.destroy() // 强制销毁释放资源
|
||||
this.audioContext = null
|
||||
}
|
||||
this.isPlayAudio = false
|
||||
wx.getBackgroundAudioManager().stop()
|
||||
},
|
||||
ttsHandle(item) {
|
||||
this.audioAyy = []
|
||||
@@ -702,13 +604,13 @@ export const chatMixinsV2 = {
|
||||
// this.audioContext.destroy()
|
||||
}
|
||||
// 如果正在播放,点击当前播放的则认为是暂停
|
||||
if (this.isPlayAudio && [item.conversationId, item.messageId, item.parentMessageId].includes(this.audioPlayId)) {
|
||||
if (this.isPlayAudio && item.conversationId === this.audioPlayId) {
|
||||
this.isPlayAudio = false
|
||||
this.audioPlayId = ''
|
||||
return
|
||||
}
|
||||
this.isPlayAudio = false
|
||||
this.audioPlayId = item.conversationId || item.messageId || item.parentMessageId
|
||||
this.audioPlayId = item.conversationId
|
||||
const flag = 1
|
||||
if (flag === 1) {
|
||||
console.log(removeMarkdown(item.content).replace(/[\n\t\s]/g, ''))
|
||||
@@ -772,74 +674,34 @@ export const chatMixinsV2 = {
|
||||
}
|
||||
},
|
||||
playNextChunk() {
|
||||
if (!this.audioAyy.length || !this.audioPlayId) {
|
||||
this.isPlayAudio = false
|
||||
return
|
||||
}
|
||||
|
||||
// 销毁旧实例
|
||||
if (this.audioContext) {
|
||||
this.audioContext.stop()
|
||||
this.audioContext.destroy()
|
||||
this.audioContext = null
|
||||
}
|
||||
|
||||
if (this.audioAyy.length > 0 && this.audioPlayId) {
|
||||
const src = this.audioAyy.shift()
|
||||
this.isPlayAudio = true
|
||||
|
||||
const audioContext = uni.createInnerAudioContext({
|
||||
useWebAudioImplement: true // 短音频建议 true
|
||||
// 是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项
|
||||
useWebAudioImplement: false
|
||||
})
|
||||
|
||||
this.audioContext = audioContext
|
||||
audioContext.src = src
|
||||
|
||||
audioContext.onPlay(() => {
|
||||
console.log('audio play:', src)
|
||||
})
|
||||
|
||||
audioContext.onEnded(() => {
|
||||
this.audioContext = null
|
||||
audioContext.destroy()
|
||||
this.playNextChunk()
|
||||
})
|
||||
|
||||
audioContext.onError((err) => {
|
||||
console.error('audio error', err)
|
||||
this.audioContext = null
|
||||
audioContext.destroy()
|
||||
this.playNextChunk()
|
||||
})
|
||||
|
||||
audioContext.play()
|
||||
console.log('------------src:' + src)
|
||||
} else {
|
||||
console.log('------------end')
|
||||
this.isPlayAudio = false
|
||||
}
|
||||
},
|
||||
bottomToolClickHandle(item) {
|
||||
// 非界面跳转的需要校验登录状态
|
||||
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') {
|
||||
if (item.type === 'prompt') {
|
||||
this.streamReq({
|
||||
prompt: item.promptContent,
|
||||
prompt: item.prompt,
|
||||
init: 0
|
||||
})
|
||||
}
|
||||
if (item.navType === 'url') {
|
||||
if (item.type === 'link') {
|
||||
uni.navigateTo({
|
||||
url: item.url
|
||||
})
|
||||
@@ -847,107 +709,7 @@ export const chatMixinsV2 = {
|
||||
},
|
||||
viewOrderTrackHandle(order) {
|
||||
uni.navigateTo({
|
||||
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--
|
||||
}
|
||||
},
|
||||
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() {
|
||||
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
|
||||
url: '/pages/order/OrderDetails/index?id=' + order.orderId
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
+12
-53
@@ -45,14 +45,14 @@
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item.type === -2" class="chat-message-body">
|
||||
<view class="avatar">
|
||||
<view v-if="item.nodes && item.nodes.length" class="avatar">
|
||||
<image
|
||||
:src="webUrl + '/aiChat/avatar.png'"
|
||||
class="chat-avatar"
|
||||
mode="widthFix"
|
||||
/>
|
||||
</view>
|
||||
<view class="item-left">
|
||||
<view v-if="item.nodes && item.nodes.length" class="item-left">
|
||||
<view class="txt">
|
||||
<view
|
||||
ref="rich-text-box"
|
||||
@@ -67,7 +67,7 @@
|
||||
space="nbsp"
|
||||
/>
|
||||
<view v-if="!(item.nodes && item.nodes.length) && loading" class="loader-wrap">
|
||||
<div class="loading2" />
|
||||
<div class="loader" />
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
@@ -109,13 +109,13 @@
|
||||
</view>
|
||||
<view
|
||||
:class="{
|
||||
'playing': [item.conversationId, item.messageId, item.parentMessageId].includes(audioPlayId) && isPlayAudio
|
||||
'playing': audioPlayId === item.conversationId && isPlayAudio
|
||||
}"
|
||||
class="item"
|
||||
@click="ttsHandle(item)"
|
||||
>
|
||||
<image
|
||||
:src="webUrl + '/aiChat/' + (([item.conversationId, item.messageId, item.parentMessageId].includes(audioPlayId) && isPlayAudio) ? 'audio-on' : 'audio-off') +'.png'"
|
||||
:src="webUrl + '/aiChat/' + ((audioPlayId === item.conversationId && isPlayAudio) ? 'audio-on' : 'audio-off') +'.png'"
|
||||
class="icon"
|
||||
mode="widthFix"
|
||||
/>
|
||||
@@ -379,12 +379,7 @@
|
||||
@click="scrollToBottomHandle"
|
||||
/>
|
||||
</view>
|
||||
<view
|
||||
:class="{
|
||||
'container-county': !!countyId
|
||||
}"
|
||||
class="container"
|
||||
>
|
||||
<view class="container">
|
||||
<view
|
||||
v-if="chatNumber"
|
||||
class="new-chat"
|
||||
@@ -398,21 +393,17 @@
|
||||
开启新对话
|
||||
</view>
|
||||
<view
|
||||
v-if="!countyId"
|
||||
v-for="(item, index) in bottomTools"
|
||||
:key="index"
|
||||
:class="{
|
||||
'hide': !item.display
|
||||
}"
|
||||
class="bottom-tool-item"
|
||||
@click="bottomToolClickHandle(item)"
|
||||
>
|
||||
<image
|
||||
:src="item.icon"
|
||||
:src="webUrl + '/aiChat/' + item.icon + '.png'"
|
||||
class="tool-icon"
|
||||
mode="widthFix"
|
||||
/>
|
||||
{{ item.name }}
|
||||
{{ item.text }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -420,7 +411,6 @@
|
||||
ref="bottomSend"
|
||||
:loading="loading"
|
||||
:keyboard-height="keyboardHeight"
|
||||
:voice-exception="exceptionConfig.voice_exception"
|
||||
@send="streamReq"
|
||||
@history="historyViewHandle"
|
||||
@focus="inputFocusHandle"
|
||||
@@ -428,7 +418,6 @@
|
||||
<AiHistoryList
|
||||
ref="historyView"
|
||||
:status-bar-height="statusBarHeight"
|
||||
:county-id="countyId"
|
||||
form-module="history"
|
||||
@enter-history="audioStopHandle"
|
||||
/>
|
||||
@@ -456,8 +445,7 @@ import BottomSend from '../components/bottomSend.vue'
|
||||
import OrderItem from '../components/orderItem.vue'
|
||||
import ProductWindow from '@/components/ProductWindow'
|
||||
import {
|
||||
historyChatMessage,
|
||||
getCountyAiHistoryChatMessage
|
||||
historyChatMessage
|
||||
} from '@/api/chat/index'
|
||||
import { formatAiMsgContent } from '../utils/aiChat'
|
||||
export default {
|
||||
@@ -471,27 +459,19 @@ export default {
|
||||
mixins: [chatMixinsV2, goCartMixin],
|
||||
data() {
|
||||
return {
|
||||
pageTitle: '',
|
||||
countyId: ''
|
||||
pageTitle: ''
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.chatNumber = options.chatNumber
|
||||
this.pageTitle = options.title || ''
|
||||
this.countyId = options.countyId || ''
|
||||
this.pageTitle = options.title
|
||||
this.pageTitle = this.pageTitle.length > 8 ? (this.pageTitle.substring(0, 8) + '...') : this.pageTitle
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.loading = true
|
||||
let reqFn = null
|
||||
if (this.countyId) {
|
||||
reqFn = getCountyAiHistoryChatMessage
|
||||
} else {
|
||||
reqFn = historyChatMessage
|
||||
}
|
||||
reqFn({
|
||||
historyChatMessage({
|
||||
chatNumber: this.chatNumber
|
||||
}).then(res => {
|
||||
const { success, data = [] } = res
|
||||
@@ -567,9 +547,6 @@ export default {
|
||||
}
|
||||
})
|
||||
console.log(this.chatMessageList)
|
||||
this.$nextTick(() => {
|
||||
this.scrollToBottomHandle()
|
||||
})
|
||||
} catch (err) {
|
||||
uni.showModal({
|
||||
title: '错误提示',
|
||||
@@ -595,24 +572,6 @@ export default {
|
||||
createNewHandle() {
|
||||
uni.setStorageSync('addNewChat', '1')
|
||||
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,10 +38,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="sheet-divider" />
|
||||
<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 class="goods-grid">
|
||||
<view
|
||||
v-for="(item, index) in goodsList"
|
||||
:key="index"
|
||||
@@ -69,9 +66,6 @@
|
||||
lazy-load
|
||||
/>
|
||||
</view>
|
||||
<view v-if="item.similarityScore > 0" class="goods-desc">
|
||||
相似度{{ item.similarityScore }}%
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -90,7 +84,6 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loaded: false,
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
statusBarHeight: 20,
|
||||
imageUrl: '',
|
||||
@@ -252,13 +245,6 @@ export default {
|
||||
margin: 0 32rpx;
|
||||
}
|
||||
|
||||
.loading-state {
|
||||
padding: 120rpx 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
}
|
||||
@@ -315,12 +301,6 @@ export default {
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.goods-desc {
|
||||
padding: 10rpx 14rpx 20rpx 14rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.price-left {
|
||||
display: flex;
|
||||
|
||||
+25
-217
@@ -16,7 +16,7 @@
|
||||
transparent="auto"
|
||||
barPlaceholder="hidden"
|
||||
title="云灵"
|
||||
@click-left="pageContainerBeforeleave"
|
||||
@click-left="clickBackHandle"
|
||||
/>
|
||||
<page-container
|
||||
:show="true"
|
||||
@@ -40,25 +40,17 @@
|
||||
conversationId: '123'
|
||||
})">播放</button> -->
|
||||
<block v-if="chatMessageListLength < 1">
|
||||
<view
|
||||
:class="{
|
||||
'county-home-wrap': !!countyId
|
||||
}"
|
||||
class="home-wrap"
|
||||
>
|
||||
<view class="home-wrap">
|
||||
<view class="home-focus-wrap">
|
||||
<view class="focus-guide-wrap">
|
||||
<view class="guide-left">
|
||||
<image
|
||||
:src="webUrl + '/aiChat/logo-transition.png'"
|
||||
:class="{
|
||||
'county-avatar': !!countyId
|
||||
}"
|
||||
class="avatar avatar-bounce"
|
||||
:src="webUrl + '/aiChat/logo-01.gif'"
|
||||
class="avatar"
|
||||
mode="widthFix"
|
||||
/>
|
||||
</view>
|
||||
<view v-if="!showGiftSteps" class="guide-right">
|
||||
<view class="guide-right">
|
||||
<view class="title">{{ settingInfo.helloMessageTitle }}</view>
|
||||
<view class="content">{{ settingInfo.helloMessageContent }}</view>
|
||||
</view>
|
||||
@@ -107,8 +99,7 @@
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view> -->
|
||||
<!-- 大家都在问 -->
|
||||
<view v-if="!showGiftSteps && !countyId" class="topic-wrap">
|
||||
<view class="topic-wrap">
|
||||
<view class="title">
|
||||
<view class="title-left">大家都在问</view>
|
||||
<view class="title-right" @click="loadData('click')">
|
||||
@@ -142,61 +133,6 @@
|
||||
</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="例如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>
|
||||
</block>
|
||||
<view v-if="chatMessageListLength > 0" class="chat-wrap">
|
||||
@@ -288,13 +224,13 @@
|
||||
</view>
|
||||
<view
|
||||
:class="{
|
||||
'playing': [item.conversationId, item.messageId, item.parentMessageId].includes(audioPlayId) && isPlayAudio
|
||||
'playing': audioPlayId === item.conversationId && isPlayAudio
|
||||
}"
|
||||
class="item"
|
||||
@click="ttsHandle(item)"
|
||||
>
|
||||
<image
|
||||
:src="webUrl + '/aiChat/' + (([item.conversationId, item.messageId, item.parentMessageId].includes(audioPlayId) && isPlayAudio) ? 'audio-on' : 'audio-off') +'.png'"
|
||||
:src="webUrl + '/aiChat/' + ((audioPlayId === item.conversationId && isPlayAudio) ? 'audio-on' : 'audio-off') +'.png'"
|
||||
class="icon"
|
||||
mode="widthFix"
|
||||
/>
|
||||
@@ -564,14 +500,9 @@
|
||||
@click="scrollToBottomHandle"
|
||||
/>
|
||||
</view>
|
||||
<view class="container">
|
||||
<view
|
||||
:class="{
|
||||
'container-county': !!countyId
|
||||
}"
|
||||
class="container"
|
||||
>
|
||||
<view
|
||||
v-if="chatNumber || showGiftSteps"
|
||||
v-if="chatNumber"
|
||||
class="new-chat"
|
||||
@click="createNewHandle"
|
||||
>
|
||||
@@ -583,21 +514,17 @@
|
||||
开启新对话
|
||||
</view>
|
||||
<view
|
||||
v-if="!countyId"
|
||||
v-for="(item, index) in bottomTools"
|
||||
:key="index"
|
||||
:class="{
|
||||
'hide': !item.display
|
||||
}"
|
||||
class="bottom-tool-item"
|
||||
@click="bottomToolClickHandle(item)"
|
||||
>
|
||||
<image
|
||||
:src="item.icon"
|
||||
:src="webUrl + '/aiChat/' + item.icon + '.png'"
|
||||
class="tool-icon"
|
||||
mode="widthFix"
|
||||
/>
|
||||
{{ item.name }}
|
||||
{{ item.text }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -605,7 +532,6 @@
|
||||
ref="bottomSend"
|
||||
:loading="loading"
|
||||
:keyboard-height="keyboardHeight"
|
||||
:voice-exception="exceptionConfig.voice_exception"
|
||||
@send="streamReq"
|
||||
@add="createNewHandle"
|
||||
@history="historyViewHandle"
|
||||
@@ -614,7 +540,6 @@
|
||||
<AiHistoryList
|
||||
ref="historyView"
|
||||
:status-bar-height="statusBarHeight"
|
||||
:county-id="countyId"
|
||||
@enter-history="audioStopHandle"
|
||||
/>
|
||||
<ProductWindow
|
||||
@@ -640,9 +565,6 @@ import {
|
||||
getAiSystemInfoSetting,
|
||||
getAiSystemInfoTopic
|
||||
} from '@/api/public'
|
||||
import {
|
||||
getCountyAiDetail
|
||||
} from '@/api/chat/index'
|
||||
import AiHistoryList from '../components/historyList'
|
||||
import BottomSend from '../components/bottomSend.vue'
|
||||
import OrderItem from '../components/orderItem.vue'
|
||||
@@ -659,58 +581,30 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
cityName: '',
|
||||
countyId: '',
|
||||
animationWidth: '150%',
|
||||
animationStr: '',
|
||||
settingInfo: {},
|
||||
topicList: [],
|
||||
topicIsRotate: false,
|
||||
showGiftSteps: false,
|
||||
currentGiftStepIndex: 0,
|
||||
giftSelections: {},
|
||||
giftBudget: '',
|
||||
giftBuyOptions: [],
|
||||
countyTools: []
|
||||
onlyOneToAddCart: false,
|
||||
topicIsRotate: false
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.cityName = options.cityName || ''
|
||||
this.countyId = options.countyId || ''
|
||||
},
|
||||
onShow() {
|
||||
// 1-新对话,2-我要送礼
|
||||
const addNewChat = uni.getStorageSync('addNewChat') || ''
|
||||
const addNewChat = uni.getStorageSync('addNewChat') === '1'
|
||||
// 从历史界面点击新增对话
|
||||
if (addNewChat) {
|
||||
if (addNewChat === '1' && (this.chatNumber || this.showGiftSteps)) {
|
||||
if (addNewChat && this.chatNumber) {
|
||||
console.log(addNewChat)
|
||||
uni.removeStorageSync('addNewChat')
|
||||
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: {
|
||||
extraReqFn() {
|
||||
createdCallbak() {
|
||||
this.$nextTick(() => {
|
||||
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 => {
|
||||
const { success, data } = res
|
||||
if (success) {
|
||||
@@ -720,7 +614,6 @@ export default {
|
||||
}
|
||||
})
|
||||
this.loadData()
|
||||
}
|
||||
})
|
||||
},
|
||||
loadData(type = '') {
|
||||
@@ -750,12 +643,13 @@ export default {
|
||||
})
|
||||
},
|
||||
// 创建新会话
|
||||
createNewHandle(type = '') {
|
||||
createNewHandle() {
|
||||
this.closeAttrWindow()
|
||||
if (this.audioContext) {
|
||||
this.audioContext.stop()
|
||||
}
|
||||
wx.getBackgroundAudioManager().stop()
|
||||
if (!this.chatNumber) return
|
||||
this.closeWsFn()
|
||||
this.chatNumber = ''
|
||||
this.showCursor = false
|
||||
@@ -763,21 +657,9 @@ export default {
|
||||
this.getConfigLoading = false
|
||||
this.chatMessageList = []
|
||||
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() {
|
||||
if (!this.chatNumber && !this.showGiftSteps) {
|
||||
if (!this.chatNumber) {
|
||||
if (getCurrentPages().length > 1) {
|
||||
uni.navigateBack()
|
||||
} else {
|
||||
@@ -789,9 +671,8 @@ export default {
|
||||
this.createNewHandle()
|
||||
}
|
||||
},
|
||||
*/
|
||||
pageContainerBeforeleave() {
|
||||
if (!this.chatNumber && !this.showGiftSteps) {
|
||||
if (!this.chatNumber) {
|
||||
if (getCurrentPages().length > 1) {
|
||||
uni.navigateBack()
|
||||
} else {
|
||||
@@ -802,19 +683,6 @@ export default {
|
||||
} else {
|
||||
this.createNewHandle()
|
||||
}
|
||||
},
|
||||
countyToolItemClickHandle(item) {
|
||||
if (item.moduleType === 'prompt') {
|
||||
this.streamReq({
|
||||
prompt: item.promptContent,
|
||||
init: 0
|
||||
})
|
||||
}
|
||||
if (item.moduleType === 'url') {
|
||||
uni.navigateTo({
|
||||
url: item.url
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -860,7 +728,6 @@ export default {
|
||||
height: calc(100vh - 240rpx);
|
||||
padding: 0 0 240rpx 0;
|
||||
box-sizing: border-box;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.focus-guide-wrap {
|
||||
display: flex;
|
||||
@@ -870,13 +737,8 @@ export default {
|
||||
.guide-left {
|
||||
.avatar {
|
||||
display: block;
|
||||
width: 400rpx;
|
||||
}
|
||||
.county-avatar {
|
||||
width: 360rpx;
|
||||
}
|
||||
.avatar-bounce {
|
||||
animation: bounce 2s infinite ease-in-out;
|
||||
width: 230rpx;
|
||||
height: 404rpx;
|
||||
}
|
||||
}
|
||||
.guide-right {
|
||||
@@ -960,58 +822,4 @@ export default {
|
||||
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>
|
||||
|
||||
@@ -38,10 +38,6 @@ export function deleteChatListByType(type) {
|
||||
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) {
|
||||
return request.get('/v1/chat/weatherData', params, { login: true })
|
||||
}
|
||||
@@ -63,33 +59,3 @@ export function getAnalyzeKeywordsChangeV3(data) {
|
||||
export function getAnalyzeByImageV3(data) {
|
||||
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 })
|
||||
}
|
||||
|
||||
+12
-25
@@ -11,8 +11,10 @@ export function getImages() {
|
||||
}
|
||||
|
||||
// 商户申请页面数据
|
||||
export function getShopData(params) {
|
||||
return request.get("/merchantApply/index", params, {login: true})
|
||||
export function getShopData(partnerId) {
|
||||
let param = {};
|
||||
if (partnerId) param.partnerId = partnerId;
|
||||
return request.get("/merchantApply/index", param, {login: true})
|
||||
}
|
||||
|
||||
// 查看商户申请
|
||||
@@ -27,38 +29,23 @@ export function getWholesaler() {
|
||||
}
|
||||
|
||||
// 提交店铺入驻申请
|
||||
export function saveShop(hotelInfo, partnerId = '', promoterUid = '') {
|
||||
export function saveShop(hotelInfo, captcha, partnerId) {
|
||||
let param = {hotelInfo, captcha: hotelInfo.captcha};
|
||||
if (partnerId && partnerId.length > 0) {
|
||||
param.partnerId = partnerId;
|
||||
}
|
||||
if (promoterUid && promoterUid.length > 0) {
|
||||
param.promoterUid = promoterUid;
|
||||
}
|
||||
if (partnerId && partnerId.length > 0) param.partnerId = partnerId;
|
||||
return request.post("/merchantApply/hotel/submit", param, {login: true})
|
||||
}
|
||||
|
||||
// 提交特产供应商入驻申请
|
||||
export function saveSupplier(hotelInfo, supplierInfo, partnerId = '', promoterUid = '') {
|
||||
export function saveSupplier(hotelInfo, supplierInfo, partnerId) {
|
||||
let param = {hotelInfo, supplierInfo, captcha: supplierInfo.captcha};
|
||||
if (partnerId && partnerId.length > 0) {
|
||||
param.partnerId = partnerId;
|
||||
}
|
||||
if (promoterUid && promoterUid.length > 0) {
|
||||
param.promoterUid = promoterUid;
|
||||
}
|
||||
if (partnerId && partnerId.length > 0) param.partnerId = partnerId;
|
||||
return request.post("/merchantApply/goodSupplier/submit", param, {login: true})
|
||||
}
|
||||
|
||||
// 提交文玩供应商入驻申请
|
||||
export function saveWenwanSupplier(hotelInfo, supplierInfo, partnerId = '', promoterUid = '') {
|
||||
export function saveWenwanSupplier(hotelInfo, supplierInfo, partnerId) {
|
||||
let param = {hotelInfo, supplierInfo, captcha: supplierInfo.captcha};
|
||||
if (partnerId && partnerId.length > 0) {
|
||||
param.partnerId = partnerId;
|
||||
}
|
||||
if (promoterUid && promoterUid.length > 0) {
|
||||
param.promoterUid = promoterUid;
|
||||
}
|
||||
if (partnerId && partnerId.length > 0) param.partnerId = partnerId;
|
||||
return request.post("/merchantApply/wenwanSupplier/submit", param, {login: true})
|
||||
}
|
||||
|
||||
@@ -95,8 +82,8 @@ export function getHotelInfo(params) {
|
||||
}
|
||||
|
||||
// 获取千县名品店铺类型列表
|
||||
export function getCountyFamousHotelType(params) {
|
||||
return request.get("/countyFamous/hotelType", params, {login: true})
|
||||
export function getCountyFamousHotelType() {
|
||||
return request.get("/countyFamous/hotelType", {}, {login: true})
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+4
-114
@@ -3,77 +3,15 @@ import request from '@/utils/request'
|
||||
/**
|
||||
* 抽奖活动信息
|
||||
* */
|
||||
export function getDetail(params = {}) {
|
||||
return request.get('/lottery/dice/detail', params)
|
||||
export function getDetail() {
|
||||
return request.get('/lottery/dice/detail')
|
||||
}
|
||||
|
||||
/**
|
||||
* 抽奖
|
||||
* */
|
||||
export function getPrize(data = {}) {
|
||||
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')
|
||||
export function getPrize() {
|
||||
return request.post('/lottery/dice/draw')
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,51 +36,3 @@ export function getLogs(page = 1, limit = 10) {
|
||||
export function getLotteryShareInfo() {
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -223,16 +223,6 @@ export function getAiSystemInfoTopic() {
|
||||
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() {
|
||||
return request.get('/weixinShareConfig', {}, { login: false })
|
||||
|
||||
+2
-2
@@ -313,8 +313,8 @@ export function getCityShopList(params) {
|
||||
return request.get('/countyFamous/hotel', params, {login: true})
|
||||
}
|
||||
|
||||
export function getCountyFamousHotelType(params) {
|
||||
return request.get('/countyFamous/hotelType', params, {login: true})
|
||||
export function getCountyFamousHotelType() {
|
||||
return request.get('/countyFamous/hotelType', {}, {login: true})
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -111,12 +111,6 @@ page {
|
||||
box-sizing: border-box;
|
||||
overflow-x: auto;
|
||||
}
|
||||
.container-county {
|
||||
justify-content: flex-end;
|
||||
.new-chat {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
.new-chat {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -167,9 +161,6 @@ page {
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
&.hide {
|
||||
display: none;
|
||||
}
|
||||
.tool-icon {
|
||||
display: block;
|
||||
width: 32rpx;
|
||||
@@ -1374,126 +1365,3 @@ page {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8231,192 +8231,3 @@ rich-text {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
<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: {
|
||||
routerGo(cart) {
|
||||
this.$yrouter.push({
|
||||
path: "/pagesShop/shop/GoodsEvaluate/index",
|
||||
path: "/pages/shop/GoodsEvaluate/index",
|
||||
query: { id: cart.unique }
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
<template>
|
||||
<view>
|
||||
<view
|
||||
:class="[{ on: attr.cartAttr === true }, className]"
|
||||
:style="{ paddingBottom: paddingBottom }"
|
||||
:class="{
|
||||
'on': attr.cartAttr === true,
|
||||
[className]: className
|
||||
}"
|
||||
:style="{paddingBottom: paddingBottom}"
|
||||
class="product-window"
|
||||
>
|
||||
<view class="textpic acea-row row-between-wrapper">
|
||||
@@ -49,7 +52,7 @@
|
||||
</view>
|
||||
<view class="cart v12-justify-between v12-align-center">
|
||||
<view class="titlev12-dark-text f12-font-32">购买数量</view>
|
||||
<view v-if="!hideQuantityControls" class="carnum acea-row row-left">
|
||||
<view 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>
|
||||
<input
|
||||
type="number"
|
||||
@@ -70,12 +73,11 @@
|
||||
@click="CartNumAdd"
|
||||
>+</view>
|
||||
</view>
|
||||
<view v-else class="v12-font-28 v12-dark-text">x1</view>
|
||||
</view>
|
||||
<view class="v12-px-2 v12-mt-3" v-if="showOk">
|
||||
<u-button
|
||||
shape="circle"
|
||||
:color="(attr.productSelect.stock === 0 && attr.cartAttr) ? '#9D9D9D' : '#C52733'"
|
||||
color="#C52733"
|
||||
@click="$emit('ok')"
|
||||
:disabled="(attr.productSelect.stock === 0 && attr.cartAttr)"
|
||||
>{{ okText }}</u-button>
|
||||
@@ -83,7 +85,7 @@
|
||||
<view class="v12-px-2 v12-mt-3" v-if="isGift">
|
||||
<u-button
|
||||
shape="circle"
|
||||
:color="(attr.productSelect.stock === 0 && attr.cartAttr) ? '#9D9D9D' : '#C52733'"
|
||||
color="#C52733"
|
||||
@click="$emit('gift')"
|
||||
:disabled="(attr.productSelect.stock === 0 && attr.cartAttr)"
|
||||
>送给朋友</u-button>
|
||||
@@ -137,10 +139,6 @@ export default {
|
||||
className: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
hideQuantityControls: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -255,15 +253,6 @@ export default {
|
||||
}
|
||||
</script>
|
||||
<style scope>
|
||||
.btn-car-disabled {
|
||||
border: 2rpx solid #9D9D9D !important;
|
||||
color: #9D9D9D !important;
|
||||
}
|
||||
|
||||
.btn-buy-disabled {
|
||||
background: #9D9D9D !important;
|
||||
color: #FFFFFF !important;
|
||||
}
|
||||
.itemn{
|
||||
margin: 28rpx 0 0 34rpx !important;
|
||||
width: auto;
|
||||
|
||||
@@ -13,19 +13,12 @@
|
||||
import {
|
||||
getAiSystemInfoSetting
|
||||
} from '@/api/public'
|
||||
import {
|
||||
getCountyAiDetail
|
||||
} from '@/api/chat/index'
|
||||
export default {
|
||||
name: 'AiEntrance',
|
||||
props: {
|
||||
cityName: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
countyId: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -40,19 +33,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
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 => {
|
||||
const { success, data } = res
|
||||
if (success) {
|
||||
@@ -63,7 +43,7 @@ export default {
|
||||
},
|
||||
enterAiChat() {
|
||||
uni.navigateTo({
|
||||
url: '/aiChat/views/index?click=1&cityName=' + (this.cityName || this.localCityName) + '&countyId=' + (this.countyId || '')
|
||||
url: '/aiChat/views/index?click=1&cityName=' + (this.cityName || this.localCityName)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,343 @@
|
||||
<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>
|
||||
@@ -0,0 +1,51 @@
|
||||
### 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
@@ -0,0 +1,143 @@
|
||||
/* 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;
|
||||
@@ -0,0 +1,381 @@
|
||||
<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>
|
||||
@@ -0,0 +1,134 @@
|
||||
<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,14 +12,7 @@ const settings = {
|
||||
/* 系统接口前缀,没有统一的填空字符串 */
|
||||
sysPrefix: '/',
|
||||
/* 是否收集错误日志 */
|
||||
collectRequestError: false,
|
||||
/* 订阅消息模板ID */
|
||||
SubscribeMessageTmplIds: [
|
||||
'7O3wKw7_D4t7yfSOlvecKuOQP8QEPY88uBx2FJg43HE',
|
||||
'TSmTnGibZ8IxWCiRWOvLxha6-0u7tE-V1-WbDCiPkKU',
|
||||
'9Q6xLHe6HyjkU5Zn5k_2zxYPf2y4MxVyUbOSW8pcZRU',
|
||||
'v0GegDmzjpqiinmdj7dOwRK1MaTAPVyCOpqn8hJ3Y3Q'
|
||||
]
|
||||
collectRequestError: false
|
||||
}
|
||||
|
||||
export default settings
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
// import { subscribeMessage } from '@/libs/order'
|
||||
import { subscribeMessage } from '@/libs/order'
|
||||
import { getProvider } from '@/utils'
|
||||
import WechatJSSDK from 'wechat-jssdk/dist/client.umd'
|
||||
import { getWechatConfig, wechatAuth } from '@/api/public'
|
||||
@@ -65,7 +65,7 @@ export const weappPay = option => {
|
||||
resolve(success)
|
||||
}, 3000)
|
||||
// #ifdef MP-WEIXIN
|
||||
// subscribeMessage()
|
||||
subscribeMessage()
|
||||
// #endif
|
||||
},
|
||||
fail: error => {
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
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({})
|
||||
}
|
||||
}
|
||||
}
|
||||
+151
-244
@@ -76,6 +76,12 @@
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/shop/StoreList/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商家列表"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/shop/GoodsList/index",
|
||||
"style": {
|
||||
@@ -104,6 +110,24 @@
|
||||
"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",
|
||||
"style": {
|
||||
@@ -125,18 +149,88 @@
|
||||
"navigationBarTitleText": "新增收货地址"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/UserAccount/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "账户余额"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/address/AddressManagement/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/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",
|
||||
"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": {
|
||||
@@ -145,6 +239,18 @@
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order/Logistics/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "查看物流"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order/OrderDetails/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order/OrderSubmission/index",
|
||||
"style": {
|
||||
@@ -152,16 +258,48 @@
|
||||
"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",
|
||||
"style": {
|
||||
"navigationBarTitleText": "地图"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/Message/Message",
|
||||
"style": {
|
||||
"navigationBarTitleText": "消息",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/MessageDetail/MessageDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "消息详情",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/VideoPlayBackList/VideoPlayBackList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "使用指南",
|
||||
"navigationBarTitleText": "寻看点",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
@@ -171,6 +309,18 @@
|
||||
"navigationBarTitleText": "视频详情",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/UserFavorite/UserFavorite",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的喜欢"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/Points/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "积分"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subPackages": [
|
||||
@@ -251,47 +401,11 @@
|
||||
"navigationBarTitleText": "抽奖"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "views/county-lottery",
|
||||
"style": {
|
||||
"navigationBarTitleText": "抽奖"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "views/lottery-log",
|
||||
"style": {
|
||||
"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": "实名认证"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -894,213 +1008,6 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"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": {
|
||||
|
||||
@@ -1,16 +1,6 @@
|
||||
<template>
|
||||
<view class="">
|
||||
<video
|
||||
class="video"
|
||||
:show-fullscreen-btn="false"
|
||||
:direction="videoDirection"
|
||||
id="myVideo"
|
||||
autoplay
|
||||
:src="curPlayVideoUrl"
|
||||
@loadedmetadata="handleLoadedMetadata"
|
||||
@error="videoErrorCallback"
|
||||
controls
|
||||
></video>
|
||||
<video class="video" :show-fullscreen-btn="false" id="myVideo" autoplay :src="curPlayVideoUrl" @error="videoErrorCallback" controls></video>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
@@ -25,14 +15,12 @@ export default {
|
||||
return {
|
||||
curPlayVideoUrl:'',
|
||||
isVideoPopupShow:false,
|
||||
pageKeyId: '',
|
||||
videoDirection: 90,
|
||||
hasLoadedMetadata: false,
|
||||
hasRequestedFullscreen: false
|
||||
pageKeyId: ''
|
||||
}
|
||||
},
|
||||
onReady(res) {
|
||||
this.videoContext = uni.createVideoContext('myVideo');
|
||||
this.videoContext.requestFullScreen();
|
||||
},
|
||||
onLoad(options) {
|
||||
if (!options.click) {
|
||||
@@ -44,29 +32,6 @@ export default {
|
||||
this.pageKeyId = `findVideo_videoId_${id}`
|
||||
},
|
||||
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) {
|
||||
uni.showModal({
|
||||
content: e.target.errMsg,
|
||||
|
||||
+18
-83
@@ -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>
|
||||
<view class="btn" @click.stop="addToCart(item, 'productId')">
|
||||
<view class="btn">
|
||||
<image
|
||||
:src="webUrl + '/home/icon-cart.png'"
|
||||
class="img-icon"
|
||||
@@ -309,14 +309,14 @@
|
||||
:key="attr"
|
||||
:class="{
|
||||
'on': attr.check,
|
||||
'disabled': getAttrItemData1(attr.attr).stock === 0
|
||||
'disabled': getAttrItemData(attr.attr).stock === 0
|
||||
}"
|
||||
class="attr"
|
||||
@click="attrItemClick(attr, attrIndex, index)"
|
||||
>
|
||||
{{ attr.attr }}
|
||||
<text
|
||||
v-if="getAttrItemData1(attr.attr).stock === 0"
|
||||
v-if="getAttrItemData(attr.attr).stock === 0"
|
||||
class="tag"
|
||||
>缺货</text>
|
||||
</view>
|
||||
@@ -368,41 +368,28 @@
|
||||
</view>
|
||||
|
||||
</u-popup>
|
||||
<ProductWindow
|
||||
ref="attrWindow"
|
||||
:attr="attr"
|
||||
:cartNum="cart_num"
|
||||
:showOk="true"
|
||||
@changeFun="changeFun"
|
||||
@ok="handleOk(() => this.getCart())"
|
||||
/>
|
||||
<xdd-tabbar :curr-index="2" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import XddTabbar from '@/components/xdd-tabbar'
|
||||
import ProductWindow from '@/components/ProductWindow'
|
||||
import {getAddressList, getUserLike} from "@/api/user";
|
||||
import {
|
||||
changeCartNum,
|
||||
getCartGroup,
|
||||
postCartDel,
|
||||
postCartAdd,
|
||||
getCartGoodAttr,
|
||||
cartGoodChangeAttr
|
||||
} from '@/api/store'
|
||||
import CheckboxIcon from '@/components/CheckboxIcon.vue'
|
||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||
import goCartMixin from '@/mixins/goCartMixins'
|
||||
import { mapGetters } from 'vuex'
|
||||
import cookie from "@/utils/store/cookie"
|
||||
export default {
|
||||
components: {
|
||||
CheckboxIcon,
|
||||
XddTabbar,
|
||||
ProductWindow
|
||||
XddTabbar
|
||||
},
|
||||
mixins: [pageListenMixins, goCartMixin],
|
||||
mixins: [pageListenMixins],
|
||||
data() {
|
||||
return {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
@@ -419,18 +406,15 @@ export default {
|
||||
},
|
||||
showAttr: false,
|
||||
pageKeyId: Object.freeze('landmarkGoodsIndex'),
|
||||
cartSelectedIdsCacheKey: Object.freeze('cartSelectedIds'),
|
||||
isEdit: false,
|
||||
addressList:[],
|
||||
addressInfo: {},
|
||||
userLikeList: [],
|
||||
selectedCartIds: [],
|
||||
// 是否已登录
|
||||
isNoLogin: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['isLogin']),
|
||||
total() {
|
||||
let price = 0
|
||||
this.list.forEach(item => {
|
||||
@@ -451,7 +435,6 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.selectedCartIds = this.getSelectedCartIds()
|
||||
this.getCart()
|
||||
this.getAddress()
|
||||
},
|
||||
@@ -598,75 +581,22 @@ export default {
|
||||
isInvalid: true
|
||||
}
|
||||
})
|
||||
this.list = this.restoreCartState(res.data['valid'].concat(invalid))
|
||||
this.list = res.data['valid'].concat(invalid)
|
||||
this.handleAll(false)
|
||||
const _res = await getUserLike()
|
||||
this.userLikeList = _res.data
|
||||
}
|
||||
},
|
||||
getSelectedCartIds() {
|
||||
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 => {
|
||||
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.isAll = state
|
||||
this.list = this.list.map(item => {
|
||||
const canSelect = !item.isInvalid || this.isEdit
|
||||
item.state = canSelect ? state : false
|
||||
item.state = state
|
||||
item.carts = item.carts.map(good => {
|
||||
good.state = canSelect ? state : false
|
||||
good.state = item.isInvalid && !this.isEdit ? false : state
|
||||
return good
|
||||
})
|
||||
return item
|
||||
})
|
||||
this.refreshSelectionState()
|
||||
},
|
||||
navToStore(id) {
|
||||
if (id === 0) {
|
||||
@@ -685,7 +615,6 @@ export default {
|
||||
if (mark.length === 1) {
|
||||
if (mark[0] === -1) {
|
||||
this.handleAll(state)
|
||||
return
|
||||
} else {
|
||||
this.list[mark[0]]['state'] = state
|
||||
this.list[mark[0]]['carts'] = this.list[mark[0]]['carts'].map(good => {
|
||||
@@ -705,7 +634,13 @@ export default {
|
||||
})
|
||||
this.list[mark[0]]['state'] = count === length
|
||||
}
|
||||
this.refreshSelectionState()
|
||||
let shopCheckNumber = 0
|
||||
this.list.map(item => {
|
||||
if (item.state) {
|
||||
shopCheckNumber++
|
||||
}
|
||||
})
|
||||
this.isAll = shopCheckNumber === this.list.length
|
||||
},
|
||||
inputChangeHandle(index, gIndex, good, e) {
|
||||
|
||||
@@ -831,7 +766,7 @@ export default {
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
getAttrItemData1(attr) {
|
||||
getAttrItemData(attr) {
|
||||
let result = {
|
||||
stock: 0
|
||||
}
|
||||
|
||||
+780
-153
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,454 @@
|
||||
<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>
|
||||
+20
-164
@@ -120,7 +120,7 @@
|
||||
<text v-if="order.bargainId > 0">砍价</text>
|
||||
<text v-if="order.storeId > 0">门店</text>
|
||||
</text>
|
||||
{{ order.isDrawOrder === 1 ? '奖品订单号' : '订单号' }}:{{ order.orderId }}
|
||||
订单号:{{ order.orderId }}
|
||||
</view>
|
||||
<view
|
||||
v-if="order.isTickets === 1 && parseInt(order._status._type) === 1"
|
||||
@@ -186,64 +186,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else-if="order.isDrawOrder === 1">
|
||||
<view class="item-info acea-row row-between row-top draw-order-info">
|
||||
<view class="pictrue">
|
||||
<image :src="order.drawOrderInfo && order.drawOrderInfo.prizeImage" />
|
||||
</view>
|
||||
<view class="text" style="margin-top: 0 !important;">
|
||||
<view class="acea-row name-wrap" style="flex-wrap: nowrap">
|
||||
<view class="name more-t v12-font-bold">{{ (order.drawOrderInfo && order.drawOrderInfo.prizeName) || '抽奖商品' }}</view>
|
||||
<view class="money draw-price">
|
||||
<view class="draw-price-origin">
|
||||
<text class="v12-font-22">¥</text>
|
||||
<text class="v12-font-28">{{ force2Decimal((order.drawOrderInfo && order.drawOrderInfo.prizePrice) || 0) }}</text>
|
||||
</view>
|
||||
<view class="v12-font-22 v12-secondary-dark-text draw-qty">x1</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
{{ order.drawOrderInfo && order.drawOrderInfo.prizeAttrName || '' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="totalPrice acea-row row-between row-middle" :style="{'padding-bottom': '0'}">
|
||||
<view v-if="order.createTime">
|
||||
<span class="orderTime v12-font-24 v12-dark1-text">{{ order.createTime }}</span>
|
||||
</view>
|
||||
<view class="v12-font-24 v12-dark1-text">
|
||||
共{{ order.totalNum || 0 }}件商品
|
||||
<text v-if="order.isGiftCardReceiveBlind === 0">
|
||||
<text class="v12-dark-text v12-font-28 v12-font-bold">
|
||||
,总金额
|
||||
</text>
|
||||
<text class="v12-font-22 v12-primary-text v12-font-bold">
|
||||
¥
|
||||
</text>
|
||||
<text class="money font-color-lightred v12-font-28 v12-primary-text v12-font-bold">
|
||||
{{ force2Decimal(order.payPrice) }}
|
||||
</text>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="v12-mt-3">
|
||||
<u-line></u-line>
|
||||
</view>
|
||||
<view class="draw-code-row acea-row row-between row-middle">
|
||||
<view class="v12-font-28 v12-dark-text">
|
||||
抽奖码:
|
||||
<text class="v12-primary-text v12-font-bold draw-ticket-code">
|
||||
{{ order.drawOrderInfo && order.drawOrderInfo.ticketCode }}
|
||||
</text>
|
||||
</view>
|
||||
<view
|
||||
v-if="order.drawOrderInfo && order.drawOrderInfo.drawStatusName"
|
||||
class="font-color-white statusTag v12-primary"
|
||||
>
|
||||
{{ order.drawOrderInfo.drawStatusName }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<view
|
||||
v-for="(cart,cartInfoIndex) in order.cartInfo"
|
||||
@@ -295,7 +237,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="!order.experienceOrderInfo && order.isDrawOrder === 0" class="totalPrice acea-row row-between row-middle" :style="{'padding-bottom': order.isTravelGroup === 1 ? '0rpx !important' : '30rpx'}">
|
||||
<view v-if="!order.experienceOrderInfo" class="totalPrice acea-row row-between row-middle" :style="{'padding-bottom': order.isTravelGroup === 1 ? '0rpx !important' : '30rpx'}">
|
||||
<view v-if="order.createTime">
|
||||
<span class="orderTime v12-font-24 v12-dark1-text">{{ order.createTime }}</span>
|
||||
</view>
|
||||
@@ -351,9 +293,8 @@
|
||||
v-if="!order.isGiftCardSend && !order.experienceOrderInfo"
|
||||
class="bottom flex jc-between ai-center"
|
||||
>
|
||||
|
||||
<view
|
||||
v-if="[2, 3].includes(parseInt(order._status._type)) && order.isTickets === 0 && order.isDrawOrder === 0"
|
||||
v-if="[2, 3].includes(parseInt(order._status._type)) && order.isTickets === 0"
|
||||
class="group-btn"
|
||||
>
|
||||
<text
|
||||
@@ -367,7 +308,7 @@
|
||||
@click="goRoom(order)"
|
||||
>联系商家</view>
|
||||
<view
|
||||
v-if="order.isTravelGroup === 0 && order.refundSystemStatus !== 2"
|
||||
v-if="order.isTravelGroup === 0"
|
||||
class="btn flex jc-center ai-center v12-font-24"
|
||||
@click="goRefund(order)"
|
||||
>申请退款</view>
|
||||
@@ -375,12 +316,6 @@
|
||||
</view>
|
||||
<template v-else>
|
||||
<view class="v12-justify-between" style="width: 100%">
|
||||
<view
|
||||
v-if="order.isDrawOrder > 0"
|
||||
class="bnt service"
|
||||
@click.stop="callMerPhone(order)"
|
||||
>联系客服
|
||||
</view>
|
||||
<view>
|
||||
<view
|
||||
v-if="order.isGiftCardReceiveBlind === 0 &&
|
||||
@@ -405,7 +340,6 @@
|
||||
>删除订单</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
<view class="flex">
|
||||
<template v-if="parseInt(order._status._type) === 0">
|
||||
@@ -414,7 +348,7 @@
|
||||
@click="cancelOrder(order)"
|
||||
>取消订单</view>
|
||||
<view
|
||||
v-if="order.isTravelGroup === 0 && order.isDrawOrder === 0"
|
||||
v-if="order.isTravelGroup === 0"
|
||||
class="bnt cancelBnt v12-dark-text v12-dark-border"
|
||||
@click="addressTap(order)"
|
||||
>修改地址</view>
|
||||
@@ -435,7 +369,7 @@
|
||||
@click="applyRefund(order)"
|
||||
>{{ '申请退款' }}</view>
|
||||
<view
|
||||
v-if="canShowModifyAddress(order) && order.isDrawOrder === 0"
|
||||
v-if="canShowModifyAddress(order)"
|
||||
class="bnt service"
|
||||
@click="addressTap(order)"
|
||||
>修改地址</view>
|
||||
@@ -470,7 +404,7 @@
|
||||
</template>
|
||||
<template v-if="parseInt(order._status._type) === 2 && order.isTickets === 0 && order.isTravelGroup === 0">
|
||||
<view
|
||||
v-if="order.isExtendedDelivery === 0 && order.isDrawOrder === 0"
|
||||
v-if="order.isExtendedDelivery === 0"
|
||||
class="bnt default"
|
||||
@click="toDelay(order.orderId)"
|
||||
>延长收货
|
||||
@@ -602,40 +536,6 @@
|
||||
@update:show="showDatePicker = false"
|
||||
@input="handleDateSelected"
|
||||
></DateRangePicker>
|
||||
<view
|
||||
v-if="drawTicketPopup.show"
|
||||
class="draw-ticket-mask"
|
||||
@touchmove.stop.prevent
|
||||
>
|
||||
<view class="draw-ticket-popup">
|
||||
<view class="draw-ticket-close" @click="closeDrawTicketPopup">×</view>
|
||||
<view class="draw-ticket-icon">
|
||||
<view class="ticket-icon-box">
|
||||
<image class="ticket-icon-check" :src="webUrl + '/home/gongxi.png'" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="draw-ticket-title">支付成功</view>
|
||||
<view class="ticket-card-container">
|
||||
<view class="ticket-badge">
|
||||
<text>恭喜获得抽奖码!</text>
|
||||
<view class="ticket-badge-arrow"></view>
|
||||
</view>
|
||||
<view class="ticket-card">
|
||||
<view class="ticket-card-subtitle">
|
||||
<text class="ticket-card-subtitle-text">您的专属抽奖码</text>
|
||||
</view>
|
||||
<view class="ticket-card-code-box">
|
||||
<text class="ticket-card-code">{{ drawTicketPopup.ticketCode }}</text>
|
||||
</view>
|
||||
<view class="ticket-card-time">开奖时间:{{ (drawTicketPopup.drawTime) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="draw-ticket-actions">
|
||||
<view class="action-btn home-btn" @click="goHomeFromPopup">返回首页</view>
|
||||
<view class="action-btn primary" @click="goTicketsFromPopup">查看我的抽奖码</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
@@ -659,12 +559,10 @@ import Loading from "@/components/Loading"
|
||||
import Payment from "@/components/Payment"
|
||||
import { mapGetters } from "vuex"
|
||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||
import settings from '@/config/baseSetting.js'
|
||||
import { orderPaySuccessToCheckDrawStatus } from '@/mixins/orderPaySuccessToCheckDrawStatus.js'
|
||||
|
||||
export default {
|
||||
name: "MyOrder",
|
||||
mixins: [pageListenMixins, orderPaySuccessToCheckDrawStatus],
|
||||
mixins: [pageListenMixins],
|
||||
data() {
|
||||
return {
|
||||
giftItem: {},
|
||||
@@ -1052,14 +950,9 @@ export default {
|
||||
})
|
||||
},
|
||||
async toYuePay(payPwd) {
|
||||
const that = this
|
||||
const orderId = this.orderInfo.orderId
|
||||
// 网络请求
|
||||
await yuePayOrderHandle(orderId, "yue", that.from, payPwd).then(() => {
|
||||
this.afterPaySuccess(orderId, (drawTicketResult) => {
|
||||
this.setDrawTicketPopupFromQuery(drawTicketResult)
|
||||
})
|
||||
});
|
||||
const that = this;
|
||||
//网络请求
|
||||
await yuePayOrderHandle(this.orderInfo.orderId, "yue", that.from, payPwd);
|
||||
that.changeType();
|
||||
this.payPassword = "";
|
||||
},
|
||||
@@ -1074,7 +967,11 @@ export default {
|
||||
subscribePay(order) {
|
||||
this.orderInfo = order
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: settings.SubscribeMessageTmplIds,
|
||||
tmplIds: [
|
||||
'7O3wKw7_D4t7yfSOlvecKuOQP8QEPY88uBx2FJg43HE',
|
||||
'TSmTnGibZ8IxWCiRWOvLxha6-0u7tE-V1-WbDCiPkKU',
|
||||
'9Q6xLHe6HyjkU5Zn5k_2zxYPf2y4MxVyUbOSW8pcZRU'
|
||||
],
|
||||
complete: () => this.pay = true
|
||||
})
|
||||
},
|
||||
@@ -1096,19 +993,6 @@ export default {
|
||||
force2Decimal(v) {
|
||||
return this.$force2Decimal(v)
|
||||
},
|
||||
callMerPhone(order) {
|
||||
const phone = String((order && order.merPhone) || '').trim()
|
||||
if (!phone) {
|
||||
uni.showToast({
|
||||
title: '暂无电话',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: phone
|
||||
})
|
||||
},
|
||||
goRoom(order) {
|
||||
console.log(order);
|
||||
if (order.experienceOrderInfo) {
|
||||
@@ -1167,7 +1051,7 @@ export default {
|
||||
},
|
||||
goLogistics(order) {
|
||||
this.$yrouter.push({
|
||||
path: "/pagesOrder/order/Logistics/index",
|
||||
path: "/pages/order/Logistics/index",
|
||||
query: {
|
||||
id: order.orderId
|
||||
}
|
||||
@@ -1194,7 +1078,7 @@ export default {
|
||||
return
|
||||
}
|
||||
this.$yrouter.push({
|
||||
path: "/pagesOrder/order/OrderDetails/index",
|
||||
path: "/pages/order/OrderDetails/index",
|
||||
query: {
|
||||
id: order.orderId,
|
||||
isGift: order.isGiftCardSend ? 1 : ''
|
||||
@@ -1419,17 +1303,13 @@ export default {
|
||||
}
|
||||
},
|
||||
toPay(type) {
|
||||
const that = this
|
||||
// 余额支付需要输入支付密码
|
||||
if (type == "yue") {
|
||||
this.isShowPayPwdPop = true
|
||||
return
|
||||
} else {
|
||||
const orderId = this.orderInfo.orderId
|
||||
payOrderHandle(orderId, type, this.from).then(() => {
|
||||
this.afterPaySuccess(orderId, (drawTicketResult) => {
|
||||
this.setDrawTicketPopupFromQuery(drawTicketResult)
|
||||
})
|
||||
})
|
||||
payOrderHandle(this.orderInfo.orderId, type, that.from)
|
||||
}
|
||||
},
|
||||
toDelay(id) {
|
||||
@@ -1663,28 +1543,4 @@ page {
|
||||
width: 160rpx !important;
|
||||
height: 160rpx !important;
|
||||
}
|
||||
.draw-order-info .draw-price{
|
||||
text-align: right;
|
||||
}
|
||||
.draw-order-info .draw-price-origin{
|
||||
color: #999;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.draw-order-info .draw-qty{
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
.draw-code-row{
|
||||
margin: 0rpx 0rpx 20rpx 30rpx;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
.draw-ticket-code{
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
.draw-status-tag{
|
||||
color: #fff;
|
||||
background: #c52733;
|
||||
border-radius: 999rpx;
|
||||
padding: 6rpx 24rpx;
|
||||
line-height: 1.4;
|
||||
}
|
||||
</style>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -328,10 +328,7 @@ import {isNullOrEmpty, isWeixin} from "@/utils"
|
||||
import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue'
|
||||
import uniPopup from '@/components/uni-popup/uni-popup.vue'
|
||||
import CouponsPopup from "@/components/CouponsPopup.vue"
|
||||
import { getDrawTicketByOrder } from '@/api/lottery'
|
||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||
import settings from '@/config/baseSetting.js'
|
||||
import { orderPaySuccessToCheckDrawStatus } from '@/mixins/orderPaySuccessToCheckDrawStatus.js'
|
||||
|
||||
const NAME = "OrderSubmission"
|
||||
const _isWeixin = isWeixin()
|
||||
@@ -345,7 +342,7 @@ export default {
|
||||
passkeyborad,
|
||||
CouponsPopup
|
||||
},
|
||||
mixins: [pageListenMixins, orderPaySuccessToCheckDrawStatus],
|
||||
mixins: [pageListenMixins],
|
||||
props: {},
|
||||
data: function () {
|
||||
return {
|
||||
@@ -459,7 +456,7 @@ export default {
|
||||
showStoreList() {
|
||||
this.$store.commit("get_to", "orders")
|
||||
this.$yrouter.push({
|
||||
path: "/pagesShop/shop/StoreList/index"
|
||||
path: "/pages/shop/StoreList/index"
|
||||
})
|
||||
},
|
||||
force2Decimal(value) {
|
||||
@@ -488,7 +485,7 @@ export default {
|
||||
const data = res.data;
|
||||
if (data.status === "EXTEND_ORDER") {
|
||||
this.$yrouter.replace({
|
||||
path: "/pagesOrder/order/OrderDetails/index",
|
||||
path: "/pages/order/OrderDetails/index",
|
||||
query: {
|
||||
id: data.result.orderId
|
||||
}
|
||||
@@ -603,7 +600,11 @@ export default {
|
||||
},
|
||||
subscribePay() {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: settings.SubscribeMessageTmplIds,
|
||||
tmplIds: [
|
||||
'7O3wKw7_D4t7yfSOlvecKuOQP8QEPY88uBx2FJg43HE',
|
||||
'TSmTnGibZ8IxWCiRWOvLxha6-0u7tE-V1-WbDCiPkKU',
|
||||
'9Q6xLHe6HyjkU5Zn5k_2zxYPf2y4MxVyUbOSW8pcZRU'
|
||||
],
|
||||
complete: () => this.createOrder(false)
|
||||
})
|
||||
},
|
||||
@@ -706,7 +707,6 @@ export default {
|
||||
createOrder(this.orderGroupInfo.orderKey, params).then(res => {
|
||||
uni.hideLoading()
|
||||
const data = res.data
|
||||
const orderId = data && data.result ? data.result.orderId : ''
|
||||
switch (data.status) {
|
||||
case "ORDER_EXIST":
|
||||
case "EXTEND_ORDER":
|
||||
@@ -716,9 +716,9 @@ export default {
|
||||
duration: 2000
|
||||
})
|
||||
this.$yrouter.replace({
|
||||
path: "/pagesOrder/order/OrderDetails/index",
|
||||
path: "/pages/order/OrderDetails/index",
|
||||
query: {
|
||||
id: orderId
|
||||
id: data.result.orderId
|
||||
}
|
||||
})
|
||||
break;
|
||||
@@ -743,7 +743,21 @@ export default {
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
})
|
||||
this.paySuccessToMyOrderOrDetail(orderId)
|
||||
if (this.orderGroupInfo.cartInfo && this.orderGroupInfo.cartInfo.length === 1) {
|
||||
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;
|
||||
case "WECHAT_H5_PAY":
|
||||
// H5支付
|
||||
@@ -756,18 +770,24 @@ export default {
|
||||
break;
|
||||
case "WECHAT_PAY":
|
||||
// 小程序支付
|
||||
weappPay(data.result.jsConfig).then(() => {
|
||||
this.paySuccessToMyOrderOrDetail(orderId)
|
||||
}).catch(() => {
|
||||
this.paySuccessToMyOrderOrDetail(orderId)
|
||||
weappPay(data.result.jsConfig).finally(() => {
|
||||
this.$yrouter.replace({
|
||||
path: "/pages/order/MyOrder/index",
|
||||
query: {
|
||||
type: 1
|
||||
}
|
||||
})
|
||||
})
|
||||
break;
|
||||
case "WECHAT_APP_PAY":
|
||||
// APP支付
|
||||
weappPay(data.result.jsConfig).then(() => {
|
||||
this.paySuccessToMyOrderOrDetail(orderId)
|
||||
}).catch(() => {
|
||||
this.paySuccessToMyOrderOrDetail(orderId)
|
||||
weappPay(data.result.jsConfig).finally(() => {
|
||||
this.$yrouter.replace({
|
||||
path: "/pages/order/MyOrder/index",
|
||||
query: {
|
||||
type: 1
|
||||
}
|
||||
});
|
||||
})
|
||||
break;
|
||||
}
|
||||
@@ -782,29 +802,9 @@ export default {
|
||||
duration: 2000
|
||||
})
|
||||
}).finally(function () {
|
||||
if (that.$refs.payPwdPop) {
|
||||
that.isShowPayPwdPop = false
|
||||
that.$refs.payPwdPop.clear()
|
||||
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() {
|
||||
@@ -1007,5 +1007,4 @@ export default {
|
||||
padding: 20rpx 0 0 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<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>
|
||||
@@ -76,7 +76,7 @@ export default {
|
||||
},
|
||||
goOrderDetails(order) {
|
||||
this.$yrouter.push({
|
||||
path: "/pagesOrder/order/OrderDetails/index",
|
||||
path: "/pages/order/OrderDetails/index",
|
||||
query: {id: order.orderId}
|
||||
});
|
||||
},
|
||||
@@ -493,7 +493,6 @@
|
||||
ref="attrWindow"
|
||||
:attr="attr"
|
||||
:cartNum="cart_num"
|
||||
:hideQuantityControls="source === 'countyLottery' && Number(activityId) > 0"
|
||||
@changeFun="changeFun"
|
||||
:isNegotiable="storeInfo.isNegotiable === 1"
|
||||
@gift="gift"
|
||||
@@ -1071,12 +1070,12 @@ export default {
|
||||
},
|
||||
goStoreList() {
|
||||
this.$yrouter.push({
|
||||
path: '/pagesShop/shop/StoreList/index'
|
||||
path: '/pages/shop/StoreList/index'
|
||||
})
|
||||
},
|
||||
goEvaluateList(id) {
|
||||
this.$yrouter.push({
|
||||
path: '/pagesShop/shop/EvaluateList/index',
|
||||
path: '/pages/shop/EvaluateList/index',
|
||||
query: {
|
||||
id
|
||||
}
|
||||
@@ -1496,9 +1495,6 @@ export default {
|
||||
case "day":
|
||||
q.dailyGoodsId = Number(this.activityId)
|
||||
break
|
||||
case "countyLottery":
|
||||
q.drawActivityId = Number(this.activityId || 0)
|
||||
break
|
||||
}
|
||||
postCartAdd(q).then(function (res) {
|
||||
that.isOpen = false
|
||||
@@ -1515,17 +1511,9 @@ export default {
|
||||
}
|
||||
if(news === 2) {
|
||||
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({
|
||||
// + '&couponId=' + coupId
|
||||
url: giftUrl
|
||||
url: '/pkg_user/views/gift/gift?cartId=' + res.data.cartId + (that.storeInfo.discount ? '&discount=' + that.storeInfo.discount : '')
|
||||
})
|
||||
}
|
||||
if(news === 0) {
|
||||
@@ -1886,8 +1874,7 @@ export default {
|
||||
}
|
||||
|
||||
.btn-buy-disabled {
|
||||
background: #9D9D9D !important;
|
||||
color: #FFFFFF !important;
|
||||
background: #9D9D9D;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2115,7 +2102,6 @@ export default {
|
||||
.product-con .footer{
|
||||
height: 140rpx !important;
|
||||
padding-bottom: 20rpx;
|
||||
// z-index: 1002 !important;
|
||||
}
|
||||
.product-con .product-intro .conter view {
|
||||
width: 100% !important;
|
||||
@@ -2248,43 +2234,3 @@ export default {
|
||||
word-break: keep-all;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
.gift-wrap{
|
||||
position: relative;
|
||||
}
|
||||
.gift-bg{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.ll-text{
|
||||
margin-left: 250rpx;
|
||||
word-break: keep-all;
|
||||
}
|
||||
</style>
|
||||
.gift-img{
|
||||
width: 34rpx;
|
||||
height: 34rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.gift-wrap{
|
||||
position: relative;
|
||||
}
|
||||
.gift-bg{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.ll-text{
|
||||
margin-left: 250rpx;
|
||||
word-break: keep-all;
|
||||
}
|
||||
</style>
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.ll-text{
|
||||
margin-left: 250rpx;
|
||||
word-break: keep-all;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -39,9 +39,6 @@
|
||||
:src="historyItem.image"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
<view v-if="isInvalidItem(historyItem)" class="invalid-mask">
|
||||
<text class="invalid-mask-text">商品已下架</text>
|
||||
</view>
|
||||
<view class="good-info">
|
||||
<view
|
||||
v-if="historyItem.couponName"
|
||||
@@ -182,13 +179,6 @@ export default {
|
||||
return str.replace(regx, '')
|
||||
},
|
||||
goodsDetail (item) {
|
||||
if (this.isInvalidItem(item)) {
|
||||
uni.showToast({
|
||||
title: '商品已下架',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.$yrouter.push({
|
||||
path: '/pages/shop/GoodsCon/index',
|
||||
query: {
|
||||
@@ -196,11 +186,6 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
isInvalidItem(item) {
|
||||
if (!item) return false
|
||||
if (item.isInvalid === true || item.isInvalid === 'true') return true
|
||||
return Number(item.isInvalid) === 1
|
||||
},
|
||||
deleteHistoryItem(historyItem) {
|
||||
const id = historyItem.id
|
||||
if (!id) return
|
||||
@@ -291,26 +276,6 @@ export default {
|
||||
width: 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 {
|
||||
padding: 12rpx 12rpx 20rpx 12rpx;
|
||||
.price {
|
||||
@@ -97,7 +97,13 @@ export default {
|
||||
methods: {
|
||||
dataFormat,
|
||||
toDetail(mid){
|
||||
this.$yrouter.push('/pagesUser/user/MessageDetail/MessageDetail?id='+mid);
|
||||
this.$yrouter.push('/pages/user/MessageDetail/MessageDetail?id='+mid);
|
||||
// this.$yrouter.push({
|
||||
// path: "/pages/user/MessageDetail/MessageDetail",
|
||||
// query: {
|
||||
// id:mid
|
||||
// }
|
||||
// });
|
||||
}
|
||||
},
|
||||
onLoad:function(e){
|
||||
@@ -198,7 +198,7 @@ export default {
|
||||
},
|
||||
goOrderDetails(order) {
|
||||
this.$yrouter.push({
|
||||
path: '/pagesOrder/order/OrderDetails/index',
|
||||
path: '/pages/order/OrderDetails/index',
|
||||
query: {
|
||||
id: order.orderId
|
||||
}
|
||||
+1
-1
@@ -129,7 +129,7 @@ export default {
|
||||
//显示协议内容
|
||||
toggleProtocolPage() {
|
||||
//this.$refs.popup.open();
|
||||
this.$yrouter.push('/pagesUser/user/UpgradeProtocolDetail/UpgradeProtocolDetail')
|
||||
this.$yrouter.push('/pages/user/UpgradeProtocolDetail/UpgradeProtocolDetail')
|
||||
|
||||
},
|
||||
chooseIdCardFrontImage() {
|
||||
@@ -86,7 +86,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="my-hdeader-bottom">
|
||||
<view class="item" @click="linkTo('/pagesUser/user/UserBill/index')">
|
||||
<view class="item" @click="linkTo('/pages/user/UserBill/index')">
|
||||
<view v-if="!isNoLogin" class="number">
|
||||
{{ userInfo.nowMoney ? force2Decimal(userInfo.nowMoney) : 0.00 }}
|
||||
</view>
|
||||
@@ -98,7 +98,7 @@
|
||||
余额
|
||||
</view>
|
||||
</view>
|
||||
<view class="item" @click="linkTo('/pagesUser/user/Points/index')">
|
||||
<view class="item" @click="linkTo('/pages/user/Points/index')">
|
||||
<view v-if="!isNoLogin" class="number">
|
||||
{{ userInfo.integral || 0 }}
|
||||
</view>
|
||||
@@ -215,16 +215,6 @@
|
||||
</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="title acea-row row-middle">
|
||||
@@ -311,7 +301,6 @@ import {
|
||||
noticeList,
|
||||
getUserCenterBanner
|
||||
} from "@/api/user"
|
||||
import { getDrawConfig } from '@/api/lottery'
|
||||
import {isWeixin} from "@/utils"
|
||||
import cookie from "@/utils/store/cookie"
|
||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||
@@ -375,7 +364,7 @@ export default {
|
||||
},
|
||||
{
|
||||
text: '账户明细',
|
||||
url: '/pagesUser/user/UserBill/index',
|
||||
url: '/pages/user/UserBill/index',
|
||||
icon: '/icon/icon-coin.png',
|
||||
allowEnter: true
|
||||
},
|
||||
@@ -387,23 +376,19 @@ export default {
|
||||
},
|
||||
{
|
||||
text: '团队管理',
|
||||
url: '/pagesUser/user/promotion/UserPromotion/index',
|
||||
url: '/pages/user/promotion/UserPromotion/index',
|
||||
icon: '/icon/icon-users.png',
|
||||
allowEnter: true
|
||||
},
|
||||
{
|
||||
text: '商品足迹',
|
||||
url: '/pagesUser/user/History/index',
|
||||
url: '/pages/user/History/index',
|
||||
icon: '/icon/icon-help.png',
|
||||
allowEnter: true
|
||||
}
|
||||
],
|
||||
bannerBgUrl: '',
|
||||
userCenterBannerUrl: '',
|
||||
drawConfig: {
|
||||
myTicketImage: '',
|
||||
myTicketImageEnable: 0
|
||||
},
|
||||
pageKeyId: Object.freeze('userIndex'),
|
||||
nowrap: true,
|
||||
// 是否已登录
|
||||
@@ -428,7 +413,6 @@ export default {
|
||||
this.getUserLevelInfoReq()
|
||||
this.isWeixin = isWeixin()
|
||||
// this.getUnreadMsgList()
|
||||
this.getDrawConfigReq()
|
||||
} else {
|
||||
this.isNoLogin = true
|
||||
/*
|
||||
@@ -445,19 +429,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
...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() {
|
||||
this.$nextTick(() => {
|
||||
@@ -515,7 +486,7 @@ export default {
|
||||
}
|
||||
},
|
||||
goReturnList() {
|
||||
this.$yrouter.push('/pagesOrder/order/ReturnList/index')
|
||||
this.$yrouter.push('/pages/order/ReturnList/index')
|
||||
},
|
||||
goMyOrder(type) {
|
||||
if (this.isNoLogin) {
|
||||
@@ -538,7 +509,7 @@ export default {
|
||||
},
|
||||
goUserAccount() {
|
||||
this.$yrouter.push({
|
||||
path: '/pagesUser/user/UserAccount/index'
|
||||
path: '/pages/user/UserAccount/index'
|
||||
})
|
||||
},
|
||||
goPersonalData() {
|
||||
@@ -710,14 +681,6 @@ export default {
|
||||
}
|
||||
.my-wrapper {
|
||||
padding: 30upx;
|
||||
.my-ticket-entry {
|
||||
margin-top: 30rpx;
|
||||
.img {
|
||||
width: 100%;
|
||||
border-radius: 24rpx;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
&.wrapper {
|
||||
padding: 0 0 30rpx 0 !important;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@
|
||||
<view style="color: #fff;">总资产(元)</view>
|
||||
<view class="money">{{ now_money }}</view>
|
||||
</view>
|
||||
<!-- <navigator url="/pagesUser/user/Recharge/index" class="recharge font-color-red">充值</navigator> -->
|
||||
<!-- <navigator url="/pages/user/Recharge/index" class="recharge font-color-red">充值</navigator> -->
|
||||
</view>
|
||||
<view class="cumulative acea-row row-top">
|
||||
<view class="item">
|
||||
@@ -66,7 +66,7 @@ export default {
|
||||
methods: {
|
||||
goUserBill(types) {
|
||||
this.$yrouter.push({
|
||||
path: "/pagesUser/user/UserBill/index",
|
||||
path: "/pages/user/UserBill/index",
|
||||
query: { types }
|
||||
});
|
||||
},
|
||||
+1
@@ -26,6 +26,7 @@ export default {
|
||||
methods: {
|
||||
goUserPromotion() {
|
||||
this.$yrouter.back();
|
||||
// this.$yrouter.push({ path: "/pages/user/promotion/UserPromotion/index" });
|
||||
}
|
||||
}
|
||||
};
|
||||
+4
-4
@@ -127,19 +127,19 @@ export default {
|
||||
return this.$force2Decimal(v);
|
||||
},
|
||||
goPoster() {
|
||||
this.$yrouter.push("/pagesUser/user/promotion/Poster/index");
|
||||
this.$yrouter.push("/pages/user/promotion/Poster/index");
|
||||
},
|
||||
goCashRecord() {
|
||||
this.$yrouter.push('/pkg_user/views/withdrawalLog');
|
||||
},
|
||||
goPromoterList() {
|
||||
this.$yrouter.push("/pagesUser/user/promotion/PromoterList/index");
|
||||
this.$yrouter.push("/pages/user/promotion/PromoterList/index");
|
||||
},
|
||||
goCommissionDetails() {
|
||||
this.$yrouter.push("/pagesUser/user/promotion/CommissionDetails/index");
|
||||
this.$yrouter.push("/pages/user/promotion/CommissionDetails/index");
|
||||
},
|
||||
goPromoterOrder() {
|
||||
this.$yrouter.push("/pagesUser/user/promotion/PromoterOrder/index");
|
||||
this.$yrouter.push("/pages/user/promotion/PromoterOrder/index");
|
||||
},
|
||||
getInfo: function() {
|
||||
let that = this;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,924 @@
|
||||
{
|
||||
"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
@@ -1,812 +0,0 @@
|
||||
<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-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() {
|
||||
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()
|
||||
},
|
||||
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-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>
|
||||
@@ -1,171 +0,0 @@
|
||||
<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>
|
||||
@@ -1,913 +0,0 @@
|
||||
<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>
|
||||
@@ -1,807 +0,0 @@
|
||||
<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) {
|
||||
if (Number(item.claimStatus) === -1) return '奖品过期未领取'
|
||||
return '订单取消'
|
||||
},
|
||||
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>
|
||||
@@ -1,300 +0,0 @@
|
||||
<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) {
|
||||
console.log('用户点击确定')
|
||||
uni.navigateTo({
|
||||
url: '/pagesUser/user/Points/index'
|
||||
url: '/pages/user/Points/index'
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
|
||||
@@ -144,7 +144,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
navToPoint() {
|
||||
uni.navigateTo({url: '/pagesUser/user/Points/index'})
|
||||
uni.navigateTo({url: '/pages/user/Points/index'})
|
||||
},
|
||||
init() {
|
||||
getDetail().then(res => {
|
||||
|
||||
@@ -137,7 +137,6 @@ export default {
|
||||
onShow() {
|
||||
this.content = uni.getStorageSync(this.merName+this.uid+this.storeId)
|
||||
this.connectSocketInit();
|
||||
this.list = []
|
||||
},
|
||||
onUnload() {
|
||||
if (this.socketOpen) {
|
||||
@@ -159,6 +158,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
toGoods(item) {
|
||||
console.log(item);
|
||||
const itemJson = JSON.parse(item.msg_content)
|
||||
if(!itemJson.goodsId) {
|
||||
// 提示数据错误
|
||||
|
||||
@@ -480,8 +480,7 @@ export default {
|
||||
videos: [],
|
||||
district: [],
|
||||
qualificationImg: [],
|
||||
partnerId: '',
|
||||
promoterUid: '',
|
||||
partnerId: 0,
|
||||
experienceStoreCategoryList: [],
|
||||
experienceStoreCategoryIndex: 0,
|
||||
form: {
|
||||
@@ -519,10 +518,9 @@ export default {
|
||||
}
|
||||
},
|
||||
onLoad(opts) {
|
||||
this.partnerId = opts.partnerId || ''
|
||||
this.promoterUid = opts.promoterUid || ''
|
||||
this.partnerId = opts.partnerId
|
||||
this.queryCity()
|
||||
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({ data }) => {
|
||||
getShopData().then(({ data }) => {
|
||||
this.notice = data.merchantApplyNotice
|
||||
})
|
||||
getExperienceStoreCategoryList().then(({ data }) => {
|
||||
|
||||
@@ -57,7 +57,6 @@ export default {
|
||||
return {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
partnerId: '',
|
||||
promoterUid: '',
|
||||
partnerType: '',
|
||||
hotelId: null,
|
||||
hasHotel: null,
|
||||
@@ -72,9 +71,8 @@ export default {
|
||||
},
|
||||
onLoad(options) {
|
||||
this.partnerId = options.partnerId || ''
|
||||
this.promoterUid = options.promoterUid || ''
|
||||
getImages().then(({data}) => this.images = data)
|
||||
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => {
|
||||
getShopData(this.partnerId).then(({data}) => {
|
||||
this.partnerType = data.partnerType
|
||||
this.hotelId = data.hotelId
|
||||
this.hasHotel = data.hasHotel
|
||||
@@ -93,7 +91,7 @@ export default {
|
||||
if (this.hasTravel === 1) {
|
||||
this.$global.goSupplierMini()
|
||||
} else {
|
||||
this.$yrouter.push('/pkg_join/views/travelResidence?partnerId=' + this.partnerId + '&promoterUid=' + this.promoterUid)
|
||||
this.$yrouter.push('/pkg_join/views/travelResidence?partnerId=' + this.partnerId)
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -106,14 +104,14 @@ export default {
|
||||
if (this.hasSupplier === 1) {
|
||||
this.$global.goSupplierMini()
|
||||
} else {
|
||||
this.$yrouter.push(`/pkg_join/views/supplier?type=goods_supplier&partnerId=${this.partnerId}&promoterUid=${this.promoterUid}`)
|
||||
this.$yrouter.push(`/pkg_join/views/supplier?type=goods_supplier&partnerId=${this.partnerId}`)
|
||||
}
|
||||
break
|
||||
case 'wenwan_supplier':
|
||||
if (this.hasSupplier === 1) {
|
||||
this.$global.goSupplierMini()
|
||||
} else {
|
||||
this.$yrouter.push(`/pkg_join/views/supplier?type=wenwan_supplier&partnerId=${this.partnerId}&promoterUid=${this.promoterUid}`)
|
||||
this.$yrouter.push(`/pkg_join/views/supplier?type=wenwan_supplier&partnerId=${this.partnerId}`)
|
||||
}
|
||||
break
|
||||
case 'shop':
|
||||
@@ -131,13 +129,13 @@ export default {
|
||||
this.$global.goSupplierMini()
|
||||
return
|
||||
}
|
||||
this.$yrouter.push('/pkg_join/views/experienceStore?partnerId=' + this.partnerId + '&promoterUid=' + this.promoterUid)
|
||||
this.$yrouter.push('/pkg_join/views/experienceStore?partnerId=' + this.partnerId)
|
||||
break
|
||||
case 'wholesaler':
|
||||
if (this.hasWholesaler === 1) {
|
||||
this.$global.goSupplierMini()
|
||||
} else {
|
||||
this.$yrouter.push(`/pkg_join/views/wholesaler?partnerId=${this.partnerId}&promoterUid=${this.promoterUid}`)
|
||||
this.$yrouter.push(`/pkg_join/views/wholesaler`)
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
+6
-14
@@ -473,8 +473,7 @@ export default {
|
||||
mixins: [pageListenMixins],
|
||||
data() {
|
||||
return {
|
||||
partnerId: '',
|
||||
promoterUid: '',
|
||||
partnerId: null,
|
||||
pics: [],
|
||||
quaPics: [],
|
||||
tips: '获取验证码',
|
||||
@@ -604,8 +603,7 @@ export default {
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.partnerId = options.partnerId || ''
|
||||
this.promoterUid = options.promoterUid || ''
|
||||
this.partnerId = options.partnerId
|
||||
const local_form = uni.getStorageSync('merchantApplyHotel' + '_form') || {}
|
||||
this.quaPics = uni.getStorageSync('merchantApplyHotel' + '_quaPics') || []
|
||||
if(!local_form.serviceTime) {
|
||||
@@ -696,14 +694,11 @@ export default {
|
||||
getCity().then(({data}) => {
|
||||
this.district = data
|
||||
})
|
||||
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => {
|
||||
getShopData().then(({data}) => {
|
||||
this.hotelTypeList = data.hotelTypeList || []
|
||||
this.columnsType = this.hotelTypeList
|
||||
this.notice = data.merchantApplyNotice
|
||||
getCountyFamousHotelType({
|
||||
page: 1,
|
||||
limit: 9999
|
||||
}).then(res => {
|
||||
getCountyFamousHotelType().then(res => {
|
||||
const listData = Array.isArray(res.data)
|
||||
? res.data
|
||||
: (res.data && (res.data.hotelTypeList || res.data.list || res.data.records)) || []
|
||||
@@ -848,10 +843,7 @@ export default {
|
||||
this.form.isCountyFamous = value
|
||||
if (value === 1) {
|
||||
if (this.countyFamousHotelTypeList.length === 0) {
|
||||
getCountyFamousHotelType({
|
||||
page: 1,
|
||||
limit: 9999
|
||||
}).then(res => {
|
||||
getCountyFamousHotelType().then(res => {
|
||||
const listData = Array.isArray(res.data)
|
||||
? res.data
|
||||
: (res.data && (res.data.hotelTypeList || res.data.list || res.data.records)) || []
|
||||
@@ -971,7 +963,7 @@ export default {
|
||||
if (postData.coverType === 2) {
|
||||
postData.cover = postData.coverVideo
|
||||
}
|
||||
saveShop(postData, this.partnerId, this.promoterUid).then(res => {
|
||||
saveShop(postData, this.partnerId).then(res => {
|
||||
if (res.status === 200) {
|
||||
uni.showToast({
|
||||
title: '您的入驻申请已提交成功,请耐心等待审核',
|
||||
|
||||
@@ -567,7 +567,6 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
partnerId: '',
|
||||
promoterUid: '',
|
||||
tips: '获取验证码',
|
||||
infoTitle: '',
|
||||
pics: [],
|
||||
@@ -764,7 +763,6 @@ export default {
|
||||
},
|
||||
onLoad(options) {
|
||||
this.partnerId = options.partnerId || ''
|
||||
this.promoterUid = options.promoterUid || ''
|
||||
const type = options.type
|
||||
const local = uni.getStorageSync(type) || {}
|
||||
const local_form = uni.getStorageSync(type + '_form') || {}
|
||||
@@ -883,7 +881,7 @@ export default {
|
||||
getCity().then(({data}) => {
|
||||
this.district = data
|
||||
})
|
||||
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => {
|
||||
getShopData().then(({data}) => {
|
||||
this.columnsType = data.hotelTypeList
|
||||
this.columnsSupplierType = data.supplierTypeList
|
||||
this.notice = data.merchantApplyNotice
|
||||
@@ -1163,7 +1161,7 @@ export default {
|
||||
postData.cover = postData.coverVideo
|
||||
}
|
||||
if (this.infoTitle === '特产') {
|
||||
saveSupplier(postData, this.formSupplier, this.partnerId, this.promoterUid).then(res => {
|
||||
saveSupplier(postData, this.formSupplier, this.partnerId).then(res => {
|
||||
if (res.status === 200) {
|
||||
uni.showToast({
|
||||
title: '您的入驻申请已提交成功,请耐心等待审核',
|
||||
@@ -1184,7 +1182,7 @@ export default {
|
||||
})
|
||||
})
|
||||
} else {
|
||||
saveWenwanSupplier(postData, this.formSupplier, this.partnerId, this.promoterUid).then(res => {
|
||||
saveWenwanSupplier(postData, this.formSupplier, this.partnerId).then(res => {
|
||||
if (res.status === 200) {
|
||||
uni.showToast({
|
||||
title: '您的入驻申请已提交成功,请耐心等待审核',
|
||||
|
||||
@@ -408,8 +408,7 @@ export default {
|
||||
cultureImg: [],
|
||||
// 资质图片
|
||||
qualificationImg: [],
|
||||
partnerId: '',
|
||||
promoterUid: '',
|
||||
partnerId: 0,
|
||||
captcha: '',
|
||||
form: {
|
||||
/**
|
||||
@@ -467,10 +466,9 @@ export default {
|
||||
}
|
||||
},
|
||||
onLoad(opts) {
|
||||
this.partnerId = opts.partnerId || ''
|
||||
this.promoterUid = opts.promoterUid || ''
|
||||
this.partnerId = opts.partnerId
|
||||
this.queryCity()
|
||||
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => {
|
||||
getShopData().then(({data}) => {
|
||||
this.notice = data.merchantApplyNotice
|
||||
this.initInfo()
|
||||
})
|
||||
|
||||
@@ -322,14 +322,10 @@ export default {
|
||||
stateType: 'primary',
|
||||
// 是否为审核中
|
||||
reviewing: false,
|
||||
pageKeyId: Object.freeze('merchantApplyWholesaler'),
|
||||
partnerId: '',
|
||||
promoterUid: ''
|
||||
pageKeyId: Object.freeze('merchantApplyWholesaler')
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.partnerId = options.partnerId || ''
|
||||
this.promoterUid = options.promoterUid || ''
|
||||
this.init()
|
||||
},
|
||||
onReady() {
|
||||
@@ -377,7 +373,7 @@ export default {
|
||||
getCity().then(({data}) => {
|
||||
this.district = data
|
||||
})
|
||||
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => {
|
||||
getShopData().then(({data}) => {
|
||||
this.notice = data.merchantApplyNotice
|
||||
this.initInfo()
|
||||
})
|
||||
|
||||
@@ -92,18 +92,7 @@
|
||||
</view>
|
||||
<view class="inn-signature-wrap">
|
||||
<view class="triangle"></view>
|
||||
<view
|
||||
v-if="detail.isDrawActivityStart && detail.drawActivityImage"
|
||||
class="inn-signature draw-activity-entry"
|
||||
@click="goDrawActivity"
|
||||
>
|
||||
<image
|
||||
:src="detail.drawActivityImage"
|
||||
mode="widthFix"
|
||||
class="draw-activity-image"
|
||||
/>
|
||||
</view>
|
||||
<view v-else class="inn-signature">
|
||||
<view class="inn-signature">
|
||||
{{ inn.shopIntro }}
|
||||
</view>
|
||||
<view class="share-btn" @click="changeShare">
|
||||
@@ -349,7 +338,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="v12-px-6" >
|
||||
<u-divider :text="infoArray.length === 0 ? ' · 暂无资讯 · ' : ` · ${getLoadMoreText(infoLoading, infoHasMore, infoArray)} · `" textPosition="center"></u-divider>
|
||||
<u-divider :text="infoArray.length === 0 ? ' · 暂无资讯 · ' : ' · 已经到底啦 · '" textPosition="center"></u-divider>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -401,7 +390,7 @@
|
||||
v-if="activeIndex === 2"
|
||||
class="guide-section"
|
||||
>
|
||||
<view v-if="isLoadGuideListoSuccess">
|
||||
<view v-if="isLoadInfoListSuccess">
|
||||
<view class="guide-list">
|
||||
<view
|
||||
v-for="(item, index) in guideList"
|
||||
@@ -430,7 +419,7 @@
|
||||
class="no-data-loadend"
|
||||
/> -->
|
||||
<view class="v12-px-6" >
|
||||
<u-divider :text="guideList.length === 0 ? ' · 暂无攻略 · ' : ` · ${getLoadMoreText(guideLoading, guideHasMore, guideList)} · `" textPosition="center"></u-divider>
|
||||
<u-divider :text="guideList.length === 0 ? ' · 暂无攻略 · ' : ' · 已经到底啦 · '" textPosition="center"></u-divider>
|
||||
</view>
|
||||
</view>
|
||||
<goo-skeleton v-else />
|
||||
@@ -533,9 +522,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="industryList.length > 0 || investmentFileList.length > 0" class="load-more-status">
|
||||
{{ getLoadMoreText(industryLoading || investmentLoading, industryHasMore || investmentHasMore, industryList.length ? industryList : investmentFileList) }}
|
||||
</view>
|
||||
<!-- <view class="project-wrap">
|
||||
<view class="title">
|
||||
<image
|
||||
@@ -636,9 +622,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="shopList.length > 0" class="load-more-status">
|
||||
{{ getLoadMoreText(shopLoading, shopHasMore, shopList) }}
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="industryTabIndex === 2">
|
||||
<view class="card-wrap">
|
||||
@@ -704,9 +687,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="jiaLouList.length > 0" class="load-more-status">
|
||||
{{ getLoadMoreText(jiaLouLoading, jiaLouHasMore, jiaLouList) }}
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="industryTabIndex === 3">
|
||||
<view class="card-wrap">
|
||||
@@ -778,9 +758,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="villageList.length > 0" class="load-more-status">
|
||||
{{ getLoadMoreText(villageLoading, villageHasMore, villageList) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 产品 -->
|
||||
@@ -904,10 +881,7 @@
|
||||
@ok="handleOk"
|
||||
/>
|
||||
<FunctionGuide @hide="setGuide('countyFamousIndex')" :maxStep="2" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
|
||||
<AiEntrance
|
||||
v-if="isLoad"
|
||||
:county-id="inn.areaId"
|
||||
/>
|
||||
<AiEntrance />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -922,6 +896,7 @@ import {
|
||||
postCountyFamousNewsZan,
|
||||
postCountyFamousNewsView,
|
||||
getCountyFamousIndustry,
|
||||
getCountyFamousIndustryProject,
|
||||
getCountyFamousInvestmentFile,
|
||||
getCountyFamousVillage,
|
||||
getCountyFamousCityDetail,
|
||||
@@ -943,7 +918,6 @@ import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||
import FunctionGuide from '@/components/FunctionGuide'
|
||||
import GuideMixins from '@/mixins/GuideMixins'
|
||||
import AiEntrance from '@/components/aiChat/entrance'
|
||||
import { checkDrawTime } from '@/api/lottery'
|
||||
export default {
|
||||
components: {
|
||||
imgBox,
|
||||
@@ -972,7 +946,6 @@ export default {
|
||||
showShare: false,
|
||||
posterUrl: '', // 分享海报
|
||||
id: null,
|
||||
pageSize: 10,
|
||||
partnerId: null,
|
||||
isLike: false, //点赞
|
||||
isFavorite: false,
|
||||
@@ -1021,42 +994,9 @@ export default {
|
||||
countyId: null,
|
||||
newsCategoryList: [],
|
||||
newsCurrent: 0,
|
||||
newsCategoryInited: false,
|
||||
newsCategoryLoading: false,
|
||||
shopList: [],
|
||||
shopTypeList: [],
|
||||
shopTypeActive: '',
|
||||
shopTypeInited: false,
|
||||
detail: {},
|
||||
infoPage: 1,
|
||||
infoHasMore: true,
|
||||
infoLoading: false,
|
||||
infoInited: false,
|
||||
guidePage: 1,
|
||||
guideHasMore: true,
|
||||
guideLoading: false,
|
||||
guideInited: false,
|
||||
industryPage: 1,
|
||||
industryHasMore: true,
|
||||
industryLoading: false,
|
||||
industryInited: false,
|
||||
investmentPage: 1,
|
||||
investmentHasMore: true,
|
||||
investmentLoading: false,
|
||||
investmentInited: false,
|
||||
shopPage: 1,
|
||||
shopHasMore: true,
|
||||
shopLoading: false,
|
||||
shopInited: false,
|
||||
jiaLouPage: 1,
|
||||
jiaLouHasMore: true,
|
||||
jiaLouLoading: false,
|
||||
jiaLouInited: false,
|
||||
villagePage: 1,
|
||||
villageHasMore: true,
|
||||
villageLoading: false,
|
||||
villageInited: false,
|
||||
saleListInited: false
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
@@ -1067,42 +1007,13 @@ export default {
|
||||
return {
|
||||
title: this.inn.countyName || this.share.title,
|
||||
path: '/pkg_product/views/famousQianxianShop?id=' + this.id,
|
||||
imageUrl: this.detail.logo || this.inn.cover
|
||||
imageUrl: this.inn.cover || this.share.imageUrl
|
||||
}
|
||||
},
|
||||
// 必须在页面加 onPageScroll(e){} ,才能滑动显示背景
|
||||
onPageScroll(e) {
|
||||
this.scrollData = e
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.activeIndex === 3) {
|
||||
this.getInfoReq()
|
||||
return
|
||||
}
|
||||
if (this.activeIndex === 2) {
|
||||
this.getGuideReq()
|
||||
return
|
||||
}
|
||||
if (this.activeIndex !== 0) {
|
||||
return
|
||||
}
|
||||
if (this.industryTabIndex === 0) {
|
||||
this.getIndustryReq()
|
||||
this.getInvestmentFileReq()
|
||||
return
|
||||
}
|
||||
if (this.industryTabIndex === 1) {
|
||||
this.getShopList()
|
||||
return
|
||||
}
|
||||
if (this.industryTabIndex === 2) {
|
||||
this.getJiaLouListReq()
|
||||
return
|
||||
}
|
||||
if (this.industryTabIndex === 3) {
|
||||
this.getVillageListReq()
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
const id = options.id || ''
|
||||
this.id = id
|
||||
@@ -1120,77 +1031,29 @@ export default {
|
||||
}
|
||||
if (this.partnerId) cookie.set('spread', this.partnerId)
|
||||
this.getShopDetailReq()
|
||||
this.getInfoReq()
|
||||
this.getGuideReq()
|
||||
// this.initPoster()
|
||||
this.getListReq()
|
||||
this.getsaleList()
|
||||
this.queryGuide('countyFamousIndex')
|
||||
this.getCityNewsCategoryReq()
|
||||
},
|
||||
methods: {
|
||||
getPageList(data) {
|
||||
if (Array.isArray(data)) {
|
||||
return data
|
||||
}
|
||||
return (data && (data.records || data.list || data.data)) || []
|
||||
},
|
||||
getHasMore(data, list, page) {
|
||||
const pageCount = Number(
|
||||
data && (data.pages || data.totalPage || data.last_page || data.pageCount || 0)
|
||||
)
|
||||
const total = Number(
|
||||
data && (data.total || data.totalCount || data.count || 0)
|
||||
)
|
||||
if (pageCount > 0) {
|
||||
return page < pageCount
|
||||
}
|
||||
if (total > 0) {
|
||||
return page * this.pageSize < total
|
||||
}
|
||||
return list.length >= this.pageSize
|
||||
},
|
||||
getLoadMoreText(loading, hasMore, list) {
|
||||
if (!list.length) return ''
|
||||
if (loading) return '加载中...'
|
||||
if (hasMore) return '上拉加载更多'
|
||||
return '没有更多了'
|
||||
},
|
||||
formatInfoList(list = []) {
|
||||
return list.map(info => {
|
||||
var pt = info.createTime.replace(/-/g, "/")
|
||||
info.year = formatDateTime(pt, 'yyyy')
|
||||
info.monthDay = formatDateTime(pt, 'MM/dd')
|
||||
info.time = formatDateTime(pt, 'HH:mm:ss')
|
||||
info.showMore = false
|
||||
return info
|
||||
})
|
||||
},
|
||||
formatGuideList(list = []) {
|
||||
return list.map((info) => {
|
||||
var pt = info.createTime.replace(/-/g, "/")
|
||||
info.year = formatDateTime(pt, 'yyyy')
|
||||
info.monthDay = formatDateTime(pt, 'MM/dd')
|
||||
info.time = formatDateTime(pt, 'HH:mm:ss')
|
||||
return info
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取县城资讯类别
|
||||
*/
|
||||
getCityNewsCategoryReq() {
|
||||
if (this.newsCategoryInited || this.newsCategoryLoading) {
|
||||
return Promise.resolve()
|
||||
}
|
||||
this.newsCategoryLoading = true
|
||||
return getCityNewsCategory().then(res => {
|
||||
getCityNewsCategory().then(res => {
|
||||
if(res.status === 200) {
|
||||
this.newsCategoryList = [{name: '全部', id: ''}].concat(res.data || [])
|
||||
this.newsCategoryInited = true
|
||||
}
|
||||
}).finally(() => {
|
||||
this.newsCategoryLoading = false
|
||||
})
|
||||
},
|
||||
changeNewsTab(index) {
|
||||
if (this.newsCurrent === index) return
|
||||
this.newsCurrent = index
|
||||
this.getInfoReq(true)
|
||||
this.getInfoReq()
|
||||
},
|
||||
formatterTime(time) {
|
||||
const now = new Date();
|
||||
@@ -1353,18 +1216,25 @@ export default {
|
||||
} else {
|
||||
this.saleActived = e.id
|
||||
}
|
||||
this.getVillageListReq(true)
|
||||
},
|
||||
getSaleListReq() {
|
||||
if (this.saleListInited) {
|
||||
return Promise.resolve()
|
||||
|
||||
getCountyFamousVillage({
|
||||
countyFamousDataId: this.id,
|
||||
categoryId: this.saleActived,
|
||||
page: 1,
|
||||
limit: 9999
|
||||
}).then(res => {
|
||||
const { success, data } = res
|
||||
if (success) {
|
||||
this.villageList = data.records || []
|
||||
}
|
||||
})
|
||||
},
|
||||
getsaleList() {
|
||||
const params = {
|
||||
countyFamousDataId: this.id
|
||||
}
|
||||
return getSaleList(params).then(res => {
|
||||
getSaleList(params).then(res => {
|
||||
this.saleList = [{name: '全部', id: ''}].concat(res.data || [])
|
||||
this.saleListInited = true
|
||||
})
|
||||
},
|
||||
goStore(item) {
|
||||
@@ -1391,13 +1261,52 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
getListReq() {
|
||||
this.getIndustryReq(true)
|
||||
this.getInvestmentFileReq(true)
|
||||
getListReq(id) {
|
||||
// getPoster(this.id).then(({data}) => this.posterUrl = data)
|
||||
getCountyFamousIndustry({
|
||||
countyFamousDataId: this.id,
|
||||
page: 1,
|
||||
limit: 9999
|
||||
}).then(res => {
|
||||
const { success, data } = res
|
||||
if (success) {
|
||||
this.industryList = data.records || []
|
||||
}
|
||||
})
|
||||
getCountyFamousIndustryProject({
|
||||
countyFamousDataId: this.id,
|
||||
page: 1,
|
||||
limit: 9999
|
||||
}).then(res => {
|
||||
const { success, data } = res
|
||||
if (success) {
|
||||
this.industryProjectList = data.records || []
|
||||
}
|
||||
})
|
||||
getCountyFamousInvestmentFile({
|
||||
countyFamousDataId: this.id,
|
||||
page: 1,
|
||||
limit: 9999
|
||||
}).then(res => {
|
||||
const { success, data } = res
|
||||
if (success) {
|
||||
this.investmentFileList = data.records || []
|
||||
}
|
||||
})
|
||||
getCountyFamousVillage({
|
||||
countyFamousDataId: this.id,
|
||||
categoryId: id,
|
||||
page: 1,
|
||||
limit: 9999
|
||||
}).then(res => {
|
||||
const { success, data } = res
|
||||
if (success) {
|
||||
this.villageList = data.records || []
|
||||
}
|
||||
})
|
||||
getCountyFamousCityDetail(this.id).then(res => {
|
||||
const { success, data } = res
|
||||
if (success) {
|
||||
this.detail = data
|
||||
this.countyId = data.countyId
|
||||
const products = data.products || []
|
||||
const farmerShops = data.farmerShops || []
|
||||
@@ -1480,38 +1389,34 @@ export default {
|
||||
})
|
||||
},
|
||||
// 资讯
|
||||
getInfoReq(reset = false) {
|
||||
getInfoReq() {
|
||||
const _this = this
|
||||
if (_this.infoLoading) {
|
||||
return
|
||||
}
|
||||
if (!reset && !_this.infoHasMore) {
|
||||
if (_this.loading) {
|
||||
return
|
||||
}
|
||||
_this.isLoadInfoListSuccess = false
|
||||
_this.infoLoading = true
|
||||
const page = reset ? 1 : _this.infoPage
|
||||
if (reset) {
|
||||
_this.infoPage = 1
|
||||
_this.infoHasMore = true
|
||||
_this.loading = true
|
||||
_this.infoArray = []
|
||||
}
|
||||
const categoryId = this.newsCategoryList[this.newsCurrent] ? this.newsCategoryList[this.newsCurrent].id : ''
|
||||
getCountyFamousCityNews({
|
||||
page,
|
||||
limit: this.pageSize,
|
||||
page: 1,
|
||||
limit: 9999,
|
||||
countyFamousDataId: _this.id,
|
||||
categoryId: categoryId
|
||||
}).then(res => {
|
||||
const { data } = res
|
||||
const list = _this.formatInfoList(_this.getPageList(data))
|
||||
const merged = page === 1 ? list : _this.infoArray.concat(list)
|
||||
_this.infoArray = _this.toTop(merged)
|
||||
_this.infoHasMore = _this.getHasMore(data, list, page)
|
||||
_this.infoPage = page + 1
|
||||
_this.infoInited = true
|
||||
_this.loading = false
|
||||
_this.infoArray.push.apply(_this.infoArray, _this.toTop(data.records).map((info) => {
|
||||
var pt = info.createTime.replace(/-/g, "/")
|
||||
info.year = formatDateTime(pt, 'yyyy')
|
||||
info.monthDay = formatDateTime(pt, 'MM/dd')
|
||||
info.time = formatDateTime(pt, 'HH:mm:ss')
|
||||
info.showMore = false
|
||||
return info
|
||||
}))
|
||||
// console.log(this.toTop(_this.infoArray));
|
||||
}).finally(() => {
|
||||
_this.infoLoading = false
|
||||
_this.loading = false
|
||||
_this.isLoadInfoListSuccess = true
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
@@ -1522,35 +1427,30 @@ export default {
|
||||
})
|
||||
},
|
||||
// 攻略
|
||||
getGuideReq(reset = false) {
|
||||
getGuideReq() {
|
||||
const _this = this
|
||||
if (_this.guideLoading) {
|
||||
return
|
||||
}
|
||||
if (!reset && !_this.guideHasMore) {
|
||||
if (_this.loading) {
|
||||
return
|
||||
}
|
||||
_this.isLoadGuideListoSuccess = false
|
||||
_this.guideLoading = true
|
||||
const page = reset ? 1 : _this.guidePage
|
||||
if (reset) {
|
||||
_this.guidePage = 1
|
||||
_this.guideHasMore = true
|
||||
_this.loading = true
|
||||
_this.guideList = []
|
||||
}
|
||||
getCountyFamousCityGuide({
|
||||
page,
|
||||
limit: this.pageSize,
|
||||
page: 1,
|
||||
limit: 9999,
|
||||
countyFamousDataId: _this.id
|
||||
}).then(res => {
|
||||
const { data } = res
|
||||
const list = _this.formatGuideList(_this.getPageList(data))
|
||||
_this.guideList = page === 1 ? list : _this.guideList.concat(list)
|
||||
_this.guideHasMore = _this.getHasMore(data, list, page)
|
||||
_this.guidePage = page + 1
|
||||
_this.guideInited = true
|
||||
_this.loading = false
|
||||
_this.guideList.push.apply(_this.guideList, data.records.map((info) => {
|
||||
var pt = info.createTime.replace(/-/g, "/")
|
||||
info.year = formatDateTime(pt, 'yyyy')
|
||||
info.monthDay = formatDateTime(pt, 'MM/dd')
|
||||
info.time = formatDateTime(pt, 'HH:mm:ss')
|
||||
return info
|
||||
}))
|
||||
}).finally(() => {
|
||||
_this.guideLoading = false
|
||||
_this.loading = false
|
||||
_this.isLoadGuideListoSuccess = true
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
@@ -1562,35 +1462,10 @@ export default {
|
||||
// 刷新数据
|
||||
switch (this.activeIndex) {
|
||||
case 3:
|
||||
this.getCityNewsCategoryReq().finally(() => {
|
||||
if (!this.infoInited) {
|
||||
this.getInfoReq(true)
|
||||
}
|
||||
})
|
||||
this.getInfoReq()
|
||||
break
|
||||
case 2:
|
||||
if (!this.guideInited) {
|
||||
this.getGuideReq(true)
|
||||
}
|
||||
break
|
||||
case 0:
|
||||
if (this.industryTabIndex === 1) {
|
||||
if (!this.shopTypeInited) {
|
||||
this.getShopTypeList()
|
||||
}
|
||||
if (!this.shopInited) {
|
||||
this.getShopList(true)
|
||||
}
|
||||
}
|
||||
if (this.industryTabIndex === 2 && !this.jiaLouInited) {
|
||||
this.getJiaLouListReq(true)
|
||||
}
|
||||
if (this.industryTabIndex === 3) {
|
||||
this.getSaleListReq()
|
||||
if (!this.villageInited) {
|
||||
this.getVillageListReq(true)
|
||||
}
|
||||
}
|
||||
this.getGuideReq()
|
||||
break
|
||||
default:
|
||||
break
|
||||
@@ -1764,34 +1639,6 @@ export default {
|
||||
toggleCountyIntro() {
|
||||
this.toggleCountyIntroStatus = !this.toggleCountyIntroStatus
|
||||
},
|
||||
parseCheckTimeResult(res) {
|
||||
if (typeof res === 'boolean') return res
|
||||
if (typeof (res && res.data) === 'boolean') return res.data
|
||||
if (res && typeof res.success !== 'undefined') return Boolean(res.data)
|
||||
return false
|
||||
},
|
||||
async goDrawActivity() {
|
||||
const activityId = Number(this.detail.drawActivityId) || 0
|
||||
if (!activityId) {
|
||||
uni.showToast({
|
||||
title: '活动暂未配置',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
let opened = false
|
||||
try {
|
||||
const res = await checkDrawTime(activityId)
|
||||
opened = this.parseCheckTimeResult(res)
|
||||
} catch (e) {
|
||||
opened = false
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: opened
|
||||
? `/pkg-video/views/county-winners?activityId=${activityId}`
|
||||
: `/pkg-video/views/county-lottery?activityId=${activityId}`
|
||||
})
|
||||
},
|
||||
showPic(index) {
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
@@ -1835,202 +1682,50 @@ export default {
|
||||
if (index === this.industryTabIndex) return
|
||||
this.industryTabIndex = index
|
||||
if (index === 2) {
|
||||
if (!this.jiaLouInited) {
|
||||
this.getJiaLouListReq(true)
|
||||
const params = {
|
||||
countyId: this.countyId,
|
||||
shopType: 'countyFamous',
|
||||
name: '',
|
||||
page: 1,
|
||||
limit: 9999
|
||||
}
|
||||
getJiaLouList(params).then(res => {
|
||||
this.jiaLouList = res.data.records || []
|
||||
})
|
||||
}
|
||||
if (index === 1) {
|
||||
this.shopTypeActive = ''
|
||||
if (this.shopTypeList.length === 0) {
|
||||
this.getShopTypeList()
|
||||
}
|
||||
if (!this.shopInited) {
|
||||
this.getShopList(true)
|
||||
}
|
||||
}
|
||||
if (index === 3) {
|
||||
this.getSaleListReq()
|
||||
if (!this.villageInited) {
|
||||
this.getVillageListReq(true)
|
||||
}
|
||||
this.getShopList()
|
||||
}
|
||||
},
|
||||
getShopTypeList() {
|
||||
if (this.shopTypeInited) {
|
||||
return
|
||||
}
|
||||
getCountyFamousHotelType({
|
||||
page: 1,
|
||||
limit: 9999
|
||||
}).then(res => {
|
||||
getCountyFamousHotelType().then(res => {
|
||||
const listData = Array.isArray(res.data)
|
||||
? res.data
|
||||
: (res.data && (res.data.hotelTypeList || res.data.list || res.data.records)) || []
|
||||
this.shopTypeList = [{ name: '全部', id: '' }].concat(listData || [])
|
||||
this.shopTypeInited = true
|
||||
})
|
||||
},
|
||||
getIndustryReq(reset = false) {
|
||||
if (this.industryLoading) {
|
||||
return
|
||||
}
|
||||
if (!reset && !this.industryHasMore) {
|
||||
return
|
||||
}
|
||||
const page = reset ? 1 : this.industryPage
|
||||
if (reset) {
|
||||
this.industryPage = 1
|
||||
this.industryHasMore = true
|
||||
this.industryList = []
|
||||
}
|
||||
this.industryLoading = true
|
||||
getCountyFamousIndustry({
|
||||
countyFamousDataId: this.id,
|
||||
page,
|
||||
limit: this.pageSize
|
||||
}).then(res => {
|
||||
const { success, data } = res
|
||||
if (success) {
|
||||
const list = this.getPageList(data)
|
||||
this.industryList = page === 1 ? list : this.industryList.concat(list)
|
||||
this.industryHasMore = this.getHasMore(data, list, page)
|
||||
this.industryPage = page + 1
|
||||
this.industryInited = true
|
||||
}
|
||||
}).finally(() => {
|
||||
this.industryLoading = false
|
||||
})
|
||||
},
|
||||
getInvestmentFileReq(reset = false) {
|
||||
if (this.investmentLoading) {
|
||||
return
|
||||
}
|
||||
if (!reset && !this.investmentHasMore) {
|
||||
return
|
||||
}
|
||||
const page = reset ? 1 : this.investmentPage
|
||||
if (reset) {
|
||||
this.investmentPage = 1
|
||||
this.investmentHasMore = true
|
||||
this.investmentFileList = []
|
||||
}
|
||||
this.investmentLoading = true
|
||||
getCountyFamousInvestmentFile({
|
||||
countyFamousDataId: this.id,
|
||||
page,
|
||||
limit: this.pageSize
|
||||
}).then(res => {
|
||||
const { success, data } = res
|
||||
if (success) {
|
||||
const list = this.getPageList(data)
|
||||
this.investmentFileList = page === 1 ? list : this.investmentFileList.concat(list)
|
||||
this.investmentHasMore = this.getHasMore(data, list, page)
|
||||
this.investmentPage = page + 1
|
||||
this.investmentInited = true
|
||||
}
|
||||
}).finally(() => {
|
||||
this.investmentLoading = false
|
||||
})
|
||||
},
|
||||
getJiaLouListReq(reset = false) {
|
||||
if (this.jiaLouLoading || !this.countyId) {
|
||||
return
|
||||
}
|
||||
if (!reset && !this.jiaLouHasMore) {
|
||||
return
|
||||
}
|
||||
const page = reset ? 1 : this.jiaLouPage
|
||||
if (reset) {
|
||||
this.jiaLouPage = 1
|
||||
this.jiaLouHasMore = true
|
||||
this.jiaLouList = []
|
||||
}
|
||||
this.jiaLouLoading = true
|
||||
const params = {
|
||||
countyId: this.countyId,
|
||||
shopType: 'countyFamous',
|
||||
name: '',
|
||||
page,
|
||||
limit: this.pageSize
|
||||
}
|
||||
getJiaLouList(params).then(res => {
|
||||
const list = this.getPageList(res.data)
|
||||
this.jiaLouList = page === 1 ? list : this.jiaLouList.concat(list)
|
||||
this.jiaLouHasMore = this.getHasMore(res.data, list, page)
|
||||
this.jiaLouPage = page + 1
|
||||
this.jiaLouInited = true
|
||||
}).finally(() => {
|
||||
this.jiaLouLoading = false
|
||||
})
|
||||
},
|
||||
getShopList(reset = false) {
|
||||
if (this.shopLoading) {
|
||||
return
|
||||
}
|
||||
if (!reset && !this.shopHasMore) {
|
||||
return
|
||||
}
|
||||
const page = reset ? 1 : this.shopPage
|
||||
if (reset) {
|
||||
this.shopPage = 1
|
||||
this.shopHasMore = true
|
||||
this.shopList = []
|
||||
}
|
||||
getShopList() {
|
||||
const params = {
|
||||
countyFamousDataId: this.id,
|
||||
page,
|
||||
limit: this.pageSize
|
||||
page: 1,
|
||||
limit: 9999
|
||||
}
|
||||
if (this.shopTypeActive) {
|
||||
params.countyFamousHotelType = this.shopTypeActive
|
||||
}
|
||||
this.shopLoading = true
|
||||
getCityShopList(params).then(res => {
|
||||
const list = this.getPageList(res.data)
|
||||
this.shopList = page === 1 ? list : this.shopList.concat(list)
|
||||
this.shopHasMore = this.getHasMore(res.data, list, page)
|
||||
this.shopPage = page + 1
|
||||
this.shopInited = true
|
||||
}).finally(() => {
|
||||
this.shopLoading = false
|
||||
this.shopList = (res.data && (res.data.records || res.data.list)) || []
|
||||
})
|
||||
},
|
||||
handleShopType(type) {
|
||||
if (this.shopTypeActive === type.id) return
|
||||
this.shopTypeActive = type.id
|
||||
this.getShopList(true)
|
||||
},
|
||||
getVillageListReq(reset = false) {
|
||||
if (this.villageLoading) {
|
||||
return
|
||||
}
|
||||
if (!reset && !this.villageHasMore) {
|
||||
return
|
||||
}
|
||||
const page = reset ? 1 : this.villagePage
|
||||
if (reset) {
|
||||
this.villagePage = 1
|
||||
this.villageHasMore = true
|
||||
this.villageList = []
|
||||
}
|
||||
this.villageLoading = true
|
||||
getCountyFamousVillage({
|
||||
countyFamousDataId: this.id,
|
||||
categoryId: this.saleActived,
|
||||
page,
|
||||
limit: this.pageSize
|
||||
}).then(res => {
|
||||
const { success, data } = res
|
||||
if (success) {
|
||||
const list = this.getPageList(data)
|
||||
this.villageList = page === 1 ? list : this.villageList.concat(list)
|
||||
this.villageHasMore = this.getHasMore(data, list, page)
|
||||
this.villagePage = page + 1
|
||||
this.villageInited = true
|
||||
}
|
||||
}).finally(() => {
|
||||
this.villageLoading = false
|
||||
})
|
||||
this.getShopList()
|
||||
},
|
||||
fileItemClick(file) {
|
||||
const url = file.attachment || ''
|
||||
@@ -2158,12 +1853,6 @@ export default {
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
.load-more-status{
|
||||
padding: 24rpx 0 8rpx;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
.video-item {
|
||||
width: 100%;
|
||||
height: 400rpx;
|
||||
@@ -2335,14 +2024,6 @@ export default {
|
||||
background: rgba(243,243,246,0.39);
|
||||
box-shadow: 0px 6px 12px rgba(0,0,0,0.12);
|
||||
}
|
||||
.draw-activity-entry {
|
||||
padding: 0;
|
||||
}
|
||||
.draw-activity-image {
|
||||
width: 100%;
|
||||
display: block;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
.share-btn {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
<template>
|
||||
<view class="gift-page">
|
||||
<view class="banner" @click="linkTo">
|
||||
<view v-if="topBannerImage" class="banner-image-wrap">
|
||||
<image
|
||||
:src="topBannerImage"
|
||||
class="banner-img"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
</view>
|
||||
<rich-text :nodes="topBannerHtml" />
|
||||
</view>
|
||||
<view class="province-enter-wrap">
|
||||
<view
|
||||
@@ -66,13 +60,7 @@
|
||||
class="item"
|
||||
>
|
||||
<view class="bg" @click="provinceItemClick(item)">
|
||||
<!-- <rich-text :nodes="item.bgHtml" /> -->
|
||||
<image
|
||||
:src="item.backgroundImage"
|
||||
class="bg-img"
|
||||
mode="widthFix|aspectFill"
|
||||
lazy-load
|
||||
/>
|
||||
<rich-text :nodes="item.bgHtml" />
|
||||
</view>
|
||||
<view class="good-list">
|
||||
<view
|
||||
@@ -82,7 +70,7 @@
|
||||
@click.stop="goodItemClick(goodItem)"
|
||||
>
|
||||
<view class="good-img">
|
||||
<image :src="goodItem.productImage" class="img" lazy-load />
|
||||
<image :src="goodItem.productImage" class="img" />
|
||||
</view>
|
||||
<view class="name">
|
||||
{{ goodItem.productName }}
|
||||
@@ -109,7 +97,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
provinceList: [],
|
||||
topBannerImage: '',
|
||||
topBannerHtml: '',
|
||||
topBannerUrl: '',
|
||||
toggleStatus: false,
|
||||
pageKeyId: Object.freeze('customizedGiftIndex')
|
||||
@@ -123,7 +111,7 @@ export default {
|
||||
customizedGift().then(res => {
|
||||
const { success, data } = res
|
||||
if (success) {
|
||||
this.topBannerImage = data.topBanner.image || ''
|
||||
this.topBannerHtml = `<img src="${data.topBanner.image}" style="display: block;max-width: 100%;">`
|
||||
this.topBannerUrl = data.topBanner.appUrl || ''
|
||||
const list = data.cities || []
|
||||
if (list.length > 0) {
|
||||
@@ -132,7 +120,7 @@ export default {
|
||||
if (backgroundImage && item.productList.length > 0) {
|
||||
this.provinceList.push({
|
||||
...item,
|
||||
backgroundImage
|
||||
bgHtml: `<img src="${item.backgroundImage}" style="display: block;max-width: 100%;">`
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -176,21 +164,6 @@ export default {
|
||||
.banner {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
.banner-image-wrap {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding-top: 46%;
|
||||
overflow: hidden;
|
||||
background-color: #f6f6f6;
|
||||
}
|
||||
.banner-img {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
.province-enter-wrap {
|
||||
position: relative;
|
||||
@@ -270,15 +243,6 @@ export default {
|
||||
.bg {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
border-radius: 20rpx;
|
||||
background-color: #f6f6f6;
|
||||
.bg-img {
|
||||
top: 0;
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
.good-list {
|
||||
position: absolute;
|
||||
|
||||
@@ -486,7 +486,7 @@ export default {
|
||||
goEvaluateList() {
|
||||
if (!this.id) return
|
||||
this.$yrouter.push({
|
||||
path: '/pagesShop/shop/EvaluateList/index',
|
||||
path: '/pages/shop/EvaluateList/index',
|
||||
query: {
|
||||
id: this.id,
|
||||
isTravelGroup: 1
|
||||
|
||||
@@ -164,13 +164,10 @@
|
||||
<image :src="webUrl + '/orderIcon/微信图片_20241009220552.png'" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="items.length > 0" class="load-more-status">
|
||||
{{ loading ? '加载中...' : (hasMore ? '上拉加载更多' : '没有更多了') }}
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getCategory } from '@/api/health'
|
||||
import { getCategory,getWellnessPlace } from '@/api/health'
|
||||
import { getJiaLouList } from '@/api/qianxian'
|
||||
import { getWellnessTopImage } from '@/api/health'
|
||||
export default {
|
||||
@@ -179,15 +176,12 @@ export default {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
tabs: [],
|
||||
items: [],
|
||||
traveItems: [],
|
||||
actived: 0,
|
||||
cityId: '',
|
||||
cityName: '',
|
||||
categoryId: null,
|
||||
topImageConfig: {},
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
loading: false,
|
||||
hasMore: true
|
||||
topImageConfig: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -214,12 +208,10 @@ export default {
|
||||
getCategory().then(res => {
|
||||
this.tabs = res.data
|
||||
this.categoryId = res.data[0].id
|
||||
this.getList(true)
|
||||
})
|
||||
this.getTopImage()
|
||||
},
|
||||
onReachBottom() {
|
||||
this.getList()
|
||||
})
|
||||
this.getTop()
|
||||
this.getTopImage()
|
||||
},
|
||||
onUnload() {
|
||||
// uni.navigateBack({
|
||||
@@ -228,10 +220,9 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleTab(index, tab) {
|
||||
if (this.actived === index) return
|
||||
this.actived = index
|
||||
this.categoryId = tab.id
|
||||
this.getList(true)
|
||||
this.getList()
|
||||
},
|
||||
toSanctun() {
|
||||
uni.redirectTo({
|
||||
@@ -243,52 +234,18 @@ export default {
|
||||
url: '/pkg_product/views/healthFoods?city=' + this.cityId + '&cityName=' + this.cityName
|
||||
})
|
||||
},
|
||||
getPageList(data) {
|
||||
if (Array.isArray(data)) {
|
||||
return data
|
||||
}
|
||||
return (data && (data.records || data.list || data.data)) || []
|
||||
},
|
||||
getHasMore(data, list, page) {
|
||||
const pageCount = Number(
|
||||
data && (data.pages || data.totalPage || data.last_page || data.pageCount || 0)
|
||||
)
|
||||
const total = Number(
|
||||
data && (data.total || data.totalCount || data.count || 0)
|
||||
)
|
||||
if (pageCount > 0) {
|
||||
return page < pageCount
|
||||
}
|
||||
if (total > 0) {
|
||||
return page * this.pageSize < total
|
||||
}
|
||||
return list.length >= this.pageSize
|
||||
},
|
||||
getList(reset = false) {
|
||||
if (this.loading) return
|
||||
if (!reset && !this.hasMore) return
|
||||
const page = reset ? 1 : this.page
|
||||
if (reset) {
|
||||
this.page = 1
|
||||
this.hasMore = true
|
||||
this.items = []
|
||||
}
|
||||
getList() {
|
||||
const params = {
|
||||
// countyId: this.cityId,
|
||||
goodCityId: this.cityId,
|
||||
wellnessPlaceCateId : this.categoryId,
|
||||
shopType: 'wellnessCate',
|
||||
page,
|
||||
limit: this.pageSize
|
||||
page: 1,
|
||||
limit: 9999
|
||||
}
|
||||
this.loading = true
|
||||
getJiaLouList(params).then(res => {
|
||||
const list = this.getPageList(res.data)
|
||||
this.items = page === 1 ? list : this.items.concat(list)
|
||||
this.hasMore = this.getHasMore(res.data, list, page)
|
||||
this.page = page + 1
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
// console.log(res);
|
||||
this.items = res.data.records
|
||||
})
|
||||
},
|
||||
search() {
|
||||
@@ -296,6 +253,18 @@ export default {
|
||||
url: '/pkg_product/views/healthSearch?city=' + this.cityId + '&cityName=' + this.cityName
|
||||
})
|
||||
},
|
||||
getTop() {
|
||||
const params = {
|
||||
goodCityId: this.cityId,
|
||||
shopType: 'wellnessTop',
|
||||
page: 1,
|
||||
limit: 9999
|
||||
}
|
||||
getJiaLouList(params).then(res => {
|
||||
// console.log(res);
|
||||
this.traveItems = res.data.records
|
||||
})
|
||||
},
|
||||
toStore(item) {
|
||||
if(item.dataType === 'wellnessPlace'){
|
||||
this.$yrouter.push({
|
||||
@@ -467,10 +436,4 @@ export default {
|
||||
border-radius: 100rpx;
|
||||
padding: 4rpx 20rpx;
|
||||
}
|
||||
.load-more-status{
|
||||
padding: 24rpx 0 40rpx;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -134,27 +134,24 @@
|
||||
<image :src="webUrl + '/orderIcon/微信图片_20241009220552.png'" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="items.length > 0" class="load-more-status">
|
||||
{{ loading ? '加载中...' : (hasMore ? '上拉加载更多' : '没有更多了') }}
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getCategory,getWellnessPlace } from '@/api/health'
|
||||
import { getJiaLouList } from '@/api/qianxian'
|
||||
import { getWellnessTopImage } from '@/api/health'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
tabs: [],
|
||||
items: [],
|
||||
traveItems: [],
|
||||
actived: 0,
|
||||
cityId: '',
|
||||
cityName: '',
|
||||
topImageConfig: {},
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
loading: false,
|
||||
hasMore: true
|
||||
categoryId: null,
|
||||
topImageConfig: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -178,69 +175,41 @@ export default {
|
||||
|
||||
this.cityId = opts.city
|
||||
this.cityName = decodeURIComponent(decodeURIComponent(opts.cityName))
|
||||
this.getList(true)
|
||||
getCategory().then(res => {
|
||||
this.tabs = res.data
|
||||
this.categoryId = res.data[0].id
|
||||
this.getList()
|
||||
})
|
||||
this.getTop()
|
||||
this.getTopImage()
|
||||
},
|
||||
onReachBottom() {
|
||||
this.getList()
|
||||
},
|
||||
onUnload() {
|
||||
// uni.navigateBack({
|
||||
// delta: 0
|
||||
// })
|
||||
},
|
||||
methods: {
|
||||
handleTab(index, tab) {
|
||||
this.actived = index
|
||||
this.categoryId = tab.id
|
||||
this.getList()
|
||||
},
|
||||
toFoods() {
|
||||
uni.redirectTo({
|
||||
url: '/pkg_product/views/healthFoods?city=' + this.cityId + '&cityName=' + this.cityName
|
||||
})
|
||||
},
|
||||
getPageList(data) {
|
||||
if (Array.isArray(data)) {
|
||||
return data
|
||||
}
|
||||
return (data && (data.records || data.list || data.data)) || []
|
||||
},
|
||||
getHasMore(data, list, page) {
|
||||
const pageCount = Number(
|
||||
data && (data.pages || data.totalPage || data.last_page || data.pageCount || 0)
|
||||
)
|
||||
const total = Number(
|
||||
data && (data.total || data.totalCount || data.count || 0)
|
||||
)
|
||||
if (pageCount > 0) {
|
||||
return page < pageCount
|
||||
}
|
||||
if (total > 0) {
|
||||
return page * this.pageSize < total
|
||||
}
|
||||
return list.length >= this.pageSize
|
||||
},
|
||||
getList(reset = false) {
|
||||
if (this.loading) return
|
||||
if (!reset && !this.hasMore) return
|
||||
const page = reset ? 1 : this.page
|
||||
if (reset) {
|
||||
this.page = 1
|
||||
this.hasMore = true
|
||||
this.items = []
|
||||
}
|
||||
getList() {
|
||||
const params = {
|
||||
// countyId: this.cityId,
|
||||
goodCityId: this.cityId,
|
||||
shopType: 'wellnessTravel',
|
||||
page,
|
||||
limit: this.pageSize
|
||||
page: 1,
|
||||
limit: 9999
|
||||
}
|
||||
this.loading = true
|
||||
getJiaLouList(params).then(res => {
|
||||
const list = this.getPageList(res.data)
|
||||
this.items = page === 1 ? list : this.items.concat(list)
|
||||
this.hasMore = this.getHasMore(res.data, list, page)
|
||||
this.page = page + 1
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
// console.log(res);
|
||||
this.items = res.data.records
|
||||
})
|
||||
},
|
||||
search() {
|
||||
@@ -253,10 +222,11 @@ export default {
|
||||
goodCityId: this.cityId,
|
||||
shopType: 'wellnessTop',
|
||||
page: 1,
|
||||
limit: 10
|
||||
limit: 9999
|
||||
}
|
||||
getJiaLouList(params).then(res => {
|
||||
this.traveItems = this.getPageList(res.data)
|
||||
// console.log(res);
|
||||
this.traveItems = res.data.records
|
||||
})
|
||||
},
|
||||
toStore(item) {
|
||||
@@ -420,10 +390,4 @@ export default {
|
||||
border-radius: 6rpx;
|
||||
bottom: 5rpx;
|
||||
}
|
||||
.load-more-status{
|
||||
padding: 24rpx 0 40rpx;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,28 +1,9 @@
|
||||
<template>
|
||||
<view class="pkg-product-heritage">
|
||||
<view class="top-image-wrap">
|
||||
<image
|
||||
style="width: 100%"
|
||||
:src="topImage"
|
||||
mode="widthFix"
|
||||
:class="{ loaded: topImageLoaded }"
|
||||
class="top-image"
|
||||
@load="handleTopImageLoad"
|
||||
/>
|
||||
</view>
|
||||
<image style="width: 100%" :src="topImage" mode="widthFix" />
|
||||
<view class="main-box" id="main-box">
|
||||
<view class="bg-image-wrap">
|
||||
<image
|
||||
style="width: 100%"
|
||||
:src="backgroundImage"
|
||||
mode="widthFix"
|
||||
class="bg-image"
|
||||
:class="{ loaded: bgImageLoaded }"
|
||||
@load="loadImg"
|
||||
/>
|
||||
</view>
|
||||
<image style="width: 100%" :src="backgroundImage" mode="widthFix" @load="loadImg" />
|
||||
<view
|
||||
v-if="showItems"
|
||||
class="item"
|
||||
:style="{ left: item.gx + 'rpx', top: item.gy + 'rpx' }"
|
||||
v-for="(item, index) in contents"
|
||||
@@ -33,7 +14,6 @@
|
||||
class="img-item"
|
||||
:src="item.image"
|
||||
:class="{ unlink: !item.isLink }"
|
||||
lazy-load
|
||||
/>
|
||||
|
||||
</view>
|
||||
@@ -60,9 +40,6 @@ export default {
|
||||
topImage: "",
|
||||
backgroundImage: "",
|
||||
bgImgWidth: 0,
|
||||
topImageLoaded: false,
|
||||
bgImageLoaded: false,
|
||||
showItems: false,
|
||||
pageKeyId: Object.freeze("ichIndex"),
|
||||
};
|
||||
},
|
||||
@@ -76,14 +53,7 @@ export default {
|
||||
this.queryGuide('ichIndex')
|
||||
},
|
||||
methods: {
|
||||
handleTopImageLoad() {
|
||||
this.topImageLoaded = true
|
||||
},
|
||||
loadImg(e) {
|
||||
this.bgImageLoaded = true
|
||||
this.$nextTick(() => {
|
||||
this.showItems = true
|
||||
})
|
||||
this.queryGuide('ichIndex')
|
||||
},
|
||||
showFunctionGuide() {
|
||||
@@ -155,9 +125,6 @@ export default {
|
||||
},
|
||||
init() {
|
||||
getICH().then(({ data }) => {
|
||||
this.topImageLoaded = false
|
||||
this.bgImageLoaded = false
|
||||
this.showItems = false
|
||||
this.contents = data.contents;
|
||||
this.topImage = data.topImage;
|
||||
this.backgroundImage = data.backgroundImage;
|
||||
@@ -211,24 +178,6 @@ export default {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.top-image-wrap,
|
||||
.bg-image-wrap {
|
||||
background: #f6f6f6;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.top-image,
|
||||
.bg-image {
|
||||
display: block;
|
||||
opacity: 0;
|
||||
transition: opacity .25s ease;
|
||||
}
|
||||
|
||||
.top-image.loaded,
|
||||
.bg-image.loaded {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.main-box {
|
||||
position: relative;
|
||||
|
||||
@@ -239,7 +188,6 @@ export default {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
will-change: transform;
|
||||
.title {
|
||||
position: relative;
|
||||
width: fit-content;
|
||||
|
||||
@@ -500,7 +500,7 @@ export default {
|
||||
return
|
||||
}
|
||||
this.$yrouter.push({
|
||||
path: '/pagesShop/shop/GoodsEvaluate/index',
|
||||
path: '/pages/shop/GoodsEvaluate/index',
|
||||
query: {
|
||||
id: orderId,
|
||||
isTravelGroup: 1
|
||||
|
||||
@@ -138,7 +138,6 @@ import {weappPay} from "@/libs/wechat"
|
||||
import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue'
|
||||
import {mapGetters} from "vuex"
|
||||
import passkeyborad from '@/components/yzc-paykeyboard/yzc-paykeyboard'
|
||||
import settings from '@/config/baseSetting.js'
|
||||
export default {
|
||||
name: 'SubmitOrder',
|
||||
mixins: [buyMixins],
|
||||
@@ -400,7 +399,11 @@ export default {
|
||||
},
|
||||
subscribePay() {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: settings.SubscribeMessageTmplIds,
|
||||
tmplIds: [
|
||||
'7O3wKw7_D4t7yfSOlvecKuOQP8QEPY88uBx2FJg43HE',
|
||||
'TSmTnGibZ8IxWCiRWOvLxha6-0u7tE-V1-WbDCiPkKU',
|
||||
'9Q6xLHe6HyjkU5Zn5k_2zxYPf2y4MxVyUbOSW8pcZRU'
|
||||
],
|
||||
complete: () => this.createOrder(false)
|
||||
})
|
||||
},
|
||||
|
||||
@@ -209,7 +209,7 @@ export default {
|
||||
return
|
||||
}
|
||||
this.$yrouter.push({
|
||||
path: "/pagesOrder/order/OrderDetails/index",
|
||||
path: "/pages/order/OrderDetails/index",
|
||||
query: {
|
||||
id: this.order
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<u-switch v-model="isBlind" activeColor="#c52733"></u-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view class="swich-btn" v-if="!isPayOk && !isGroupBuy && !isCountyLotteryGift">
|
||||
<view class="swich-btn" v-if="!isPayOk && !isGroupBuy">
|
||||
<view class="v12-font-28 v12-dark-text">一人领取所有礼品</view>
|
||||
<view>
|
||||
<u-switch v-model="isOneRecipient" activeColor="#c52733"></u-switch>
|
||||
@@ -180,28 +180,6 @@
|
||||
:show-tab="false"
|
||||
/>
|
||||
</u-popup>
|
||||
<u-popup
|
||||
:show="showLotteryGiftPopup"
|
||||
:round="40"
|
||||
mode="center"
|
||||
:close-on-click-overlay="false"
|
||||
bgColor="transparent"
|
||||
>
|
||||
<view class="lottery-gift-popup">
|
||||
<view class="lottery-gift-close" @click="closeLotteryGiftPopup">
|
||||
<u-icon name="close-circle" color="#111" size="24"></u-icon>
|
||||
</view>
|
||||
<view class="lottery-gift-icon-wrap">
|
||||
<image class="ticket-icon-check" :src="webUrl + '/home/gongxi.png'" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="lottery-gift-title">支付成功</view>
|
||||
<view class="lottery-gift-content">好友领取礼包后,您才可以获得<br>抽奖码哦~</view>
|
||||
<view class="lottery-gift-actions">
|
||||
<button class="lottery-gift-btn home-btn" @click="goHomeFromLotteryPopup">返回首页</button>
|
||||
<button open-type="share" class="lottery-gift-btn send" @click="closeLotteryGiftPopup">送给朋友</button>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -273,10 +251,7 @@ export default {
|
||||
blindImage: '',
|
||||
isGroupBuy: false,
|
||||
popupCover: '',
|
||||
showInput: true,
|
||||
isCountyLotteryGift: false,
|
||||
showLotteryGiftPopup: false,
|
||||
isEligibleForDraw: false
|
||||
showInput: true
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -293,7 +268,6 @@ export default {
|
||||
onLoad(opts) {
|
||||
this.cartId = opts.cartId
|
||||
this.isGroupBuy = opts.isGroupBuy === '1'
|
||||
this.isCountyLotteryGift = opts.from === 'countyLottery' || opts.isCountyLotteryGift === '1' || !!opts.drawActivityId
|
||||
// this.couponId = opts.couponId || 0
|
||||
this.discount = opts.discount
|
||||
if(this.isGroupBuy) {
|
||||
@@ -511,25 +485,6 @@ export default {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
isDrawEligible(flag) {
|
||||
return flag === true || flag === 1 || flag === '1' || flag === 'true'
|
||||
},
|
||||
handleGiftPaySuccess(isEligibleForDraw = false) {
|
||||
this.isPayOk = true
|
||||
this.isEligibleForDraw = this.isDrawEligible(isEligibleForDraw)
|
||||
if (this.isCountyLotteryGift && this.isEligibleForDraw) {
|
||||
this.showLotteryGiftPopup = true
|
||||
}
|
||||
},
|
||||
closeLotteryGiftPopup() {
|
||||
this.showLotteryGiftPopup = false
|
||||
},
|
||||
goHomeFromLotteryPopup() {
|
||||
this.showLotteryGiftPopup = false
|
||||
uni.switchTab({
|
||||
url: '/pages/home/index'
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 确认赠送
|
||||
* @param {*}
|
||||
@@ -620,7 +575,7 @@ export default {
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
this.handleGiftPaySuccess(data.isEligibleForDraw);
|
||||
this.isPayOk = true;
|
||||
break;
|
||||
case "WECHAT_H5_PAY":
|
||||
// H5支付
|
||||
@@ -637,7 +592,7 @@ export default {
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
this.handleGiftPaySuccess(data.isEligibleForDraw);
|
||||
this.isPayOk = true;
|
||||
|
||||
}).catch(err => {
|
||||
// this.makeAgain()
|
||||
@@ -843,78 +798,4 @@ export default {
|
||||
width: 100%;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
.lottery-gift-popup{
|
||||
background: #fff;
|
||||
border-radius: 40rpx;
|
||||
padding: 60rpx 40rpx 50rpx;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
width: 550rpx;
|
||||
height: 560rpx;
|
||||
}
|
||||
.lottery-gift-close{
|
||||
position: absolute;
|
||||
top: 30rpx;
|
||||
right: 30rpx;
|
||||
z-index: 10;
|
||||
}
|
||||
.lottery-gift-icon-wrap{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.ticket-icon-check{
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.lottery-gift-title{
|
||||
text-align: center;
|
||||
font-size: 48rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.lottery-gift-content{
|
||||
text-align: center;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.lottery-gift-actions{
|
||||
margin-top: 60rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.lottery-gift-btn{
|
||||
width: 240rpx;
|
||||
height: 80rpx;
|
||||
line-height: 76rpx; /* 微调行高补偿边框 */
|
||||
border-radius: 40rpx;
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.lottery-gift-btn.home-btn{
|
||||
border: 2rpx solid #c52733;
|
||||
color: #c52733;
|
||||
background: #fff;
|
||||
}
|
||||
.lottery-gift-btn.send{
|
||||
border: 2rpx solid #c52733;
|
||||
color: #fff;
|
||||
background: #c52733;
|
||||
padding: 0;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.lottery-gift-btn.send::after{
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user