Merge branch 'dev' into test

This commit is contained in:
lifizer
2026-05-21 09:17:50 +08:00
94 changed files with 9333 additions and 22710 deletions
+1
View File
@@ -128,6 +128,7 @@ export default {
* 怎么申请地理标志保护产品?
* 想找个像《去有风的地方》那样的治愈县城
* 云南有哪些小众县城适合旅居?
* 查询最近一个月的订单
*/
prompt: '',
recordManager: null,
+263
View File
@@ -0,0 +1,263 @@
<template>
<view
class="order-item"
>
<view class="order-header">
<view class="order-shop">
<view class="shop-name">
<image
:src="webUrl + '/aiChat/icon-57.png'"
class="icon"
mode="widthFix"
lazy-load
/>
{{ item.merName }}
</view>
<view class="order-id">
订单号{{ item.orderId }}
</view>
</view>
<view class="status">
{{ item.statusName }}
</view>
</view>
<view v-if="item.isGiftCardReceiveBlind === 0" class="product-info-wrap">
<view
v-for="cartItem in item.cartInfo"
:key="cartItem.productId"
class="product-info"
>
<view class="good-img">
<image
:src="cartItem.productInfo.image"
class="img"
mode="widthFix"
lazy-load
/>
</view>
<view class="name-wrap">
<view class="name one-t">
{{ cartItem.productInfo.storeName }}
</view>
<view class="attr">
规格{{ cartItem.productInfo.attrInfo.sku || '' }}
</view>
</view>
<view class="price-num">
<view>
{{ cartItem.truePrice }}
</view>
<view class="num">
x{{ cartItem.cartNum }}
</view>
</view>
</view>
</view>
<view v-else class="product-info-wrap">
<view
class="product-info product-info2"
>
<view class="good-img">
<image
:src="webUrl + '/orderIcon/盲盒礼包.png'"
class="img"
mode="widthFix"
lazy-load
/>
</view>
<view class="name-wrap">
<view class="name one-t">
盲盒礼物
</view>
<view class="attr">
待收货后展示商品信息
</view>
</view>
<view class="price-num">
<view style="color: #fff;">
0.00
</view>
<view class="num">
x1
</view>
</view>
</view>
</view>
<view class="order-bottom">
<view class="time-total">
<view class="time">
{{ formatDateTime(item.createTime) }}
</view>
<view class="total">
{{ item.totalNum }}件商品
<text v-if="item.isGiftCardReceiveBlind === 0" class="total-txt">
&nbsp;&nbsp;&nbsp;&nbsp;总金额<text class="color-red">{{ item.payPrice }}</text>
</text>
</view>
</view>
<view class="btns">
<view class="btn" @click="viewOrderTrack">查看物流</view>
</view>
</view>
</view>
</template>
<script>
import { formatDateTime } from '@/utils/index'
export default {
name: 'AiHistoryList',
props: {
item: {
type: Object,
default: () => {}
}
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL
}
},
methods: {
formatDateTime,
viewOrderTrack() {
this.$emit('viewOrderTrack', this.item)
}
}
}
</script>
<style scoped lang="less">
.order-item {
padding: 20rpx;
border-radius: 20rpx;
background-color: #fff;
box-shadow: 0rpx 6rpx 20rpx rgba(101,101,101,0.16);
.order-header {
display: flex;
align-items: center;
justify-content: space-between;
.order-shop {
flex: 1;
width: calc(100% - 120rpx);
.shop-name {
display: flex;
align-items: center;
color: #333;
font-size: 28rpx;
line-height: 40rpx;
.icon {
display: block;
width: 40rpx;
height: 40rpx;
margin-right: 10rpx;
}
}
}
.order-id {
margin-top: 20rpx;
font-size: 24rpx;
color: #666;
}
.status {
width: 100rpx;
height: 40rpx;
border-radius: 10rpx;
color: #fff;
font-size: 24rpx;
line-height: 40rpx;
text-align: center;
background: rgba(197,39,51,1);
}
}
.product-info {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 0;
font-size: 28rpx;
.good-img {
.img {
display: block;
width: 120rpx;
height: 120rpx;
border-radius: 8rpx;
}
}
.name-wrap {
height: 120rpx;
width: calc(100% - 260rpx);
.name {
line-height: 40rpx;
}
.attr {
display: inline-block;
height: 50rpx;
max-width: 100%;
padding: 0 25rpx;
margin: 20rpx 0 0 0;
border-radius: 25rpx;
line-height: 50rpx;
color: #252525;
background: rgba(239,239,239,0.39);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.price-num {
width: 100rpx;
text-align: right;
line-height: 40rpx;
.num {
font-size: 20rpx;
}
}
}
.product-info2 {
.name-wrap {
display: flex;
flex-direction: column;
justify-content: space-between;
.attr {
padding: 0;
font-size: 24rpx;
color: #999;
background-color: #fff;
}
}
}
.order-bottom {
.time-total {
display: flex;
align-items: center;
justify-content: space-between;
color: #999;
font-size: 22rpx;
.total-txt {
color: #333;
font-size: 28rpx;
font-weight: 600;
}
.color-red {
color: #C52733;
}
}
.btns {
display: flex;
align-items: center;
justify-content: flex-end;
margin: 24rpx 0 0 0;
.btn {
height: 44rpx;
padding: 0 24rpx;
border-radius: 22rpx;
border: 1rpx solid #C52733;
color: #C52733;
font-size: 28rpx;
line-height: 44rpx;
text-align: center;
}
}
}
}
</style>
+36
View File
@@ -18,6 +18,29 @@ export const chatMixins = {
token: cookie.get('login_status'),
userInfo: cookie.get('userInfo'),
webUrl: this.$VUE_APP_RESOURCES_URL,
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,
@@ -524,6 +547,19 @@ export const chatMixins = {
console.log('------------end')
this.isPlayAudio = false
}
},
bottomToolClickHandle(item) {
if (item.type === 'prompt') {
this.streamReq({
prompt: item.prompt,
init: 0
})
}
if (item.type === 'link') {
uni.navigateTo({
url: item.url
})
}
}
}
}
+716
View File
@@ -0,0 +1,716 @@
import {
getSseConfigV1,
getCompletionsV3,
deleteChatItemByConversationId,
// getAnalyzeKeywordsV1,
getAnalyzeKeywordsChangeV3
} from '@/api/chat/index'
import {
postCartAdd
} from '@/api/store'
import { VUE_APP_API_URL } from '@/config'
import settings from '@/config/baseSetting.js'
import { formatAiMsgContent } from '../utils/aiChat'
import cookie from '@/utils/store/cookie'
import { handleLoginFailure } from '@/utils'
const plugin = requirePlugin('WechatSI')
const removeMarkdown = require('remove-markdown')
export const chatMixinsV2 = {
data() {
return {
token: cookie.get('login_status'),
userInfo: cookie.get('userInfo'),
webUrl: this.$VUE_APP_RESOURCES_URL,
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,
// 状态栏高度
statusBarHeight: 20,
bottomSafeDistance: 0,
fileHttpStr: Object.freeze(VUE_APP_API_URL + settings.sysPrefix),
keyboardHeight: 0,
optionsFrom: '',
onFocus: false,
loading: false,
chatNumber: '',
infoResData: {},
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
}
},
computed: {
chatMessageListLength() {
return this.chatMessageList.length
}
},
onPageScroll(e) {
this.scrollData = e
const scrollTop = e.scrollTop
this.scrollTop = scrollTop
const query = wx.createSelectorQuery().in(this)
query.select('#fixTbabarBody').boundingClientRect(function(rect) {
const contentHeight = rect.height
const windowInfo = wx.getWindowInfo()
const windowHeight = windowInfo.windowHeight
if (scrollTop + windowHeight + 30 >= contentHeight) {
this.isScrollToBottom = true
} else {
this.isScrollToBottom = false
}
}.bind(this)).exec()
},
onUnload() {
if (this.audioContext) {
this.audioContext.stop()
}
wx.getBackgroundAudioManager().stop()
this.closeWsFn()
},
created() {
const _this = this
uni.getSystemInfo({
success: (e) => {
let statusBar = 0
// #ifdef MP-WEIXIN
statusBar = e.statusBarHeight
const custom = uni.getMenuButtonBoundingClientRect()
_this.rightDistance = e.windowWidth - custom.left + 10
// #endif
// 状态栏高度
_this.statusBarHeight = statusBar
_this.bottomSafeDistance = e.safeAreaInsets.bottom
}
})
_this.createdCallbak()
},
methods: {
createdCallbak() {
console.log('页面初始话回调')
},
inputFocusHandle(value) {
this.onFocus = value === 1
this.scrollToBottomHandle()
},
historyViewHandle() {
console.log(this.$refs.historyView)
this.$refs.historyView.showView()
},
copyContentHandle(data) {
uni.setClipboardData({
data,
success: () => {
uni.showToast({
title: '已复制'
})
}
})
},
copyMoreInfoHandle(item) {
uni.setClipboardData({
data: JSON.stringify(item.showMoreInfo),
success: () => {
uni.showToast({
title: '已复制'
})
}
})
},
shareHandle() {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline'],
success: (res) => {
console.log(res)
},
fail: err => {
console.log(err)
}
})
},
scrollToBottomHandle() {
uni.pageScrollTo({
duration: 100,
selector: '#bottom_postion'
})
this.isScrollToBottom = true
},
// 重新生成
regenerateHandle(item) {
this.audioStopHandle()
deleteChatItemByConversationId(item.conversationId).then(res => {
const { success } = res
if (success) {
this.chatMessageList.splice(this.chatMessageListLength - 1, 1)
this.streamReq({
prompt: item.prompt,
init: 1
})
}
})
},
// 建议提问
suggestionItemClickHandle(question) {
this.streamReq({
prompt: question,
init: 0
})
},
// 大家都在问
topicItemClickHandle(question) {
this.streamReq({
prompt: question,
init: 0
})
},
streamReq(params) {
const _this = this
// 需要校验登录状态
if (!_this.token) {
handleLoginFailure()
return
}
const prompt = params.prompt
if (params.init !== 1) {
_this.chatMessageList.push({
prompt,
type: -1
})
}
_this.$nextTick(() => {
_this.scrollToBottomHandle()
})
_this.chatMessageList.push({
content: '',
nodes: '',
isError: false,
showCursor: false,
conversationId: '',
prompt,
listQuestion: [],
// 特产商品
goodsList: [],
// 礼品商品
giftGoodsList: [],
// 非遗文化
ichList: [],
// 千县名品
qianxianList: [],
// 抽奖
prizeList: [],
// 店铺
shopList: [],
// 地标好物--屏蔽原因:实现此功能时,后端通过AI动态返回的图片不满足需求,后面就不要了
landmarksList: [],
// 订单
orderList: [],
type: -2,
showMoreInfo: {},
currentSwiperIndex: 0,
showChangeBtn: true,
changeIsRotate: false
})
_this.loading = true
_this.showCursor = false
getSseConfigV1({
'chatNumber': _this.chatNumber,
prompt
}).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, () => {
getCompletionsV3({
conversationId,
ws: true,
isNoNeedPublicErrorNotification: 1
}).then(sseRes => {
console.log(sseRes)
// _this.closeWsFn()
}).catch(err => {
console.log(err)
_this.chatErrorSetContent()
})
})
} else {
_this.chatErrorSetContent()
}
}).catch(err => {
console.log(err)
_this.chatErrorSetContent()
})
},
initWebSocket(conversationId, cb) {
const _this = this
console.log('------------------创建连接')
uni.connectSocket({
url: VUE_APP_API_URL.replace('https', 'wss') + settings.sysPrefix + `v1/chat/websocket/${_this.userInfo.unionId}-${conversationId}`,
header: {
'content-type': 'application/json'
},
timeout: 10 * 1000,
success: () => {
console.log('------------WebSocket初始化成功')
},
fail: (err) => {
uni.showModal({
showCancel: false,
content: err
})
}
})
uni.onSocketMessage(res => {
_this.websocketOnmessage(res)
})
uni.onSocketOpen(() => {
cb && cb()
_this.websocketOnopen()
})
uni.onSocketError(err => {
_this.websocketOnerror(err)
})
},
websocketOnmessage(res) {
console.log('-------------监听 WebSocket 接受到服务器的消息事件')
const resData = JSON.parse(res.data)
if (resData) {
const message = resData.message
console.log(message)
if (message && this.chatMessageListLength > 1) {
const mesContent = message.content
const contentType = message.contentType
const finish = message.finish
if (contentType === 'text') {
if (!finish && mesContent) {
this.chatMessageList[this.chatMessageListLength - 1].nodes = formatAiMsgContent(mesContent)
this.chatMessageList[this.chatMessageListLength - 1].content = mesContent
this.chatMessageList[this.chatMessageListLength - 1].listQuestion = message.listQuestion || []
}
}
if (contentType === 'order') {
if (!finish && message.listCards) {
this.chatMessageList[this.chatMessageListLength - 1].orderList = message.listCards || []
}
}
if (contentType === 'shop') {
if (!finish && message.listCards) {
this.chatMessageList[this.chatMessageListLength - 1].shopList = message.listCards || []
}
}
if (contentType === 'gift') {
if (!finish && message.listCards) {
this.chatMessageList[this.chatMessageListLength - 1].giftGoodsList = message.listCards || []
}
}
if (contentType === 'discount') {
if (!finish && message.listCards) {
this.chatMessageList[this.chatMessageListLength - 1].prizeList = message.listCards || []
}
}
if (contentType === 'goods') {
if (!finish && message.listCards) {
this.chatMessageList[this.chatMessageListLength - 1].goodsList = message.listCards || []
}
}
if (contentType === 'famous') {
if (!finish && message.listCards) {
this.chatMessageList[this.chatMessageListLength - 1].qianxianList = message.listCards || []
}
}
if (contentType === 'ich') {
if (!finish && message.listCards) {
this.chatMessageList[this.chatMessageListLength - 1].ichList = message.listCards || []
}
}
if (contentType === 'landmarks') {
if (!finish && message.listCards) {
this.chatMessageList[this.chatMessageListLength - 1].landmarksList = message.listCards || []
}
}
this.$forceUpdate()
this.$nextTick(() => {
this.scrollToBottomHandle()
if (finish) {
this.closeWsFn()
}
})
}
}
},
websocketOnopen() {
console.log('------------------监听 WebSocket 连接打开事件')
// this.websocketSend(JSON.stringify({ msg: '1' }))
},
websocketOnerror(e) {
console.log('-----------------监听 WebSocket 错误事件')
console.log(e)
},
websocketSend(msg) {
// 数据发送
try {
uni.sendSocketMessage({
data: msg,
success: () => {
console.log('-----------发送消息成功了')
}
})
} catch (err) {
console.log('send failed (' + err.code + ')')
}
},
onSwiperChange(index, e) {
this.chatMessageList[index].currentSwiperIndex = e.detail.current
},
analyzeKeywordsChangeHandle(conversationId, item) {
let idx = -1
this.chatMessageList.map((item, index) => {
if (item.conversationId === conversationId) {
idx = index
}
})
if (idx > -1) {
if (this.chatMessageList[idx].changeIsRotate) {
return
}
this.$set(this.chatMessageList[idx], 'changeIsRotate', true)
}
let listKey = ''
// 抽奖和订单查询没有换一换
if (item.goodsList.length > 0) {
listKey = 'goodsList'
}
if (item.giftGoodsList.length > 0) {
listKey = 'giftGoodsList'
}
if (item.ichList.length > 0) {
listKey = 'ichList'
}
if (item.qianxianList.length > 0) {
listKey = 'qianxianList'
}
if (item.shopList.length > 0) {
listKey = 'shopList'
}
getAnalyzeKeywordsChangeV3({
conversationId
}).then(res => {
const { success, data } = res
if (success) {
let changeList = []
this.chatMessageList.map((item) => {
if (item.conversationId === conversationId) {
changeList = data.list || []
}
})
if (idx > -1 && listKey) {
this.$set(this.chatMessageList[idx], listKey, changeList)
this.$forceUpdate()
}
setTimeout(() => {
this.$set(this.chatMessageList[idx], 'changeIsRotate', false)
}, 1000)
}
}).catch(error => {
this.$set(this.chatMessageList[idx], 'changeIsRotate', false)
})
},
productItemClickHandle(item) {
this.audioStopHandle()
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: {
id: item.id
}
})
},
productItemSupplierClickHandle(item) {
if (!item.storeId) {
return
}
this.audioStopHandle()
this.$yrouter.push({
path: '/pagesInn/inn/innHome',
query: {
id: item.storeId
}
})
},
productItemBuyNowClickHandle(item) {
this.audioStopHandle()
this.showGiftBtn = false
this.cart_num = 1
this.addToCart(item)
},
productItemGiftBuyClickHandle(item) {
this.audioStopHandle()
this.showGiftBtn = true
this.cart_num = 1
this.addToCart(item)
},
buyNowOrGiftBuyReq(type) {
const _this = this
if (_this.buyLoading) {
return
}
_this.buyLoading = true
postCartAdd({
productId: _this.m_id,
cartNum: _this.attr.productSelect.cart_num,
new: 1,
uniqueId: _this.attr.productSelect !== undefined ? _this.attr.productSelect.unique : ''
}).then(function (res) {
try {
_this.closeAttrWindow()
const { cartId } = res.data
if (type === 1) {
uni.navigateTo({
url: '/pages/order/OrderSubmission/index?id=' + cartId
})
return
}
if(type === 2) {
uni.navigateTo({
url: '/pkg_user/views/gift/gift?cartId=' + cartId
})
return
}
} catch (error) {
console.log(error)
}
}).catch(error => {
uni.showToast({
title: error.msg,
icon: "none",
duration: 5000
})
}).finally(() => {
_this.buyLoading = false
})
},
closeAttrWindow() {
this.$set(this.attr, 'cartAttr', false)
},
hotelItemClickHandle(item) {
this.audioStopHandle()
this.$yrouter.push({
path: '/pagesInn/inn/innHome',
query: {
id: item.id
}
})
},
ichItemClickHandle(item) {
this.audioStopHandle()
this.$yrouter.push({
path: '/pkg_product/views/heritage/details',
query: {
id: item.id
}
})
},
qianxianItemClickHandle(item) {
this.audioStopHandle()
this.$yrouter.push({
path: '/pkg_product/views/famousQianxianShop',
query: {
id: item.id
}
})
},
prizeItemClickHandle() {
this.audioStopHandle()
this.$yrouter.push({ path: '/pkg-video/views/lottery' })
},
chatErrorSetContent() {
this.chatMessageList[this.chatMessageListLength - 1].isError = true
this.chatMessageList[this.chatMessageListLength - 1].content = this.errorMsg
this.chatMessageList[this.chatMessageListLength - 1].nodes = this.errorMsg
this.closeWsFn()
},
closeWsFn() {
this.loading = false
if (this.chatMessageListLength) {
this.chatMessageList[this.chatMessageListLength - 1].showCursor = false
}
uni.closeSocket({
success: () => {
console.log('-----关闭连接')
}
})
this.$nextTick(() => {
this.scrollToBottomHandle()
})
},
audioStopHandle() {
// Fix bug#4049
this.audioAyy = []
if (this.audioContext) {
this.audioContext.stop()
}
this.isPlayAudio = false
wx.getBackgroundAudioManager().stop()
},
ttsHandle(item) {
this.audioAyy = []
if (this.audioContext) {
this.audioContext.stop()
// this.audioContext.destroy()
}
// 如果正在播放,点击当前播放的则认为是暂停
if (this.isPlayAudio && item.conversationId === this.audioPlayId) {
this.isPlayAudio = false
this.audioPlayId = ''
return
}
this.isPlayAudio = false
this.audioPlayId = item.conversationId
const flag = 1
if (flag === 1) {
console.log(removeMarkdown(item.content).replace(/[\n\t\s]/g, ''))
uni.showLoading({
title: '合成中...'
})
this.splitAndSynthesize(removeMarkdown(item.content).replace(/[\n\t\s]/g, ''))
} else {
// 调试数据
this.audioAyy = [
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749075_2f71887cc48d9b3753c39d119862d4bb&filekey=871027724&source=miniapp_plugin',
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749077_0970508786c5e3edc3a68a5eb9de048c&filekey=871027724&source=miniapp_plugin',
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749079_e77cec52cc077ba981892887c3df4cdf&filekey=871027724&source=miniapp_plugin',
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749080_02db4235771f5561cdb73c06d8c67e53&filekey=871027724&source=miniapp_plugin',
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749082_534e455c5d6ac5e9a4192ecf9952851a&filekey=871027724&source=miniapp_plugin',
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749083_78c4a2fecad538561f81c48dc4ecd645&filekey=871027724&source=miniapp_plugin'
]
this.playNextChunk()
}
},
splitAndSynthesize(text) {
const _this = this
if (text) {
const textLength = text.length
const chunkSize = 100
const chunk = text.slice(0, textLength > chunkSize ? chunkSize : textLength)
plugin.textToSpeech({
// 语言
lang: 'zh_CN',
tts: true,
// 要转换的文字
content: chunk,
success: function(res) {
console.log("语音文件路径:", res.filename)
_this.audioAyy.push(res.filename)
// 首次就立即播放,增强体验
if (!_this.isPlayAudio) {
_this.playNextChunk()
}
if (textLength > chunkSize) {
// 递归调用,播放一定要按照文本分割顺序
_this.splitAndSynthesize(text.substr(chunkSize, textLength))
} else {
// 最后一条合成,没有正在播放则立即播放
if (!_this.isPlayAudio) {
_this.playNextChunk()
}
}
uni.hideLoading()
},
fail: function(err) {
console.log("转换失败:", err)
uni.hideLoading()
}
})
} else {
if (!_this.isPlayAudio) {
_this.playNextChunk()
}
uni.hideLoading()
}
},
playNextChunk() {
if (this.audioAyy.length > 0 && this.audioPlayId) {
const src = this.audioAyy.shift()
this.isPlayAudio = true
const audioContext = uni.createInnerAudioContext({
// 是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项
useWebAudioImplement: false
})
this.audioContext = audioContext
audioContext.src = src
audioContext.onEnded(() => {
audioContext.destroy()
this.playNextChunk()
})
audioContext.play()
console.log('------------src' + src)
} else {
console.log('------------end')
this.isPlayAudio = false
}
},
bottomToolClickHandle(item) {
if (item.type === 'prompt') {
this.streamReq({
prompt: item.prompt,
init: 0
})
}
if (item.type === 'link') {
uni.navigateTo({
url: item.url
})
}
},
viewOrderTrackHandle(order) {
uni.navigateTo({
url: '/pagesOrder/order/OrderDetails/index?id=' + order.orderId
})
}
}
}
+221 -42
View File
@@ -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"
@@ -126,12 +126,71 @@
</view>
<!-- 换一换 -->
<view
v-if="!item.showCursor && item.nodes && item.nodes.length && !item.isError && item.showMoreInfo.show"
v-if="!item.showCursor &&
!item.isError &&
(item.orderList.length > 0 ||
item.giftGoodsList.length > 0 ||
item.goodsList.length > 0 ||
item.shopList.length > 0 ||
item.prizeList.length > 0 ||
item.ichList.length > 0 ||
item.qianxianList.length > 0
)
"
class="change-list-wrap"
>
<view v-if="item.showMoreInfo.showType === '特产商品'" class="list-wrap">
<!-- 礼品 -->
<view
v-if="item.giftGoodsList.length > 0"
class="recommend-goods-wrap"
>
<swiper
class="goods-swiper"
:indicator-dots="false"
:autoplay="false"
:current="item.currentSwiperIndex"
previous-margin="120rpx"
next-margin="120rpx"
circular
@change="e => onSwiperChange(index, e)"
>
<swiper-item
v-for="(goodItem, goodIndex) in item.giftGoodsList"
:key="goodIndex"
>
<view
:class="{ 'active': item.currentSwiperIndex === goodIndex }"
class="goods-item"
@click="productItemClickHandle(goodItem)"
>
<view class="supplier" @click.stop="productItemSupplierClickHandle(goodItem)">
<image
:src="webUrl + '/aiChat/icon-57.png'"
class="icon"
mode="widthFix"
lazy-load
/>
<text class="s-name">{{ goodItem.merName ||goodItem.storeName }}</text>
<u-icon name="arrow-right" color="#999" size="12"></u-icon>
</view>
<view class="title one-t">{{ goodItem.name }}</view>
<image :src="goodItem.img" class="p-img" mode="aspectFill" lazy-load />
<view class="price">
<text class="unit">¥</text>
<text class="num">{{ goodItem.price }}</text>
</view>
<view class="actions">
<view class="btn-buy" @click.stop="productItemBuyNowClickHandle(goodItem)">立即下单</view>
<view class="btn-gift" @click.stop="productItemGiftBuyClickHandle(goodItem)">送给朋友</view>
</view>
</view>
</swiper-item>
</swiper>
</view>
<!-- 特产商品 -->
<view v-if="item.goodsList.length > 0" class="list-wrap">
<view
v-for="(productItem, productIndex) in item.showMoreInfo.resultItems"
v-for="(productItem, productIndex) in item.goodsList"
:key="productIndex"
class="product-item"
@click="productItemClickHandle(productItem)"
@@ -139,6 +198,7 @@
<image
:src="productItem.img"
class="img"
lazy-load
/>
<view class="product-info">
<view class="name one-t">
@@ -153,9 +213,10 @@
</view>
</view>
</view>
<view v-if="item.showMoreInfo.showType === '店铺'" class="list-wrap">
<!-- 店铺 -->
<view v-if="item.shopList.length > 0" class="list-wrap">
<view
v-for="(hotel, hotelIndex) in item.showMoreInfo.resultItems"
v-for="(hotel, hotelIndex) in item.shopList"
:key="hotelIndex"
class="product-item"
@click="hotelItemClickHandle(hotel)"
@@ -164,8 +225,9 @@
{{ hotel.hotelTypeName }}
</view>
<image
:src="hotel.img"
:src="hotel.img + ((hotel.img && hotel.img.indexOf('.mp4') > -1) ? '?vframe/jpg/offset/1' : '')"
class="img"
lazy-load
/>
<view class="product-info">
<view class="name one-t">
@@ -177,9 +239,10 @@
</view>
</view>
</view>
<view v-if="item.showMoreInfo.showType === '非遗文化'" class="list-wrap">
<!-- 非遗 -->
<view v-if="item.ichList.length > 0" class="list-wrap">
<view
v-for="(ich, ichIndex) in item.showMoreInfo.resultItems"
v-for="(ich, ichIndex) in item.ichList"
:key="ichIndex"
class="product-item"
@click="ichItemClickHandle(ich)"
@@ -198,9 +261,10 @@
</view>
</view>
</view>
<view v-if="item.showMoreInfo.showType === '千县名品'" class="list-wrap">
<!-- 千县 -->
<view v-if="item.qianxianList.length > 0" class="list-wrap">
<view
v-for="(qianxian, qianxianIndex) in item.showMoreInfo.resultItems"
v-for="(qianxian, qianxianIndex) in item.qianxianList"
:key="qianxianIndex"
class="product-item"
@click="qianxianItemClickHandle(qianxian)"
@@ -208,6 +272,7 @@
<image
:src="qianxian.img"
class="img"
lazy-load
/>
<view class="product-info">
<view class="name name2 one-t">
@@ -216,9 +281,10 @@
</view>
</view>
</view>
<view v-if="item.showMoreInfo.showType === '优惠活动'" class="list-wrap prize-list-wrap">
<!-- 抽奖 -->
<view v-if="item.prizeList.length > 0" class="list-wrap prize-list-wrap">
<view
v-for="(prize, prizeIndex) in item.showMoreInfo.resultItems"
v-for="(prize, prizeIndex) in item.prizeList"
:key="prizeIndex"
class="prize-item"
@click="prizeItemClickHandle(prize)"
@@ -227,18 +293,47 @@
:src="prize.img"
class="img"
mode="widthFix"
lazy-load
/>
</view>
</view>
<view v-if="item.showMoreInfo.showType !== '优惠活动'" class="change-btn">
<image
:src="webUrl + '/aiChat/icon-change.png'"
class="icon"
mode="widthFix"
@click="analyzeKeywordsChangeHandle(item.conversationId, item.showMoreInfo)"
/>
<!-- 订单 -->
<view v-if="item.orderList.length > 0" class="order-list-wrap">
<view
v-for="(order, orderIndex) in item.orderList"
:key="orderIndex"
class="order-item-wrap"
>
<order-item
:item="order"
@viewOrderTrack="viewOrderTrackHandle"
/>
</view>
</view>
<view
v-if="(item.shopList.length > 0 ||
item.goodsList.length > 0 ||
item.giftGoodsList.length > 0 ||
item.ichList.length > 0 ||
item.qianxianList.length > 0 ||
item.shopList.length > 0) && item.showChangeBtn
"
class="change-btn"
>
<view class="change-btn-content" @click="analyzeKeywordsChangeHandle(item.conversationId, item)">
<image
:src="webUrl + '/aiChat/icon-53.png'"
:class="{
'rotate': item.changeIsRotate
}"
class="icon"
mode="widthFix"
/>
换一换
</view>
</view>
</view>
<!-- 建议提问 -->
<view
v-if="index === (chatMessageListLength - 1) && item.listQuestion.length > 0"
class="suggestion-wrap"
@@ -275,24 +370,42 @@
}"
class="page-to-bottom"
>
<view
class="new-chat"
@click="createNewHandle"
>
<view class="down-icon-wrap">
<image
:src="webUrl + '/aiChat/icon-05.png'"
class="btn-icon"
v-if="chatMessageListLength > 0 && !isScrollToBottom && !loading"
:src="webUrl + '/aiChat/down.png'"
class="icon down-icon"
mode="widthFix"
@click="scrollToBottomHandle"
/>
开启新对话
</view>
<image
v-if="chatMessageListLength > 0 && !isScrollToBottom && !loading"
:src="webUrl + '/aiChat/down.png'"
class="icon"
mode="widthFix"
@click="scrollToBottomHandle"
/>
<view class="container">
<view
v-if="chatNumber"
class="new-chat"
@click="createNewHandle"
>
<image
:src="webUrl + '/aiChat/icon-54.png'"
class="btn-icon"
mode="widthFix"
/>
开启新对话
</view>
<view
v-for="(item, index) in bottomTools"
:key="index"
class="bottom-tool-item"
@click="bottomToolClickHandle(item)"
>
<image
:src="webUrl + '/aiChat/' + item.icon + '.png'"
class="tool-icon"
mode="widthFix"
/>
{{ item.text }}
</view>
</view>
</view>
<bottom-send
ref="bottomSend"
@@ -308,13 +421,29 @@
form-module="history"
@enter-history="audioStopHandle"
/>
<ProductWindow
ref="attrWindow"
:attr="attr"
:cart-num="cart_num"
:show-ok="!showGiftBtn"
:is-gift="showGiftBtn"
:padding-bottom="'60px'"
class-name="ai-product-window"
ok-text="立即购买"
@changeFun="changeFun"
@ok="buyNowOrGiftBuyReq(1)"
@gift="buyNowOrGiftBuyReq(2)"
/>
</view>
</template>
<script>
import { chatMixins } from '../mixins/chatMixins.js'
import { chatMixinsV2 } from '../mixins/chatMixinsV2.js'
import goCartMixin from '@/mixins/goCartMixins'
import AiHistoryList from '../components/historyList'
import BottomSend from '../components/bottomSend.vue'
import OrderItem from '../components/orderItem.vue'
import ProductWindow from '@/components/ProductWindow'
import {
historyChatMessage
} from '@/api/chat/index'
@@ -323,9 +452,11 @@ export default {
name: 'AiChatHistoryPage',
components: {
AiHistoryList,
BottomSend
BottomSend,
OrderItem,
ProductWindow
},
mixins: [chatMixins],
mixins: [chatMixinsV2, goCartMixin],
data() {
return {
pageTitle: ''
@@ -354,20 +485,68 @@ export default {
prompt: item.content
})
} else {
if (item.contentType === 'text') {
this.chatMessageList.push({
if (['text', 'skill_list'].includes(item.contentType)) {
const tempItemData = {
...item,
nodes: formatAiMsgContent(item.content),
prompt: this.getParentPrompt(data, item.parentMessageId),
conversationId: item.messageId,
showCursor: false,
listQuestion: item.listQuestion || [],
// 特产商品
goodsList: [],
// 礼品商品
giftGoodsList: [],
// 非遗文化
ichList: [],
// 千县名品
qianxianList: [],
// 抽奖
prizeList: [],
// 店铺
shopList: [],
// 地标好物--屏蔽原因:实现此功能时,后端通过AI动态返回的图片不满足需求,后面就不要了
landmarksList: [],
// 订单
orderList: [],
type: -2,
showMoreInfo: {}
})
showMoreInfo: {},
currentSwiperIndex: 0,
showChangeBtn: false,
changeIsRotate: false
}
if (item.cardData) {
const { contentType, finish, items = [] } = item.cardData
if (contentType === 'order') {
tempItemData.orderList = items || []
}
if (contentType === 'shop') {
tempItemData.shopList = items || []
}
if (contentType === 'gift') {
tempItemData.giftGoodsList = items || []
}
if (contentType === 'discount') {
tempItemData.prizeList = items || []
}
if (contentType === 'goods') {
tempItemData.goodsList = items || []
}
if (contentType === 'famous') {
tempItemData.qianxianList = items || []
}
if (contentType === 'ich') {
tempItemData.ichList = items || []
}
if (contentType === 'landmarks') {
tempItemData.landmarksList = items || []
}
}
this.chatMessageList.push(tempItemData)
}
}
})
console.log(this.chatMessageList)
} catch (err) {
uni.showModal({
title: '错误提示',
+227
View File
@@ -0,0 +1,227 @@
<template>
<view
:style="{ 'background-image': 'url(' + webUrl + '/aiChat/bg-05.png)' }"
class="image-recognition-page"
>
<hx-navbar
:back="true"
:fixed="true"
:statusBar="true"
left-icon="arrowleft"
color="#333"
transparent="auto"
barPlaceholder="hidden"
title="云灵"
/>
<view
class="main-content"
:style="{ 'padding-top': (44 + statusBarHeight) + 'px' }"
>
<!-- 拍照区域 -->
<view class="camera-section" @click="takePhoto">
<view class="dashed-border-box">
<view class="icon-wrap">
<image
:src="webUrl + '/aiChat/icon-55.png'"
class="camera-icon"
mode="widthFix"
/>
</view>
<view class="main-title">对准商品拍照</view>
<view class="sub-tip">示例特产/零食/茶叶/纪念品</view>
</view>
</view>
<!-- 底部相册上传按钮 -->
<view class="bottom-action">
<button class="album-btn" @click="chooseImage">
<image
:src="webUrl + '/aiChat/icon-56.png'"
class="upload-icon"
mode="widthFix"
/>
<text>从相册上传图片进行识别</text>
</button>
</view>
</view>
</view>
</template>
<script>
import { chatMixins } from '../mixins/chatMixins.js'
import { VUE_APP_API_URL } from '@/config'
export default {
name: 'AiChatImageRecognitionPage',
mixins: [chatMixins],
data() {
return {
}
},
methods: {
createdCallbak() {
// 覆盖 mixins 中的 createdCallbak,避免触发默认逻辑
},
takePhoto() {
if (this.loading) return
uni.chooseImage({
count: 1,
sizeType: ['compressed'],
sourceType: ['camera'],
success: (res) => {
this.handleUpload(res.tempFilePaths[0])
}
})
},
chooseImage() {
if (this.loading) return
uni.chooseImage({
count: 1,
sizeType: ['compressed'],
sourceType: ['album'],
success: (res) => {
this.handleUpload(res.tempFilePaths[0])
}
})
},
handleUpload(filePath) {
const _this = this
uni.showLoading({ title: '识别中...' })
_this.loading = true
uni.uploadFile({
url: `${VUE_APP_API_URL}/api/upload`,
filePath: filePath,
header: {
Authorization: 'Bearer ' + (_this.token || '')
},
name: 'file',
success: (uploadRes) => {
const resData = JSON.parse(uploadRes.data)
if (resData.link) {
_this.performRecognition(resData.link)
} else {
uni.hideLoading()
_this.loading = false
_this.$toast('上传失败,请重试')
}
},
fail: (err) => {
console.log('Upload Error:', err)
uni.hideLoading()
_this.loading = false
_this.$toast('网络异常,请重试')
}
})
},
performRecognition(imageUrl) {
// 存储识别到的图片URL
uni.setStorageSync('recognitionImage', imageUrl)
uni.navigateTo({
url: '/aiChat/views/imageRecognitionResult'
})
uni.hideLoading()
this.loading = false
}
}
}
</script>
<style lang="scss" scoped>
.image-recognition-page {
height: 100vh;
background-size: 100% 100%;
.main-content {
display: flex;
flex-direction: column;
align-items: center;
padding: 60rpx 40rpx;
height: 100vh;
box-sizing: border-box;
}
.camera-section {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 60rpx;
.dashed-border-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 600rpx;
width: 100%;
margin-top: 80rpx;
border: 2rpx dashed #DCDFE6;
border-radius: 24rpx;
background-color: rgba(255, 255, 255, 0.5);
.icon-wrap {
width: 160rpx;
height: 160rpx;
border-radius: 50%;
border: 6rpx solid #7A3DF1;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 40rpx;
.camera-icon {
width: 80rpx;
height: 80rpx;
}
}
.main-title {
font-size: 36rpx;
font-weight: bold;
color: #333;
margin-bottom: 20rpx;
}
.sub-tip {
font-size: 28rpx;
color: #999;
}
}
}
.bottom-action {
width: 100%;
padding-bottom: 60rpx;
.album-btn {
width: 100%;
height: 100rpx;
background: #3D4CF1;
border-radius: 20rpx;
display: flex;
justify-content: center;
align-items: center;
color: #FFFFFF;
font-size: 32rpx;
border: none;
box-shadow: 0 8rpx 20rpx rgba(61, 76, 241, 0.3);
.upload-icon {
width: 36rpx;
height: 36rpx;
margin-right: 16rpx;
}
&::after {
border: none;
}
&:active {
opacity: 0.8;
}
}
}
}
</style>
+338
View File
@@ -0,0 +1,338 @@
<template>
<view class="image-recognition-result-page">
<view
class="page-body"
>
<view class="header">
<view
class="header-bg"
:style="{ 'background-image': imageUrl ? `url(${imageUrl})` : '' }"
/>
<view class="header-mask" />
<view class="scan-wrap">
<image
v-if="imageUrl"
:src="imageUrl"
class="scan-image"
mode="aspectFill"
/>
<view class="corner tl" />
<view class="corner tr" />
<view class="corner bl" />
<view class="corner br" />
</view>
</view>
<view class="sheet">
<view class="sheet-thumb-row">
<image
v-if="imageUrl && confidenceFlag"
:src="imageUrl"
class="sheet-thumb"
mode="aspectFill"
lazy-load
/>
<view v-else class="empty-state">
<view class="empty-text">未识别到物品请重新尝试</view>
<view class="empty-title">为你推荐</view>
</view>
</view>
<view class="sheet-divider" />
<view class="goods-grid">
<view
v-for="(item, index) in goodsList"
:key="index"
class="goods-card"
@click="goGoods(item)"
>
<image
:src="item.img"
class="goods-img"
mode="aspectFill"
lazy-load
/>
<view class="goods-title">
{{ item.name }}
</view>
<view class="goods-price-row">
<view class="price-left">
<text class="price-symbol"></text>
<text class="price-val">{{ item.price }}</text>
</view>
<image
:src="webUrl + '/home/icon-cart.png'"
class="cart-btn"
mode="aspectFit"
lazy-load
/>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { getAnalyzeByImageV3 } from '@/api/chat'
import Recommend from '@/components/Recommend'
export default {
name: 'AiChatImageRecognitionResultPage',
components: {
Recommend
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
statusBarHeight: 20,
imageUrl: '',
goodsList: [],
confidenceFlag: true
}
},
onLoad(options) {
const urlFromQuery = options.imageUrl || ''
const urlFromStorage = uni.getStorageSync('recognitionImage') || ''
this.imageUrl = urlFromQuery || urlFromStorage || ''
if (urlFromStorage) {
// uni.removeStorageSync('recognitionImage')
}
this.init()
},
methods: {
init() {
this.loaded = false
getAnalyzeByImageV3({
imageUrl: this.imageUrl
}).then(res => {
const { data, success } = res
if (success) {
this.goodsList = data.cards || []
this.confidenceFlag = data.success
}
}).finally(() => {
this.loaded = true
})
},
goGoods(item) {
if (!item || !item.id) return
uni.navigateTo({
url: `/pages/shop/GoodsCon/index?id=${item.id}`
})
},
addToCart() {
}
}
}
</script>
<style lang="scss" scoped>
.image-recognition-result-page {
min-height: 100vh;
background: #fff;
.page-body {
min-height: 100vh;
}
.header {
position: relative;
height: 480rpx;
overflow: hidden;
}
.header-bg {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color: #DDE6FF;
background-size: cover;
background-position: center;
filter: blur(18rpx);
transform: scale(1.2);
}
.header-mask {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.18);
}
.scan-wrap {
position: absolute;
left: 50%;
top: 45%;
width: 320rpx;
height: 320rpx;
transform: translate(-50%, -52%);
border-radius: 24rpx;
overflow: hidden;
// box-shadow: 0 18rpx 48rpx rgba(0, 0, 0, 0.18);
}
.scan-image {
display: block;
width: 100%;
height: 100%;
border-radius: 12rpx;
transform: scale(0.8);
}
.corner {
position: absolute;
width: 44rpx;
height: 44rpx;
border: 6rpx solid rgba(255, 255, 255, 0.95);
}
.corner.tl {
left: 16rpx;
top: 16rpx;
border-right: 0;
border-bottom: 0;
}
.corner.tr {
right: 16rpx;
top: 16rpx;
border-left: 0;
border-bottom: 0;
}
.corner.bl {
left: 16rpx;
bottom: 16rpx;
border-right: 0;
border-top: 0;
}
.corner.br {
right: 16rpx;
bottom: 16rpx;
border-left: 0;
border-top: 0;
}
.sheet {
position: relative;
margin-top: -70rpx;
background: #FFFFFF;
border-top-left-radius: 42rpx;
border-top-right-radius: 42rpx;
padding-bottom: calc(env(safe-area-inset-bottom) + 28rpx);
}
.sheet-thumb-row {
padding: 28rpx 0 18rpx 0;
display: flex;
justify-content: center;
}
.sheet-thumb {
width: 100rpx;
height: 100rpx;
border-radius: 18rpx;
display: block;
box-shadow: 0 10rpx 24rpx rgba(0, 0, 0, 0.12);
}
.sheet-divider {
height: 2rpx;
background: #EDEDED;
margin: 0 32rpx;
}
.empty-state {
text-align: center;
}
.empty-text {
font-size: 28rpx;
color: #999;
margin-bottom: 20rpx;
}
.empty-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-bottom: 20rpx;
}
.goods-grid {
padding: 28rpx 24rpx 0 24rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.goods-card {
width: 344rpx;
background: #FFFFFF;
border-radius: 22rpx;
overflow: hidden;
margin-bottom: 22rpx;
box-shadow: 0 10rpx 24rpx rgba(0, 0, 0, 0.06);
}
.goods-img {
width: 344rpx;
height: 344rpx;
display: block;
}
.goods-title {
padding: 14rpx 14rpx 0 14rpx;
font-size: 28rpx;
line-height: 38rpx;
color: #333;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
min-height: 76rpx;
}
.goods-price-row {
padding: 10rpx 14rpx 16rpx 14rpx;
display: flex;
align-items: flex-end;
justify-content: space-between;
}
.price-left {
display: flex;
align-items: flex-end;
}
.price-symbol {
font-size: 26rpx;
color: #C52733;
line-height: 1;
margin-right: 2rpx;
}
.price-val {
font-size: 40rpx;
font-weight: bold;
color: #C52733;
line-height: 1;
}
.origin-price {
font-size: 24rpx;
color: #999;
line-height: 1;
margin-left: 12rpx;
text-decoration: line-through;
}
.cart-btn {
width: 52rpx;
height: 52rpx;
display: block;
}
}
</style>
+316 -222
View File
@@ -1,6 +1,9 @@
<template>
<view
:class="scrollTop > 0 ? 'page-scroll' : ''"
:class="{
'page-scroll': scrollTop > 0,
'new-chat': chatMessageListLength === 0
}"
class="fix-tabbar-page"
>
<hx-navbar
@@ -37,131 +40,103 @@
conversationId: '123'
})">播放</button> -->
<block v-if="chatMessageListLength < 1">
<view class="home-focus-wrap">
<view class="focus-guide-wrap">
<view class="guide-left">
<image
:src="webUrl + '/aiChat/logo-01.gif'"
class="avatar"
mode="widthFix"
/>
</view>
<view class="guide-right">
<view class="trangle" />
<view class="title">{{ settingInfo.helloMessageTitle }}</view>
<view class="content">{{ settingInfo.helloMessageContent }}</view>
<view class="home-wrap">
<view class="home-focus-wrap">
<view class="focus-guide-wrap">
<view class="guide-left">
<image
:src="webUrl + '/aiChat/logo-01.gif'"
class="avatar"
mode="widthFix"
/>
</view>
<view class="guide-right">
<view class="title">{{ settingInfo.helloMessageTitle }}</view>
<view class="content">{{ settingInfo.helloMessageContent }}</view>
</view>
</view>
</view>
</view>
<view v-if="weatherData.city && holidayData.suit" class="weather-holiday-wrap">
<view class="weather-data data-wrap">
<block v-if="!weatherDataLoading">
<view v-if="weatherIsLoad">
<!-- 各种天气对应的图标
https://yikeapi.com/help/wea
https://yikeapi.com/help/tianqiimg -->
<view class="title">
<image
:src="webUrl + '/aiChat/weather/' + weatherData.wea_img +'.png'"
class="icon"
mode="widthFix"
/>
<view class="tem-wrap">
<view class="tem">{{ weatherData.tem }}</view>
<view class="unit"></view>
</view>
</view>
<view class="loca">
<view class="addr">
<!-- 这里实现商品轮播 -->
<!-- <view class="recommend-goods-wrap" v-if="recommendGoodsList.length > 0">
<swiper
class="goods-swiper"
:indicator-dots="false"
:autoplay="false"
previous-margin="120rpx"
next-margin="120rpx"
circular
@change="onSwiperChange"
>
<swiper-item
v-for="(item, index) in recommendGoodsList"
:key="index"
>
<view
class="goods-item"
:class="{ 'active': currentSwiperIndex === index }"
@click="productItemClickHandle(item)"
>
<view class="supplier">
<image
:src="webUrl + '/aiChat/addr.png'"
:src="webUrl + '/aiChat/icon-57.png'"
class="icon"
mode="widthFix"
/>
{{ weatherData.city }}
<text class="s-name">{{ item.supplierName || '供应商名称' }}</text>
<u-icon name="arrow-right" color="#999" size="12"></u-icon>
</view>
<view class="tem-range">
{{ weatherData.wea }}&nbsp;&nbsp;{{ weatherData.tem2 }}~{{ weatherData.tem1 }}
<view class="title one-t">{{ item.productName || item.name || '商品名称' }}</view>
<image :src="item.image || item.img" class="p-img" mode="aspectFill" />
<view class="price">
<text class="unit"></text>
<text class="num">{{ item.price || '0.00' }}</text>
</view>
<view class="actions">
<view class="btn-buy" @click.stop="productItemBuyNowClickHandle(item)">立即下单</view>
<view class="btn-gift" @click.stop="productItemGiftBuyClickHandle(item)">送给朋友</view>
</view>
</view>
<view class="content">今日风向{{ weatherData.win }}</view>
<view class="content">紫外线指数{{ weatherData.uvIndex }}&nbsp;&nbsp;{{ weatherData.uvDescription }}</view>
</view>
<view v-else class="no-weather">
<image
:src="webUrl + '/aiChat/weather/no-weather.png'"
class="img"
mode="widthFix"
/>
<view>无法获取天气信息</view>
</view>
</block>
<block v-else>
<view class="txt-loading">加载中...</view>
</block>
</view>
<view v-if="holidayData.suit" class="holiday-data data-wrap">
</swiper-item>
</swiper>
</view> -->
<view class="topic-wrap">
<view class="title">
<view class="day">{{ holidayData.lunarCalendar }}</view>
<view>{{ holidayData.date.substr(5).replace('-', '/') }}&nbsp;{{ weekDayArr[holidayData.weekDay] }}</view>
</view>
<view class="desc">{{ holidayData.yearTips }}/{{ holidayData.chineseZodiac }}</view>
<view class="tip">
<view class="label"></view>
<view class="content">
{{ holidayData.suit }}
</view>
</view>
<view class="tip">
<view class="label label2"></view>
<view class="content">
{{ holidayData.avoid }}
</view>
</view>
</view>
</view>
<view class="topic-wrap">
<view class="title">
<image
:src="webUrl + '/aiChat/icon-01.png'"
class="icon"
mode="widthFix"
/>
<view class="txt">#大家都在问</view>
<image
:src="webUrl + '/aiChat/icon-01.png'"
class="icon"
mode="widthFix"
/>
</view>
<view class="list-wrap">
<view
:style="{
'width': animationWidth,
'animation': animationStr
}"
class="list-cont"
>
<view
v-for="(item, index) in topicList"
:key="index"
class="list-item"
@click="topicItemClickHandle(item.title)"
>
<view class="title-left">大家都在问</view>
<view class="title-right" @click="loadData('click')">
<image
v-if="item.isHot"
:src="webUrl + '/aiChat/hot.png'"
:src="webUrl + '/aiChat/icon-53.png'"
:class="{
'rotate': topicIsRotate
}"
class="icon"
mode="widthFix"
/>
{{ item.title }}
换一换
</view>
</view>
<view class="list-wrap">
<view class="list-cont">
<view
v-for="(item, index) in topicList"
:key="index"
class="list-item"
@click="topicItemClickHandle(item.title)"
>
<image
v-if="item.isHot"
:src="webUrl + '/aiChat/hot.png'"
class="icon"
mode="widthFix"
/>
{{ item.title }}
</view>
</view>
</view>
</view>
</view>
</block>
<view class="chat-wrap">
<view v-if="chatMessageListLength > 0" class="chat-list-wrap">
<view v-if="chatMessageListLength > 0" class="chat-wrap">
<view class="chat-list-wrap">
<view
v-for="(item, index) in chatMessageList"
:key="index"
@@ -267,12 +242,71 @@
</view>
<!-- 换一换 -->
<view
v-if="!item.showCursor && item.nodes && item.nodes.length && !item.isError && item.showMoreInfo.show"
v-if="!item.showCursor &&
!item.isError &&
(item.orderList.length > 0 ||
item.giftGoodsList.length > 0 ||
item.goodsList.length > 0 ||
item.shopList.length > 0 ||
item.prizeList.length > 0 ||
item.ichList.length > 0 ||
item.qianxianList.length > 0
)
"
class="change-list-wrap"
>
<view v-if="item.showMoreInfo.showType === '特产商品'" class="list-wrap">
<!-- 礼品 -->
<view
v-if="item.giftGoodsList.length > 0"
class="recommend-goods-wrap"
>
<swiper
class="goods-swiper"
:indicator-dots="false"
:autoplay="false"
:current="item.currentSwiperIndex"
previous-margin="120rpx"
next-margin="120rpx"
circular
@change="e => onSwiperChange(index, e)"
>
<swiper-item
v-for="(goodItem, goodIndex) in item.giftGoodsList"
:key="goodIndex"
>
<view
:class="{ 'active': item.currentSwiperIndex === goodIndex }"
class="goods-item"
@click="productItemClickHandle(goodItem)"
>
<view class="supplier" @click.stop="productItemSupplierClickHandle(goodItem)">
<image
:src="webUrl + '/aiChat/icon-57.png'"
class="icon"
mode="widthFix"
lazy-load
/>
<text class="s-name">{{ goodItem.merName ||goodItem.storeName }}</text>
<u-icon name="arrow-right" color="#999" size="12"></u-icon>
</view>
<view class="title one-t">{{ goodItem.name }}</view>
<image :src="goodItem.img" class="p-img" mode="aspectFill" lazy-load />
<view class="price">
<text class="unit">¥</text>
<text class="num">{{ goodItem.price }}</text>
</view>
<view class="actions">
<view class="btn-buy" @click.stop="productItemBuyNowClickHandle(goodItem)">立即下单</view>
<view class="btn-gift" @click.stop="productItemGiftBuyClickHandle(goodItem)">送给朋友</view>
</view>
</view>
</swiper-item>
</swiper>
</view>
<!-- 特产商品 -->
<view v-if="item.goodsList.length > 0" class="list-wrap">
<view
v-for="(productItem, productIndex) in item.showMoreInfo.resultItems"
v-for="(productItem, productIndex) in item.goodsList"
:key="productIndex"
class="product-item"
@click="productItemClickHandle(productItem)"
@@ -280,6 +314,7 @@
<image
:src="productItem.img"
class="img"
lazy-load
/>
<view class="product-info">
<view class="name one-t">
@@ -294,9 +329,10 @@
</view>
</view>
</view>
<view v-if="item.showMoreInfo.showType === '店铺'" class="list-wrap">
<!-- 店铺 -->
<view v-if="item.shopList.length > 0" class="list-wrap">
<view
v-for="(hotel, hotelIndex) in item.showMoreInfo.resultItems"
v-for="(hotel, hotelIndex) in item.shopList"
:key="hotelIndex"
class="product-item"
@click="hotelItemClickHandle(hotel)"
@@ -305,8 +341,9 @@
{{ hotel.hotelTypeName }}
</view>
<image
:src="hotel.img"
:src="hotel.img + ((hotel.img && hotel.img.indexOf('.mp4') > -1) ? '?vframe/jpg/offset/1' : '')"
class="img"
lazy-load
/>
<view class="product-info">
<view class="name one-t">
@@ -318,9 +355,10 @@
</view>
</view>
</view>
<view v-if="item.showMoreInfo.showType === '非遗文化'" class="list-wrap">
<!-- 非遗 -->
<view v-if="item.ichList.length > 0" class="list-wrap">
<view
v-for="(ich, ichIndex) in item.showMoreInfo.resultItems"
v-for="(ich, ichIndex) in item.ichList"
:key="ichIndex"
class="product-item"
@click="ichItemClickHandle(ich)"
@@ -328,6 +366,7 @@
<image
:src="ich.img"
class="img"
lazy-load
/>
<view class="product-info">
<view class="name one-t">
@@ -339,9 +378,10 @@
</view>
</view>
</view>
<view v-if="item.showMoreInfo.showType === '千县名品'" class="list-wrap">
<!-- 千县 -->
<view v-if="item.qianxianList.length > 0" class="list-wrap">
<view
v-for="(qianxian, qianxianIndex) in item.showMoreInfo.resultItems"
v-for="(qianxian, qianxianIndex) in item.qianxianList"
:key="qianxianIndex"
class="product-item"
@click="qianxianItemClickHandle(qianxian)"
@@ -349,6 +389,7 @@
<image
:src="qianxian.img"
class="img"
lazy-load
/>
<view class="product-info">
<view class="name name2 one-t">
@@ -357,9 +398,10 @@
</view>
</view>
</view>
<view v-if="item.showMoreInfo.showType === '优惠活动'" class="list-wrap prize-list-wrap">
<!-- 抽奖 -->
<view v-if="item.prizeList.length > 0" class="list-wrap prize-list-wrap">
<view
v-for="(prize, prizeIndex) in item.showMoreInfo.resultItems"
v-for="(prize, prizeIndex) in item.prizeList"
:key="prizeIndex"
class="prize-item"
@click="prizeItemClickHandle(prize)"
@@ -368,18 +410,47 @@
:src="prize.img"
class="img"
mode="widthFix"
lazy-load
/>
</view>
</view>
<view v-if="item.showMoreInfo.showType !== '优惠活动'" class="change-btn">
<image
:src="webUrl + '/aiChat/icon-change.png'"
class="icon"
mode="widthFix"
@click="analyzeKeywordsChangeHandle(item.conversationId, item.showMoreInfo)"
/>
<!-- 订单 -->
<view v-if="item.orderList.length > 0" class="order-list-wrap">
<view
v-for="(order, orderIndex) in item.orderList"
:key="orderIndex"
class="order-item-wrap"
>
<order-item
:item="order"
@viewOrderTrack="viewOrderTrackHandle"
/>
</view>
</view>
<view
v-if="item.shopList.length > 0 ||
item.goodsList.length > 0 ||
item.giftGoodsList.length > 0 ||
item.ichList.length > 0 ||
item.qianxianList.length > 0 ||
item.shopList.length > 0
"
class="change-btn"
>
<view class="change-btn-content" @click="analyzeKeywordsChangeHandle(item.conversationId, item)">
<image
:src="webUrl + '/aiChat/icon-53.png'"
:class="{
'rotate': item.changeIsRotate
}"
class="icon"
mode="widthFix"
/>
换一换
</view>
</view>
</view>
<!-- 建议提问 -->
<view
v-if="index === (chatMessageListLength - 1) && item.listQuestion.length > 0"
class="suggestion-wrap"
@@ -420,25 +491,42 @@
}"
class="page-to-bottom"
>
<view
v-if="chatNumber"
class="new-chat"
@click="createNewHandle"
>
<view class="down-icon-wrap">
<image
:src="webUrl + '/aiChat/icon-05.png'"
class="btn-icon"
v-if="chatMessageListLength > 0 && !isScrollToBottom && !loading"
:src="webUrl + '/aiChat/down.png'"
class="icon down-icon"
mode="widthFix"
@click="scrollToBottomHandle"
/>
开启新对话
</view>
<image
v-if="chatMessageListLength > 0 && !isScrollToBottom && !loading"
:src="webUrl + '/aiChat/down.png'"
class="icon"
mode="widthFix"
@click="scrollToBottomHandle"
/>
<view class="container">
<view
v-if="chatNumber"
class="new-chat"
@click="createNewHandle"
>
<image
:src="webUrl + '/aiChat/icon-54.png'"
class="btn-icon"
mode="widthFix"
/>
开启新对话
</view>
<view
v-for="(item, index) in bottomTools"
:key="index"
class="bottom-tool-item"
@click="bottomToolClickHandle(item)"
>
<image
:src="webUrl + '/aiChat/' + item.icon + '.png'"
class="tool-icon"
mode="widthFix"
/>
{{ item.text }}
</view>
</view>
</view>
<bottom-send
ref="bottomSend"
@@ -454,40 +542,51 @@
:status-bar-height="statusBarHeight"
@enter-history="audioStopHandle"
/>
<ProductWindow
ref="attrWindow"
:attr="attr"
:cart-num="cart_num"
:show-ok="!showGiftBtn"
:is-gift="showGiftBtn"
:padding-bottom="'60px'"
class-name="ai-product-window"
ok-text="立即购买"
@changeFun="changeFun"
@ok="buyNowOrGiftBuyReq(1)"
@gift="buyNowOrGiftBuyReq(2)"
/>
</view>
</template>
<script>
import { chatMixins } from '../mixins/chatMixins.js'
import { chatMixinsV2 } from '../mixins/chatMixinsV2.js'
import goCartMixin from '@/mixins/goCartMixins'
import {
getAiSystemInfoSetting,
getAiSystemInfoTopic
} from '@/api/public'
import {
getWeatherData,
getHolidayData
} from '@/api/chat/index'
import AiHistoryList from '../components/historyList'
import BottomSend from '../components/bottomSend.vue'
import OrderItem from '../components/orderItem.vue'
import ProductWindow from '@/components/ProductWindow'
export default {
name: 'AiChatIndexPage',
components: {
AiHistoryList,
BottomSend
BottomSend,
OrderItem,
ProductWindow
},
mixins: [chatMixins],
mixins: [chatMixinsV2, goCartMixin],
data() {
return {
cityName: '',
weatherDataLoading: false,
weatherIsLoad: true,
weatherData: {},
holidayData: {},
weekDayArr: Object.freeze(['', '周一', '周二', '周三', '周四', '周五', '周六', '周日']),
animationWidth: '150%',
animationStr: '',
settingInfo: {},
topicList: []
topicList: [],
onlyOneToAddCart: false,
topicIsRotate: false
}
},
onLoad(options) {
@@ -517,38 +616,35 @@ export default {
this.loadData()
})
},
loadData() {
loadData(type = '') {
if (this.topicIsRotate) return
if (type === 'click') {
this.topicIsRotate = true
}
getAiSystemInfoTopic().then(res => {
const { success, data } = res
if (success) {
this.topicList = data || []
}
})
if (this.cityName) {
this.weatherDataLoading = true
getWeatherData({
cityName: this.cityName
}).then(res => {
const { success, data } = res
if (success) {
this.weatherData = data
// 返回数据先过滤this.topicList,随机保留三条数据
let list = data || []
if (this.topicList && this.topicList.length > 0) {
const currentTitles = this.topicList.map(item => item.title)
const filtered = list.filter(item => !currentTitles.includes(item.title))
// 如果过滤后的数据不够3条,就不进行过滤
if (filtered.length >= 3) {
list = filtered
}
}
this.weatherIsLoad = true
this.weatherDataLoading = false
}).catch(() => {
this.weatherDataLoading = false
this.weatherIsLoad = false
})
}
getHolidayData().then(res => {
const { success, data } = res
if (success) {
this.holidayData = data
list.sort(() => Math.random() - 0.5)
this.topicList = list.slice(0, 3)
setTimeout(() => {
this.topicIsRotate = false
}, 1000)
}
})
},
// 创建新会话
createNewHandle() {
this.closeAttrWindow()
if (this.audioContext) {
this.audioContext.stop()
}
@@ -625,43 +721,39 @@ export default {
opacity: 0.0;
}
}
.home-wrap {
display: flex;
flex-direction: column;
justify-content: space-between;
height: calc(100vh - 240rpx);
padding: 0 0 240rpx 0;
box-sizing: border-box;
}
.focus-guide-wrap {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 40rpx;
flex-direction: column;
.guide-left {
.avatar {
display: block;
width: 267rpx;
height: 530rpx;
width: 230rpx;
height: 404rpx;
}
}
.guide-right {
position: relative;
padding: 30rpx;
margin: 0 0 0 40rpx;
border-radius: 20rpx;
width: 100%;
padding: 30rpx 0;
font-size: 28rpx;
background-color: #fff;
box-shadow: 0rpx 12rpx 30rpx rgba(0,0,0,0.1);
.trangle {
position: absolute;
bottom: 120rpx;
left: -15rpx;
width: 30rpx;
height: 30rpx;
background-color: #fff;
box-shadow: -30rpx 12rpx 30rpx rgba(0,0,0,0.1);
transform: rotate(45deg);
}
text-align: center;
.title {
width: 110%;
font-weight: bold;
font-size: 34rpx;
}
.content {
padding: 30rpx 0 0 0;
color: #999;
padding: 30rpx 24rpx 0 24rpx;
color: #3D4CF0;
}
}
}
@@ -670,46 +762,48 @@ export default {
.title {
display: flex;
align-items: center;
justify-content: center;
.txt {
width: 186rpx;
height: 46rpx;
margin: 0 20rpx;
border-radius: 24rpx;
text-align: center;
line-height: 46rpx;
color: #fff;
font-size: 28rpx;
background-color: #3D4CF1;
justify-content: space-between;
padding: 0 24rpx;
color: #3D4CF0;
font-size: 28rpx;
.title-left {
font-size: 32rpx;
font-weight: bold;
}
.title-right {
display: flex;
align-items: center;
}
.icon {
display: flex;
width: 40rpx;
width: 32rpx;
height: 32rpx;
margin: 0 8rpx 0 0;
&.rotate {
animation: spin-icon 1s linear;
}
}
}
.list-wrap {
width: 100%;
margin: 60rpx 0 0 0;
padding: 40rpx 0 0 0;
overflow-x: hidden;
.list-cont {
display: flex;
flex-wrap: wrap;
width: 750 * 1.5rpx;
padding: 0 0 0 24rpx;
padding: 0 24rpx;
box-sizing: border-box;
// animation: translateXSwiper 10s infinite linear alternate;
display: flex;
flex-direction: column;
align-items: flex-start;
.list-item {
display: flex;
align-items: center;
height: 48rpx;
padding: 0 18rpx;
margin: 0 30rpx 30rpx 0;
border-radius: 24rpx;
padding: 6rpx 12rpx;
margin: 0 0 24rpx 0;
border-radius: 12rpx;
border: 1rpx solid #ddd;
font-size: 28rpx;
color: #666;
background: rgba(255,255,255,0.39);
box-shadow: 0rpx 6rpx 12rpx rgba(0,0,0,0.1);
background-color: #fff;
.icon {
display: block;
width: 24rpx;
+14
View File
@@ -45,3 +45,17 @@ export function getWeatherData(params) {
export function getHolidayData(params) {
return request.get('/v1/chat/holidayData', params, { login: true })
}
export function getCompletionsV3(params) {
return request.get('/v1/chat/intent/recognize', params, { login: true })
}
// 通过关键字-搜索列表-换一换
export function getAnalyzeKeywordsChangeV3(data) {
return request.post('/v1/chat/skill/refresh', data, { login: true })
}
// 以图搜索商品
export function getAnalyzeByImageV3(data) {
return request.post('/v1/chat/image/recognition', data, { login: true })
}
+2 -2
View File
@@ -82,8 +82,8 @@ export function getHotelInfo(params) {
}
// 获取千县名品店铺类型列表
export function getCountyFamousHotelType() {
return request.get("/countyFamous/hotelType", {}, {login: true})
export function getCountyFamousHotelType(params) {
return request.get("/countyFamous/hotelType", params, {login: true})
}
/**
+115 -5
View File
@@ -3,15 +3,77 @@ import request from '@/utils/request'
/**
* 抽奖活动信息
* */
export function getDetail() {
return request.get('/lottery/dice/detail')
export function getDetail(params = {}) {
return request.get('/lottery/dice/detail', params)
}
/**
* 抽奖
* */
export function getPrize() {
return request.post('/lottery/dice/draw')
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')
}
/**
@@ -35,4 +97,52 @@ 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)
}
+2 -2
View File
@@ -313,8 +313,8 @@ export function getCityShopList(params) {
return request.get('/countyFamous/hotel', params, {login: true})
}
export function getCountyFamousHotelType() {
return request.get('/countyFamous/hotelType', {}, {login: true})
export function getCountyFamousHotelType(params) {
return request.get('/countyFamous/hotelType', params, {login: true})
}
/**
+194 -21
View File
@@ -12,10 +12,14 @@ page {
min-height: 100vh;
background: linear-gradient(155deg, rgba(61, 76, 241, 0.15) 0%, rgba(255,255,255,1) 25%, rgba(255,255,255,1) 75%, rgba(61, 76, 241, 0.15) 100%);
// background-color: #fff;
// background-size: 100% 100vh;
// background-size: 100% calc(100vh - 160rpx);
// background-image: url(https://wxapp.xdd618.com/api/file/pic/aiChat/bg.png);
// background-repeat: no-repeat;
// background-attachment: fixed;
&.new-chat {
background-size: 100% calc(100vh - 160rpx);
background-repeat: no-repeat;
}
.fix-tabbar-header {
position: fixed;
top: 0;
@@ -90,28 +94,36 @@ page {
}
.page-to-bottom {
position: fixed;
bottom: 180rpx;
bottom: 160rpx;
left: 0;
right: 0;
z-index: 8;
display: flex;
align-items: center;
justify-content: flex-end;
padding: 0 24rpx;
transition: all 0.2s;
&.focus {
transform: translateY(-40rpx);
}
.container {
display: flex;
flex-wrap: nowrap;
align-items: center;
width: 100%;
padding: 24rpx;
box-sizing: border-box;
overflow-x: auto;
}
.new-chat {
display: flex;
align-items: center;
height: 68rpx;
flex-shrink: 0;
height: 64rpx;
padding: 0 24rpx;
border-radius: 40rpx;
line-height: 68rpx;
margin: 0 20rpx 0 0;
border-radius: 16rpx;
line-height: 64rpx;
font-size: 30rpx;
background-color: #fff;
box-shadow: 0rpx 6rpx 12rpx rgba(0,0,0,0.16);
color: #fff;
background-color: #3D4CF1;
box-shadow: 0rpx 0 12rpx rgba(74,74,74,0.2);
.btn-icon {
display: block;
width: 40rpx;
@@ -119,13 +131,45 @@ page {
margin: 0 8rpx 0 0;
}
}
.down-icon-wrap {
display: flex;
justify-content: flex-end;
padding: 0 24rpx 0 0;
}
.icon {
display: block;
width: 68rpx;
height: 68rpx;
margin: 0 0 0 24rpx;
border-radius: 50%;
box-shadow: 0rpx 6rpx 12rpx rgba(0,0,0,0.16);
flex-shrink: 0;
width: 64rpx;
height: 64rpx;
border-radius: 16rpx;
background-color: #fff;
box-shadow: 0rpx 0 12rpx rgba(74,74,74,0.2);
}
.bottom-tool-item {
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
height: 64rpx;
padding: 0 24rpx;
margin: 0 20rpx 0 0;
border-radius: 16rpx;
font-size: 30rpx;
color: #333;
background-color: #fff;
box-shadow: 0rpx 6rpx 20rpx rgba(74,74,74,0.1);
&:last-child {
margin-right: 0;
}
.tool-icon {
display: block;
width: 32rpx;
height: 32rpx;
padding: 0;
margin: 0 12rpx 0 0;
background-color: none;
box-shadow: none;
}
}
}
.fix-page-bottom {
@@ -1049,10 +1093,21 @@ page {
align-items: center;
justify-content: center;
padding: 0 0 20rpx 0;
.icon {
display: block;
width: 124rpx;
height: 38rpx;
.change-btn-content {
display: flex;
align-items: center;
justify-content: center;
color: #3D4CF0;
font-size: 28rpx;
.icon {
display: block;
width: 32rpx;
height: 32rpx;
margin: 0 8rpx 0 0;
&.rotate {
animation: spin-icon 1s linear;
}
}
}
}
}
@@ -1191,4 +1246,122 @@ page {
}
}
}
}
}
.recommend-goods-wrap {
width: calc(100% + 48rpx);
padding: 24rpx 0;
margin: 0 -24rpx;
.goods-swiper {
width: 100%;
height: 750rpx;
}
.goods-item {
display: block;
width: 460rpx;
margin: 24rpx auto 0 auto;
padding: 24rpx;
box-sizing: border-box;
background: #fff;
border-radius: 20rpx;
box-shadow: 0rpx 0 24rpx rgba(0,0,0,0.16);
white-space: normal;
transition: all 0.3s ease;
transform: scale(0.9);
opacity: 0.8;
&.active {
transform: scale(1);
opacity: 1;
}
.supplier {
display: flex;
align-items: center;
font-size: 24rpx;
color: #666;
margin-bottom: 16rpx;
.icon {
display: block;
width: 28rpx;
height: 28rpx;
}
.s-name {
flex: 1;
margin: 0 8rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.title {
font-size: 28rpx;
font-weight: bold;
color: #333;
margin-bottom: 16rpx;
line-height: 40rpx;
}
.p-img {
width: 412rpx;
height: 412rpx;
margin-bottom: 16rpx;
border-radius: 12rpx;
background-color: #f5f5f5;
}
.price {
color: #C52733;
text-align: center;
margin-bottom: 16rpx;
.unit {
font-size: 28rpx;
font-weight: bold;
}
.num {
font-size: 36rpx;
font-weight: bold;
}
}
.actions {
display: flex;
justify-content: center;
.btn-buy {
width: 160rpx;
height: 56rpx;
margin: 0 12rpx;
line-height: 56rpx;
text-align: center;
background: #C52733;
color: #fff;
font-size: 24rpx;
border-radius: 28rpx;
}
.btn-gift {
width: 160rpx;
height: 56rpx;
margin: 0 12rpx;
line-height: 52rpx;
text-align: center;
background: #fff;
color: #C52733;
font-size: 24rpx;
border-radius: 28rpx;
border: 2rpx solid #C52733;
box-sizing: border-box;
}
}
}
}
.order-list-wrap {
width: 100%;
padding: 24rpx 0;
box-sizing: border-box;
.order-item-wrap + .order-item-wrap {
margin: 24rpx 0 0 0;
}
}
@keyframes spin-icon {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(720deg);
}
}
+6
View File
@@ -37,6 +37,12 @@ input{line-height: normal; box-sizing:border-box;}
.line1{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width: 100%;}
.line2{word-break:break-all;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.mask{position:fixed;top:0;left:0;right:0;bottom:0;z-index:55;background-color:rgba(0,0,0,0.5);}
.ai-product-window.product-window {
z-index: 1002;
}
.ai-product-window.mask {
z-index: 1001;
}
+188
View File
@@ -8231,3 +8231,191 @@ 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;
}
.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;
}
}
}
}
-57
View File
@@ -1,57 +0,0 @@
<template>
<view class="components-checkbox-icon jc-center ai-center" :class="{'isSelected':isSelected}" @click="change"
v-if="ready">
<image class="icon-hook" :src="webUrl+'/20240109175325131970.png'" mode="scaleToFill" v-if="isSelected"/>
</view>
</template>
<script setup>
import {computed, getCurrentInstance, onMounted, ref} from '@vue/composition-api'
import {VUE_APP_RESOURCES_URL} from '../config/index'
const webUrl = VUE_APP_RESOURCES_URL
const emit = defineEmits(['change'])
const {proxy} = getCurrentInstance()
const props = defineProps({
defaultState: {
type: Boolean,
default: false
},
mark: Array
})
const ready = ref(false)
onMounted(() => {
ready.value = true
})
const isSelected = computed(() => {
return props.defaultState
})
const change = () => {
emit('change', !isSelected.value, props.mark)
}
</script>
<style scoped lang="less">
.components-checkbox-icon {
display: inline-flex;
width: 32rpx;
height: 32rpx;
box-sizing: border-box;
border: 2rpx solid #D5D7D8;
border-radius: 50%;
}
.icon-hook {
width: 24rpx;
height: 24rpx;
}
.isSelected {
border: 3px solid #FD5749;
background: #FD5749;
}
</style>
+1 -1
View File
@@ -82,7 +82,7 @@ export default {
methods: {
routerGo(cart) {
this.$yrouter.push({
path: "/pages/shop/GoodsEvaluate/index",
path: "/pagesShop/shop/GoodsEvaluate/index",
query: { id: cart.unique }
});
}
+30 -4
View File
@@ -1,6 +1,13 @@
<template>
<view>
<view class="product-window" :class="attr.cartAttr === true ? 'on' : ''" :style="{paddingBottom: paddingBottom}">
<view
:class="{
'on': attr.cartAttr === true,
[className]: className
}"
:style="{paddingBottom: paddingBottom}"
class="product-window"
>
<view class="textpic acea-row row-between-wrapper">
<view class="pictrue" @click="previewImg(attrObj.productSelect.image)">
<image :src="attrObj.productSelect.image" class="image" />
@@ -45,7 +52,7 @@
</view>
<view class="cart v12-justify-between v12-align-center">
<view class="titlev12-dark-text f12-font-32">购买数量</view>
<view class="carnum acea-row row-left">
<view v-if="!hideQuantityControls" class="carnum acea-row row-left">
<view style="border-radius: 40rpx 0rpx 0rpx 40rpx" class="cart-btn item reduce v12-font-36 v12-font-bold v12-white-text v12-dark1 v12-dark1-border" :class="cartNum <= 1 ? 'on' : ''" @click="CartNumDes">-</view>
<input
type="number"
@@ -66,6 +73,7 @@
@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
@@ -73,7 +81,7 @@
color="#C52733"
@click="$emit('ok')"
:disabled="(attr.productSelect.stock === 0 && attr.cartAttr)"
>加入购物车</u-button>
>{{ okText }}</u-button>
</view>
<view class="v12-px-2 v12-mt-3" v-if="isGift">
<u-button
@@ -84,7 +92,13 @@
>送给朋友</u-button>
</view>
</view>
<view class="mask" @touchmove.prevent :hidden="attr.cartAttr === false" @click="closeAttr"></view>
<view
:hidden="attr.cartAttr === false"
:class="className"
class="mask"
@touchmove.prevent
@click="closeAttr"
></view>
</view>
</template>
<script>
@@ -118,6 +132,18 @@ export default {
cartNum: {
type: Number,
default: () => 1
},
okText: {
type: String,
default: '加入购物车'
},
className: {
type: String,
default: ''
},
hideQuantityControls: {
type: Boolean,
default: false
}
},
data() {
-343
View File
@@ -1,343 +0,0 @@
<template>
<view>
<view class="upload">
<block v-for="(upload,index) in uploads" :key="index">
<view class="uplode-file">
<image v-if="types == 'image'" class="uploade-img" :style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'" :src="upload" :data-src="upload" @tap="previewImage"></image>
<image v-if="types == 'image'" class="clear-one-icon" :src="clearIcon" @tap="delImage(index)"></image>
<video v-if="types == 'video'" class="uploade-img" :style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'" :src="upload" controls>
<cover-image v-if="types == 'video'" class="clear-one-icon" :src="clearIcon" @tap="delImage(index)"></cover-image>
</video>
</view>
</block>
<view v-if="uploads.length < uploadCount" :class="uploadIcon ? 'uploader-icon' : 'uploader-input-box'" :style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'" >
<view v-if="!uploadIcon" class="uploader-input" @tap="chooseUploads"></view>
<image v-else class="image-cion" :src="uploadIcon" @tap="chooseUploads"></image>
</view>
</view>
<!-- <button type="primary" v-if="types == 'image' && !autoUpload" @tap="unifiedUpload">上传</button> -->
</view>
</template>
<script>
export default{
props: {
header:{
type:Object,
default:{}
},
types: {
type: String,
default: 'image'
},
dataList: {
type: Array,
default: function() {
return []
}
},
clearIcon: {
type: String,
default: 'http://img1.imgtn.bdimg.com/it/u=451604666,2295832001&fm=26&gp=0.jpg'
},
uploadIcon: {
type: String,
default: ''
},
uploadUrl: {
type: String,
default: ''
},
deleteUrl: {
type: String,
default: ''
},
uploadCount: {
type: Number,
default: 1
},
//上传图片大小 默认3M
upload_max: {
type: Number,
default: 3
},
//上传视频大小 默认30M
upload_video_max: {
type: Number,
default: 50
},
// 图片/选择宽高
upload_img_wh: {
type: Number,
default: 210
},
autoUpload: {
type: Boolean,
default: false
}
},
data(){
return {
//上传的图片地址
uploadImages: [],
//展示的图片地址
uploads: [],
// 超出限制数组
exceeded_list: [],
}
},
watch:{
dataList:{
handler(val){
this.uploads = val;
},
immediate: true
}
},
methods:{
previewImage (e) {
var current = e.target.dataset.src
uni.previewImage({
current: current,
urls: this.dataList
})
},
chooseUploads(){
switch (this.types){
case 'image':
uni.chooseImage({
count: this.uploadCount - this.uploads.length, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], //从相册选择
success: (res) => {
for(let i = 0; i< res.tempFiles.length; i++){
if(Math.ceil(res.tempFiles[i].size / 1024) < this.upload_max * 1024){
this.uploads.push(res.tempFiles[i].path)
console.log(this.uploads);
if(this.autoUpload){
this.uploadFile(res.tempFiles[i].path)
}else{
this.uploadImages.push(res.tempFiles[i].path);
}
}else {
this.exceeded_list.push(i === 0 ? 1 : i + 1);
uni.showModal({
title: '提示',
content: `${[...new Set(this.exceeded_list)].join(',')}张图片超出限制${this.upload_max}MB,已过滤`
});
}
}
},
fail: (err) => {
uni.showModal({
content: JSON.stringify(err)
});
}
});
break;
case 'video' :
uni.chooseVideo({
sourceType: ['camera', 'album'],
success: (res) => {
if(Math.ceil(res.size / 1024) < this.upload_video_max * 1024){
this.uploads.push(res.tempFilePath)
uni.uploadFile({
url: this.uploadUrl, //仅为示例,非真实的接口地址
filePath: res.tempFilePath,
name: 'file',
//请求参数
formData: {
'user': 'test'
},
success: (uploadFileRes) => {
this.$emit('successVideo',uploadFileRes)
}
});
}else {
uni.showModal({
title: '提示',
content: `${[...new Set(this.exceeded_list)].join(',')}张视频超出限制${this.upload_max}MB,已过滤`
});
}
},
fail: (err) => {
uni.showModal({
content: JSON.stringify(err)
});
}
});
break;
}
},
delImage(index){
this.uploads.splice(index,1)
//如果不自动上传
if(!this.autoUpload){
this.uploadImages.splice(index,1)
}
// //第一个是判断app或者h5的 第二个是判断小程序的
// if(this.uploads[index].substring(0,4) !== 'http' || this.uploads[index].substring(0,11) == 'http://tmp/'){
// this.uploads.splice(index,1)
// //如果不自动上传
// if(!this.autoUpload){
// this.uploadImages.splice(index,1)
// }
// return;
// };
// if(!this.deleteUrl) {
// uni.showModal({
// content: '请填写删除接口'
// });
// return;
// };
// uni.request({
// url: this.deleteUrl,
// method: 'DELETE',
// data: {
// image: this.dataList[index]
// },
// success: res => {
// if(res.data.status == 1) {
// uni.showToast({
// title: '删除成功'
// })
// this.uploads.splice(index,1)
// }
// },
// });
},
uploadFile(path){
// uni.uploadFile({
// url: this.uploadUrl, //仅为示例,非真实的接口地址
// filePath: path,
// name: 'file',
// //自定义请求参数
// formData: {
// 'user': 'test'
// },
// success: (uploadFileRes) => {
// this.$emit('successImage',uploadFileRes)
// }
// });
uni.uploadFile({
url: this.uploadUrl,
filePath: path,
header: this.header,
name: "file",
success: res => {
console.log(res);
this.$emit('successImage',uploadFileRes)
},
fail: err => {
console.log(err);
},
complete: res => {
}
});
},
unifiedUpload(){
if(!this.uploadUrl) {
uni.showModal({
content: '请填写上传接口'
});
return;
};
for (let i of this.uploadImages) {
this.uploadFile(i)
}
}
}
}
</script>
<style scoped>
.upload {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.uplode-file {
margin: 10rpx;
/* width: 210upx;
height: 210upx; */
position: relative;
}
.uploade-img {
display: block;
/* width: 210upx;
height: 210upx; */
}
.clear-one{
position: absolute;
top: -10rpx;
right: 0;
}
.clear-one-icon{
position: absolute;
width: 20px;
height: 20px;
top: 0;
right: 0;
z-index: 9;
}
.uploader-input-box {
position: relative;
margin:10upx;
/* width: 208upx;
height: 208upx; */
border: 2upx solid #D9D9D9;
box-sizing: border-box;
}
.uploader-input-box:before,
.uploader-input-box:after {
content: " ";
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background-color: #D9D9D9;
}
.uploader-input-box:before {
width: 4upx;
height: 79upx;
}
.uploader-input-box:after {
width: 79upx;
height: 4upx;
}
.uploader-input-box:active {
border-color: #999999;
}
.uploader-input-box:active:before,
.uploader-input-box:active:after {
background-color: #999999;
}
.uploader-input {
position: absolute;
z-index: 1;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
}
.uploader-icon{
position: relative;
margin:10upx;
/* width: 208upx;
height: 208upx; */
}
.uploader-icon .image-cion{
width: 100%;
height: 100%;
}
</style>
-51
View File
@@ -1,51 +0,0 @@
### easy-upload 组件
使用方法
```js
<easy-upload
:dataList="dataList"
uploadUrl="http://localhost:3000/upload"
deleteUrl='http://localhost:3000/upload'
:types="types"
@successImage="successImage"
@successVideo="successvideo"
/>
//使用 hbuilderX (easycom) 可以直接使用 或
import easyUpload from '@/components/easy-upload/easy-upload.vue'
export default {
//用easycom 则省略注册组件
components:{
easyUpload
},
data() {
return {
dataList: [],
types: 'image'
}
}
}
```
| 参数 | 类型 | 是否必填 | 参数描述
| ---- | ---- | ---- | ----
| types | String | 否 | 上传类型 image/video
| autoUpload | Boolean | 否 | 自动上传 默认false
| dataList | Array | 否 | 图片/视频数据展示
| clearIcon | String | 否 | 删除图标(可以换成自己的图片)
| uploadIcon | String | 否 | 上传图标(可以换成自己的图片)
| uploadUrl | String | 否 | 上传的接口
| deleteUrl | String | 否 | 删除的接口
| uploadCount | Number | 否 | 上传图片最大个数(默认为一张)
| upload_max | Number | 否 | 上传大小(默认为3M)
| upload_max | Number | 否 | 上传大小(默认为3M)
| upload_max | Number | 否 | 上传大小(默认为3M)
| 事件 | 是否必填 | 参数描述
| ---- | ---- | ----
| successImage | 否 | 上传图片成功事件
| successVideo | 否 | 上传视频成功回调
示例项目中有简单的服务端代码 /server (node.js)
如果本地测试可以先运行一下服务端的代码
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,143 +0,0 @@
/* eslint-disable */
var provinceData = [{
"label": "北京市",
"value": "11"
},
{
"label": "天津市",
"value": "12"
},
{
"label": "河北省",
"value": "13"
},
{
"label": "山西省",
"value": "14"
},
{
"label": "内蒙古自治区",
"value": "15"
},
{
"label": "辽宁省",
"value": "21"
},
{
"label": "吉林省",
"value": "22"
},
{
"label": "黑龙江省",
"value": "23"
},
{
"label": "上海市",
"value": "31"
},
{
"label": "江苏省",
"value": "32"
},
{
"label": "浙江省",
"value": "33"
},
{
"label": "安徽省",
"value": "34"
},
{
"label": "福建省",
"value": "35"
},
{
"label": "江西省",
"value": "36"
},
{
"label": "山东省",
"value": "37"
},
{
"label": "河南省",
"value": "41"
},
{
"label": "湖北省",
"value": "42"
},
{
"label": "湖南省",
"value": "43"
},
{
"label": "广东省",
"value": "44"
},
{
"label": "广西壮族自治区",
"value": "45"
},
{
"label": "海南省",
"value": "46"
},
{
"label": "重庆市",
"value": "50"
},
{
"label": "四川省",
"value": "51"
},
{
"label": "贵州省",
"value": "52"
},
{
"label": "云南省",
"value": "53"
},
{
"label": "西藏自治区",
"value": "54"
},
{
"label": "陕西省",
"value": "61"
},
{
"label": "甘肃省",
"value": "62"
},
{
"label": "青海省",
"value": "63"
},
{
"label": "宁夏回族自治区",
"value": "64"
},
{
"label": "新疆维吾尔自治区",
"value": "65"
},
{
"label": "台湾",
"value": "66"
},
{
"label": "香港",
"value": "67"
},
{
"label": "澳门",
"value": "68"
},
{
"label": "钓鱼岛",
"value": "69"
}
]
export default provinceData;
@@ -1,381 +0,0 @@
<template>
<view class="simple-address" v-if="showPopup" @touchmove.stop.prevent="clear">
<!-- 遮罩层 -->
<view
class="simple-address-mask"
@touchmove.stop.prevent="clear"
v-if="maskClick"
:class="[ani + '-mask', animation ? 'mask-ani' : '']"
:style="{
'background-color': maskBgColor
}"
@tap="hideMask(true)"
></view>
<view class="simple-address-content simple-address--fixed" :class="[type, ani + '-content', animation ? 'content-ani' : '']">
<view class="simple-address__header">
<view class="simple-address__header-btn-box" @click="pickerCancel"><text class="simple-address__header-text">取消</text></view>
<view class="simple-address__header-btn-box" @click="pickerConfirm"><text class="simple-address__header-text" :style="{ color: themeColor }">确定</text></view>
</view>
<view class="simple-address__box">
<picker-view indicator-style="height: 70rpx;" class="simple-address-view" :value="pickerValue" @change="pickerChange">
<picker-view-column>
<!-- #ifndef APP-NVUE -->
<view class="picker-item" v-for="(item, index) in provinceDataList" :key="index">{{ item.label }}</view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<text class="picker-item" v-for="(item, index) in provinceDataList" :key="index">{{ item.label }}</text>
<!-- #endif -->
</picker-view-column>
<picker-view-column>
<!-- #ifndef APP-NVUE -->
<view class="picker-item" v-for="(item, index) in cityDataList" :key="index">{{ item.label }}</view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<text class="picker-item" v-for="(item, index) in cityDataList" :key="index">{{ item.label }}</text>
<!-- #endif -->
</picker-view-column>
<picker-view-column>
<!-- #ifndef APP-NVUE -->
<view class="picker-item" v-for="(item, index) in areaDataList" :key="index">{{ item.label }}</view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<text class="picker-item" v-for="(item, index) in areaDataList" :key="index">{{ item.label }}</text>
<!-- #endif -->
</picker-view-column>
</picker-view>
</view>
</view>
</view>
</template>
<script>
import provinceData from './city-data/province.js';
import cityData from './city-data/city.js';
import areaData from './city-data/area.js';
export default {
name: 'simpleAddress',
props: {
mode: {
// 地址类型
// default 则代表老版本根据index索引获取数据
//
type: String,
default: 'default'
},
// 开启动画
animation: {
type: Boolean,
default: true
},
/* 弹出层类型,可选值;
bottom:底部弹出层
*/
type: {
type: String,
default: 'bottom'
},
// maskClick
maskClick: {
type: Boolean,
default: true
},
show: {
type: Boolean,
default: true
},
maskBgColor: {
type: String,
default: 'rgba(0, 0, 0, 0.4)' //背景颜色 rgba(0, 0, 0, 0.4) 为空则调用 uni.scss
},
themeColor: {
type: String,
default: '' // 主题色
},
/* 默认值 */
pickerValueDefault: {
type: Array,
default() {
return [0, 0, 0];
}
}
},
data() {
return {
ani: '',
showPopup: false,
pickerValue: [0, 0, 0],
provinceDataList: [],
cityDataList: [],
areaDataList: []
};
},
watch: {
show(newValue) {
if (newValue) {
this.open();
} else {
this.close();
}
},
pickerValueDefault() {
this.init();
}
},
created() {
this.init();
},
methods: {
init() {
this.handPickValueDefault(); // 对 pickerValueDefault 做兼容处理
this.provinceDataList = provinceData;
this.cityDataList = cityData[this.pickerValueDefault[0]];
this.areaDataList = areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]];
this.pickerValue = this.pickerValueDefault;
},
handPickValueDefault() {
if (this.pickerValueDefault !== [0, 0, 0]) {
if (this.pickerValueDefault[0] > provinceData.length - 1) {
this.pickerValueDefault[0] = provinceData.length - 1;
}
if (this.pickerValueDefault[1] > cityData[this.pickerValueDefault[0]].length - 1) {
this.pickerValueDefault[1] = cityData[this.pickerValueDefault[0]].length - 1;
}
if (this.pickerValueDefault[2] > areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]].length - 1) {
this.pickerValueDefault[2] = areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]].length - 1;
}
}
},
pickerChange(e) {
let changePickerValue = e.detail.value;
if (this.pickerValue[0] !== changePickerValue[0]) {
// 第一级发生滚动
this.cityDataList = cityData[changePickerValue[0]];
this.areaDataList = areaData[changePickerValue[0]][0];
changePickerValue[1] = 0;
changePickerValue[2] = 0;
} else if (this.pickerValue[1] !== changePickerValue[1]) {
// 第二级滚动
this.areaDataList = areaData[changePickerValue[0]][changePickerValue[1]];
changePickerValue[2] = 0;
}
this.pickerValue = changePickerValue;
this._$emit('onChange');
},
_$emit(emitName) {
let pickObj = {
label: this._getLabel(),
value: this.pickerValue,
cityCode: this._getCityCode(),
areaCode: this._getAreaCode(),
provinceCode: this._getProvinceCode(),
labelArr:this._getLabel().split('-')
};
console.log(this._getLabel().split('-'));
this.$emit(emitName, pickObj);
},
_getLabel() {
let pcikerLabel =
this.provinceDataList[this.pickerValue[0]].label + '-' + this.cityDataList[this.pickerValue[1]].label + '-' + this.areaDataList[this.pickerValue[2]].label;
return pcikerLabel;
},
_getCityCode() {
return this.cityDataList[this.pickerValue[1]].value;
},
_getProvinceCode() {
return this.provinceDataList[this.pickerValue[0]].value;
},
_getAreaCode() {
return this.areaDataList[this.pickerValue[2]].value;
},
queryIndex(params = [], type = 'value') {
// params = [ 11 ,1101,110101 ];
// 1.获取省份的index
let provinceIndex = provinceData.findIndex(res => res[type] == params[0]);
let cityIndex = cityData[provinceIndex].findIndex(res => res[type] == params[1]);
let areaIndex = areaData[provinceIndex][cityIndex].findIndex(res => res[type] == params[2]);
return {
index: [provinceIndex, cityIndex, areaIndex],
data: {
province: provinceData[provinceIndex],
city: cityData[provinceIndex][cityIndex],
area: areaData[cityIndex][0][areaIndex]
}
};
},
clear() {},
hideMask() {
this._$emit('onCancel');
this.close();
},
pickerCancel() {
this._$emit('onCancel');
this.close();
},
pickerConfirm() {
this._$emit('onConfirm');
this.close();
},
open() {
this.showPopup = true;
this.$nextTick(() => {
setTimeout(() => {
this.ani = 'simple-' + this.type;
}, 100);
});
},
close(type) {
if (!this.maskClick && type) return;
this.ani = '';
this.$nextTick(() => {
setTimeout(() => {
this.showPopup = false;
}, 300);
});
}
}
};
</script>
<style lang="scss" scoped>
.simple-address {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
}
.simple-address-mask {
position: fixed;
bottom: 0;
top: 0;
left: 0;
right: 0;
transition-property: opacity;
transition-duration: 0.3s;
opacity: 0;
/* #ifndef APP-NVUE */
z-index: 99;
/* #endif */
}
.mask-ani {
transition-property: opacity;
transition-duration: 0.2s;
}
.simple-bottom-mask {
opacity: 1;
}
.simple-center-mask {
opacity: 1;
}
.simple-address--fixed {
position: fixed;
bottom: 0;
left: 0;
right: 0;
transition-property: transform;
transition-duration: 0.3s;
transform: translateY(460rpx);
/* #ifndef APP-NVUE */
z-index: 99;
/* #endif */
}
.simple-address-content {
background-color: #ffffff;
}
.simple-content-bottom {
bottom: 0;
left: 0;
right: 0;
transform: translateY(500rpx);
}
.content-ani {
transition-property: transform, opacity;
transition-duration: 0.2s;
}
.simple-bottom-content {
transform: translateY(0);
}
.simple-center-content {
transform: scale(1);
opacity: 1;
}
.simple-address__header {
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
border-bottom-color: #f2f2f2;
border-bottom-style: solid;
border-bottom-width: 1rpx;
}
.simple-address--fixed-top {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
justify-content: space-between;
border-top-color: $uni-border-color;
border-top-style: solid;
border-top-width: 1rpx;
}
.simple-address__header-btn-box {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
justify-content: center;
height: 70rpx;
}
.simple-address__header-text {
text-align: center;
font-size: $uni-font-size-base;
color: #1aad19;
line-height: 70rpx;
padding-left: 40rpx;
padding-right: 40rpx;
}
.simple-address__box {
position: relative;
}
.simple-address-view {
position: relative;
bottom: 0;
left: 0;
/* #ifndef APP-NVUE */
width: 100%;
/* #endif */
/* #ifdef APP-NVUE */
width: 750rpx;
/* #endif */
height: 408rpx;
background-color: rgba(255, 255, 255, 1);
}
.picker-item {
text-align: center;
line-height: 70rpx;
text-overflow: ellipsis;
font-size: 28rpx;
}
</style>
@@ -1,134 +0,0 @@
<template>
<view :class="[styleType === 'text'?'segmented-control--text' : 'segmented-control--button' ]" :style="{ borderColor: styleType === 'text' ? '' : activeColor }"
class="segmented-control">
<view v-for="(item, index) in values" :class="[ styleType === 'text'?'segmented-control__item--text': 'segmented-control__item--button' , index === currentIndex&&styleType === 'button'?'segmented-control__item--button--active': '' , index === 0&&styleType === 'button'?'segmented-control__item--button--first': '',index === values.length - 1&&styleType === 'button'?'segmented-control__item--button--last': '' ]"
:key="index" :style="{
backgroundColor: index === currentIndex && styleType === 'button' ? activeColor : '',borderColor: index === currentIndex&&styleType === 'text'||styleType === 'button'?activeColor:'transparent'
}"
class="segmented-control__item" @click="_onClick(index)">
<text :style="{color:
index === currentIndex
? styleType === 'text'
? activeColor
: '#fff'
: styleType === 'text'
? '#000'
: activeColor}"
class="segmented-control__text">{{ item }}</text>
</view>
</view>
</template>
<script>
/**
* SegmentedControl 分段器
* @description 用作不同视图的显示
* @tutorial https://ext.dcloud.net.cn/plugin?id=54
* @property {Number} current 当前选中的tab索引值,从0计数
* @property {String} styleType = [button|text] 分段器样式类型
* @value button 按钮类型
* @value text 文字类型
* @property {String} activeColor 选中的标签背景色与边框颜色
* @property {Array} values 选项数组
* @event {Function} clickItem 组件触发点击事件时触发,e={currentIndex}
*/
export default {
name: 'UniSegmentedControl',
props: {
current: {
type: Number,
default: 0
},
values: {
type: Array,
default () {
return []
}
},
activeColor: {
type: String,
default: '#007aff'
},
styleType: {
type: String,
default: 'button'
}
},
data() {
return {
currentIndex: 0
}
},
watch: {
current(val) {
if (val !== this.currentIndex) {
this.currentIndex = val
}
}
},
created() {
this.currentIndex = this.current
},
methods: {
_onClick(index) {
if (this.currentIndex !== index) {
this.currentIndex = index
this.$emit('clickItem', {
currentIndex: index
})
}
}
}
}
</script>
<style lang="scss" scoped>
.segmented-control {
/* #ifndef APP-NVUE */
display: flex;
box-sizing: border-box;
/* #endif */
flex-direction: row;
height: 50rpx;
overflow: hidden;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
.segmented-control__item {
/* #ifndef APP-NVUE */
display: inline-flex;
box-sizing: border-box;
/* #endif */
position: relative;
flex: 1;
justify-content: center;
align-items: center;
padding: 10rpx;
}
.segmented-control__item--button {
border-style: solid;
border-top-width: 1px;
border-bottom-width: 1px;
border-right-width: 1px;
border-left-width: 0;
}
.segmented-control__item--button--first {
border-left-width: 1px;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}
.segmented-control__item--button--last {
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
}
.segmented-control__item--text {
border-bottom-style: solid;
border-bottom-width: 3px;
}
.segmented-control__text {
font-size: 28rpx;
line-height: 28rpx;
text-align: center;
}
</style>
+16 -6
View File
@@ -5,13 +5,15 @@
v-if="!item.isFarmerShop"
:src="item[imageKey]"
class="img"
lazy-load
/>
<image
:src="item.farmerShopCover"
v-if="item.farmerShopCoverType === 1 && item.isFarmerShop"
class="img"
mode="heightFix|widthFix">
</image>
mode="heightFix|widthFix"
lazy-load
/>
<image
:src="item.farmerShopCover + '?vframe/jpg/offset/1'"
mode="heightFix|widthFix"
@@ -20,30 +22,35 @@
:show-fullscreen-btn="false"
:show-play-btn="false"
class="img"
:poster="item.farmerShopCover + '?vframe/jpg/offset/1'">
</image>
:poster="item.farmerShopCover + '?vframe/jpg/offset/1'"
lazy-load
/>
<image
v-if="item.isOldBrand"
:src="webUrl + '/home/old-mark.png'"
class="mark-img"
lazy-load
/>
<image
v-if="item.isGiftCard"
style="left: 0;width: 120rpx;"
:src="webUrl + '/home/gift-tag.png'"
class="mark-img"
lazy-load
/>
<image
v-if="item.isLandmarkGoods"
:src="webUrl + '/home/mark-land.png'"
class="mark-img"
style="right: 20rpx"
lazy-load
/>
<image
v-if="item.isCountyFamous"
:src="webUrl + '/home/qixian-mark.png'"
class="mark-img"
lazy-load
/>
<image
v-if="item.isIch"
@@ -55,6 +62,7 @@
v-if="item.isFarmerShop"
:src="webUrl + '/orderIcon/nm.png'"
class="mark-img-nm"
lazy-load
/>
</view>
<view v-if="item.isFarmerShop" class="more-t v12-pt-2 v12-font-bold v12-font-28 v12-px-2" >{{ item.farmerShopContent }}</view>
@@ -83,12 +91,14 @@
<text class="v12-font-20">
</text>
{{ item[priceKey] }}</text>
{{ item[priceKey] }}
</text>
</view>
<view v-if="item.isNegotiable === 0" class="btn" @click.stop="$emit('add', item)">
<image
:src="webUrl + '/home/icon-cart.png'"
class="img"
lazy-load
/>
</view>
</view>
@@ -97,7 +107,7 @@
v-if="item.isFarmerShop"
class="v12-justify-start v12-align-center v12-pt-2 v12-px-2 v12-pb-2">
<view class="btn v12-mr-2">
<image :src="item.farmerShopLogo" class="nm-img-logo v12-radius-100"></image>
<image :src="item.farmerShopLogo" class="nm-img-logo v12-radius-100" lazy-load />
</view>
<view class="one-t v12-font-24 v12-dark1-text" style="width:230rpx">{{ item.farmerShopName }}/{{ item.farmerShopCityName || '-' }}</view>
</view>
+8 -1
View File
@@ -12,7 +12,14 @@ const settings = {
/* 系统接口前缀,没有统一的填空字符串 */
sysPrefix: '/',
/* 是否收集错误日志 */
collectRequestError: false
collectRequestError: false,
/* 订阅消息模板ID */
SubscribeMessageTmplIds: [
'7O3wKw7_D4t7yfSOlvecKuOQP8QEPY88uBx2FJg43HE',
'TSmTnGibZ8IxWCiRWOvLxha6-0u7tE-V1-WbDCiPkKU',
'9Q6xLHe6HyjkU5Zn5k_2zxYPf2y4MxVyUbOSW8pcZRU',
'v0GegDmzjpqiinmdj7dOwRK1MaTAPVyCOpqn8hJ3Y3Q'
]
}
export default settings
+3 -1
View File
@@ -35,6 +35,8 @@ export default {
},
cart_num: 1,
CartCount: 0,
// 只有一个规格时直接加入购物车;AI聊天界面则不直接加入购物车,每次都要显示规格选择弹窗
onlyOneToAddCart: true
}
},
methods: {
@@ -112,7 +114,7 @@ export default {
// 是否单一规格
const onlyOne = Object.keys(data.productValue).length === 1
if(onlyOne) {
if(onlyOne && this.onlyOneToAddCart) {
this.handleOk(() => this.getCartCount())
return
}
@@ -0,0 +1,72 @@
import { getDrawTicketByOrder } from '@/api/lottery'
export const orderPaySuccessToCheckDrawStatus = {
data(){
return {
drawTicketPopup: {
show: false,
ticketCode: '',
drawTime: ''
}
}
},
methods: {
setDrawTicketPopupFromQuery(ticketData = '') {
const drawTicketData = ticketData || this.$yroute.query.drawTicketData
if (!drawTicketData) {
return
}
let result = {}
try {
result = typeof drawTicketData === 'string' ? JSON.parse(decodeURIComponent(drawTicketData)) : drawTicketData
console.log(result)
} catch (e) {
result = {}
}
const hasTicket = Number(result.hasTicket || 0) === 1
const howPopup = Number(result.showPopup || 0) === 1
if (!hasTicket || !howPopup) {
return
}
this.drawTicketPopup = {
show: true,
ticketCode: result.ticketCode || result.code || '',
drawTime: result.drawTime || ''
}
},
closeDrawTicketPopup() {
this.drawTicketPopup.show = false
},
goHomeFromPopup() {
this.drawTicketPopup.show = false
uni.switchTab({
url: '/pages/home/index'
})
},
goTicketsFromPopup() {
this.drawTicketPopup.show = false
uni.navigateTo({
url: '/pkg-video/views/county-my-tickets'
})
},
buildOrderDetailQuery(orderId, drawTicketResult = {}) {
return {
id: orderId,
drawTicketData: encodeURIComponent(JSON.stringify(drawTicketResult || {}))
}
},
async afterPaySuccess(orderId, fallback) {
if (!orderId) {
fallback && fallback()
return
}
try {
const res = await getDrawTicketByOrder(orderId)
const result = (res && res.data) || {}
fallback && fallback(result)
return
} catch (e) {
}
fallback && fallback({})
}
}
}
+257 -150
View File
@@ -76,12 +76,6 @@
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/shop/StoreList/index",
"style": {
"navigationBarTitleText": "商家列表"
}
},
{
"path": "pages/shop/GoodsList/index",
"style": {
@@ -110,24 +104,6 @@
"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": {
@@ -149,88 +125,18 @@
"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": {
@@ -239,18 +145,6 @@
"navigationStyle": "custom"
}
},
{
"path": "pages/order/Logistics/index",
"style": {
"navigationBarTitleText": "查看物流"
}
},
{
"path": "pages/order/OrderDetails/index",
"style": {
"navigationBarTitleText": "订单详情"
}
},
{
"path": "pages/order/OrderSubmission/index",
"style": {
@@ -258,44 +152,12 @@
"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": {
@@ -309,18 +171,6 @@
"navigationBarTitleText": "视频详情",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "pages/user/UserFavorite/UserFavorite",
"style": {
"navigationBarTitleText": "我的喜欢"
}
},
{
"path": "pages/user/Points/index",
"style": {
"navigationBarTitleText": "积分"
}
}
],
"subPackages": [
@@ -401,11 +251,47 @@
"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": "实名认证"
}
}
]
},
@@ -897,6 +783,20 @@
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
{
"path": "views/imageRecognition",
"style": {
"navigationBarTitleText": "拍照识图",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
{
"path": "views/imageRecognitionResult",
"style": {
"navigationBarTitleText": "云灵"
}
}
]
},
@@ -994,6 +894,213 @@
}
}
]
},
{
"root": "pagesOrder",
"pages": [
{
"path": "order/GoodsReturn/index",
"style": {
"navigationBarTitleText": "申请退款"
}
},
{
"path": "order/Logistics/index",
"style": {
"navigationBarTitleText": "查看物流"
}
},
{
"path": "order/OrderDetails/index",
"style": {
"navigationBarTitleText": "订单详情"
}
},
{
"path": "order/ReturnList/index",
"style": {
"navigationBarTitleText": "退货列表"
}
}
]
},
{
"root": "pagesShop",
"pages": [
{
"path": "shop/EvaluateList/index",
"style": {
"navigationBarTitleText": "评价列表"
}
},
{
"path": "shop/GoodsCollection/index",
"style": {
"navigationBarTitleText": "商品收藏"
}
},
{
"path": "shop/GoodsEvaluate/index",
"style": {
"navigationBarTitleText": "商品评价"
}
},
{
"path": "shop/GoodsPromotion/index",
"style": {
"navigationBarTitleText": "商品促销"
}
},
{
"path": "shop/StoreList/index",
"style": {
"navigationBarTitleText": "商家列表"
}
}
]
},
{
"root": "pagesUser",
"pages": [
{
"path": "user/CustomerList/index",
"style": {
"navigationBarTitleText": "客服列表"
}
},
{
"path": "user/History/index",
"style": {
"navigationBarTitleText": "商品足迹",
"navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false
}
},
{
"path": "user/MemberUpgradeIntro/MemberUpgradeIntro",
"style": {
"navigationBarTitleText": "升级介绍"
}
},
{
"path": "user/Message/Message",
"style": {
"navigationBarTitleText": "消息",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "user/MessageDetail/MessageDetail",
"style": {
"navigationBarTitleText": "消息详情",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "user/ModifyPayPassword/ModifyPayPassword",
"style": {
"navigationBarTitleText": "评价列表"
}
},
{
"path": "user/Points/index",
"style": {
"navigationBarTitleText": "积分"
}
},
{
"path": "user/Recharge/index",
"style": {
"navigationBarTitleText": "充值"
}
},
{
"path": "user/RetrievePassword/index",
"style": {
"navigationBarTitleText": "找回密码"
}
},
{
"path": "user/UpgradeElectronicProtocol/UpgradeElectronicProtocol",
"style": {
"navigationBarTitleText": "升级电子协议"
}
},
{
"path": "user/UpgradeProtocolDetail/UpgradeProtocolDetail",
"style": {
"navigationBarTitleText": "升级电子协议详情"
}
},
{
"path": "user/UserAccount/index",
"style": {
"navigationBarTitleText": "账户余额"
}
},
{
"path": "user/UserBill/index",
"style": {
"navigationBarTitleText": "账单记录"
}
},
{
"path": "user/UserFavorite/UserFavorite",
"style": {
"navigationBarTitleText": "我的喜欢"
}
},
{
"path": "user/UserVip/index",
"style": {
"navigationBarTitleText": "用户等级"
}
},
{
"path": "user/promotion/CashAudit/index",
"style": {
"navigationBarTitleText": "提现审核"
}
},
{
"path": "user/promotion/CommissionDetails/index",
"style": {
"navigationBarTitleText": "提现审核"
}
},
{
"path": "user/promotion/Poster/index",
"style": {
"navigationBarTitleText": "海报生成"
}
},
{
"path": "user/promotion/PromoterList/index",
"style": {
"navigationBarTitleText": "分销列表",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "user/promotion/PromoterOrder/index",
"style": {
"navigationBarTitleText": "分销详情"
}
},
{
"path": "user/promotion/UserCash/index",
"style": {
"navigationBarTitleText": "提现"
}
},
{
"path": "user/promotion/UserPromotion/index",
"style": {
"navigationBarTitleText": "团队管理",
"navigationBarBackgroundColor": "#FFFFFF"
}
}
]
}
],
"preloadRule": {
+20 -6
View File
@@ -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">
<view class="btn" @click.stop="addToCart(item, 'productId')">
<image
:src="webUrl + '/home/icon-cart.png'"
class="img-icon"
@@ -309,14 +309,14 @@
:key="attr"
:class="{
'on': attr.check,
'disabled': getAttrItemData(attr.attr).stock === 0
'disabled': getAttrItemData1(attr.attr).stock === 0
}"
class="attr"
@click="attrItemClick(attr, attrIndex, index)"
>
{{ attr.attr }}
<text
v-if="getAttrItemData(attr.attr).stock === 0"
v-if="getAttrItemData1(attr.attr).stock === 0"
class="tag"
>缺货</text>
</view>
@@ -368,28 +368,41 @@
</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
XddTabbar,
ProductWindow
},
mixins: [pageListenMixins],
mixins: [pageListenMixins, goCartMixin],
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -415,6 +428,7 @@ export default {
}
},
computed: {
...mapGetters(['isLogin']),
total() {
let price = 0
this.list.forEach(item => {
@@ -766,7 +780,7 @@ export default {
uni.hideLoading()
})
},
getAttrItemData(attr) {
getAttrItemData1(attr) {
let result = {
stock: 0
}
+115 -770
View File
@@ -346,10 +346,34 @@
<!-- v9 老用户弹窗 -->
<u-popup
v-if="isOldUserPopupShow"
v-if="drawEntranceConfig.homePosterEnable"
mode="center"
bgColor="transparent"
:show="isOldUser && oldUserPopup.image && lotteryCanDraw"
:show="isDrawPosterVisible"
>
<view class="popup-old-user flex flex-col ai-center">
<image
:src="drawEntranceConfig.homePosterImage"
class="main"
mode="scaleToFill"
@click="tapDrawPoster()"
/>
<view
class="icon-box flex jc-center ai-center"
@click="closeDrawPoster()"
>
<image
:src="webUrl+'/20230608112219219303.png'"
mode="scaleToFill"
/>
</view>
</view>
</u-popup>
<u-popup
v-if="canShowOldPoster"
mode="center"
bgColor="transparent"
:show="isOldUser"
>
<view class="popup-old-user flex flex-col ai-center">
<image
@@ -405,7 +429,6 @@ import { pageListenMixins } from '@/mixins/pageListenMixins'
import ProductWindow from '@/components/ProductWindow'
import goCartMixin from '@/mixins/goCartMixins'
import FunctionGuide from '@/components/FunctionGuide'
import GuideMixins from '@/mixins/GuideMixins'
import AiEntrance from '@/components/aiChat/entrance'
import {
getSearchPageConfig
@@ -417,6 +440,7 @@ import {
openLocationSettting
} from "@/utils/common"
import { getWeixinShareConfig } from '@/api/public'
import { checkDrawTime } from '@/api/lottery'
export default {
name: 'IndexPage',
components: {
@@ -426,11 +450,13 @@ export default {
FunctionGuide,
AiEntrance
},
mixins: [pageListenMixins, goCartMixin, GuideMixins],
mixins: [pageListenMixins, goCartMixin],
data() {
return {
isFirstLoad: true,
isOldUserPopupShow: 0,
isDrawPosterVisible: false,
canShowOldPoster: false,
webUrl: this.$VUE_APP_RESOURCES_URL,
// 状态栏高度
statusBarHeight: 20,
@@ -458,6 +484,8 @@ export default {
// 老用户弹窗
isOldUser: true,
oldUserPopup: {},
// 首页抽奖弹窗入口
drawEntranceConfig: {},
// 民宿专题轮播
contentHomestay: [],
// 新品推荐
@@ -489,11 +517,11 @@ export default {
}
},
onLoad() {
console.time()
// uni.hideTabBar()
const _this = this
_this.init()
_this.queryGuide('index')
this.getSearch()
_this.getSearch()
uni.getSystemInfo({
success: (e) => {
let statusBar = 0
@@ -509,7 +537,7 @@ export default {
getWeixinShareConfig().then(res => {
const { success, data } = res
if (success) {
this.shareData = data
_this.shareData = data
}
})
},
@@ -623,769 +651,6 @@ export default {
})
})
},
showFunctionGuide() {
if(this._step == this.functionGuideData.step) return
this._step = this.functionGuideData.step
if(this.functionGuideData.step == 1) {
const imgs = [
{
url: this.webUrl + '/引导页素材/首页引导/Group1/Group 1-1.png',
style: {
position: 'absolute',
zIndex: 99,
width: '474rpx',
top: '100rpx',
left: '-110rpx',
right: 0,
margin: 'auto',
height: '289rpx',
/* px: ; */
},
isBtn: false
},
{
url: this.webUrl + '/引导页素材/首页引导/Group1/Group 1-2.png',
style: {
position: 'absolute',
zIndex: 99,
width: '186rpx',
top: '350rpx',
left: '240rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'next'
},
{
url: this.webUrl + '/引导页素材/首页引导/Group1/Group 1-3.png',
style: {
position: 'absolute',
zIndex: 99,
width: '173rpx',
top: '180rpx',
right: '100rpx',
height: '248rpx',
},
isBtn: false
},
]
this.getElementData('#step1', res=>{
this.screenWidth = res.width - 20
this.setFunctionGuideData({
imgs: imgs,
btnGroupPosition: {
top: 510 - 100 + 'rpx',
},
tipsPosition: '420rpx',
position: {
top: 510 - 100 + 'rpx',
left: res.left + 10 + 'px',
width: `${res.width - 20}px`,
height: `${160 + 228 + 16 + 514 + 16}rpx`,
}
})
})
}else {
const menusUrl = this.menus.map(item => item.uniapp_url)
const urls = {
2: '/pages/chose-city/chose-city?type=0',
3: '/pages/chose-city/chose-city?type=1',
4: '/pkg_product/views/healthList',
5: '/pkg_product/views/giftList',
6: '/pkg_product/views/heritage',
7: '/pkg_join/views/index',
8: '/v4/views/attract/attract'
}
if(this.functionGuideData.step == 2) {
if(menusUrl.indexOf(urls[2]) < 0) {
this.$refs.FunctionGuide.next()
return
}
if(menusUrl.indexOf(urls[2]) > -1) {
const index = menusUrl.indexOf(urls[2])
const imgs = [
{
url: this.webUrl + '/引导页素材/首页引导/Group2/Group 2-1.png',
style:{
position: 'absolute',
zIndex: 99,
width: '454rpx',
top: '140rpx',
left: '-130rpx',
right: 0,
margin: 'auto',
height: '258rpx',
},
isBtn: false
},
{
url: this.webUrl + '/引导页素材/首页引导/Group2/Group 2-2.png',
style:{
position: 'absolute',
zIndex: 99,
width: '117rpx',
top: 213*2+'rpx',
left: '-110rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'jump'
},
{
url: this.webUrl + '/引导页素材/首页引导/Group2/Group 2-3.png',
style:{
position: 'absolute',
zIndex: 99,
width: '117rpx',
top: 213*2+'rpx',
left: '200rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'next'
},
]
this.toEle('box-item' + index, imgs)
}
return
}
if(this.functionGuideData.step == 3) {
if(menusUrl.indexOf(urls[3]) < 0) {
this.$refs.FunctionGuide.next()
return
}
if(menusUrl.indexOf(urls[3]) > -1) {
const imgs = [
{
url: this.webUrl + '/引导页素材/首页引导/Group3/Group 3-1.png',
style:{
position: 'absolute',
zIndex: 99,
width: '620rpx',
top: '540rpx',
left: '-50rpx',
right: 0,
margin: 'auto',
height: '254rpx',
},
isBtn: false
},
{
url: this.webUrl + '/引导页素材/首页引导/Group3/Group 3-2.png',
style:{
position: 'absolute',
zIndex: 99,
width: '117rpx',
top: '530rpx',
left: '110rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'jump'
},
{
url: this.webUrl + '/引导页素材/首页引导/Group3/Group 3-3.png',
style:{
position: 'absolute',
zIndex: 99,
width: '117rpx',
top: '530rpx',
left: '410rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'next'
},
]
const index = menusUrl.indexOf(urls[3])
this.toEle('box-item' + index, imgs)
}
return
}
if(this.functionGuideData.step == 4) {
if(menusUrl.indexOf(urls[4]) < 0) {
this.$refs.FunctionGuide.next()
return
}
if(menusUrl.indexOf(urls[4]) > -1) {
const imgs = [
{
url: this.webUrl + '/引导页素材/首页引导/Group4/Group 4-1.png',
style:{
position: 'absolute',
zIndex: 99,
width: '578rpx',
top: '180rpx',
left: '150rpx',
right: 0,
margin: 'auto',
height: '226rpx',
},
isBtn: false
},
{
url: this.webUrl + '/引导页素材/首页引导/Group4/Group 4-2.png',
style:{
position: 'absolute',
zIndex: 99,
width: '117rpx',
top: 213*2+'rpx',
left: '340rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'jump'
},
{
url: this.webUrl + '/引导页素材/首页引导/Group4/Group 4-3.png',
style:{
position: 'absolute',
zIndex: 99,
width: '117rpx',
top: 213*2+'rpx',
left: '610rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'next'
},
]
const index = menusUrl.indexOf(urls[4])
this.toEle('box-item' + index, imgs)
}
return
}
if(this.functionGuideData.step == 5) {
if(menusUrl.indexOf(urls[5]) < 0) {
this.$refs.FunctionGuide.next()
return
}
if(menusUrl.indexOf(urls[5]) > -1) {
const imgs = [
{
url: this.webUrl + '/引导页素材/首页引导/Group5/Group 5-1.png',
style:{
position: 'absolute',
zIndex: 99,
width: '495rpx',
top: '540rpx',
left: '230rpx',
right: 0,
margin: 'auto',
height: '267rpx',
},
isBtn: false
},
{
url: this.webUrl + '/引导页素材/首页引导/Group5/Group 5-2.png',
style:{
position: 'absolute',
zIndex: 99,
width: '117rpx',
top: 265*2+'rpx',
left: -120*2+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'jump'
},
{
url: this.webUrl + '/引导页素材/首页引导/Group5/Group 5-3.png',
style:{
position: 'absolute',
zIndex: 99,
width: '117rpx',
top: 265*2+'rpx',
left: 20*2+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'next'
},
]
const index = menusUrl.indexOf(urls[5])
this.toEle('box-item' + index, imgs)
}
return
}
if(this.functionGuideData.step == 6) {
if(menusUrl.indexOf(urls[6]) < 0) {
this.$refs.FunctionGuide.next()
return
}
if(menusUrl.indexOf(urls[6]) > -1) {
const imgs = [
{
url: this.webUrl + '/引导页素材/首页引导/Group6/Group 6-1.png',
style:{
position: 'absolute',
zIndex: 99,
width: '534rpx',
top: '140rpx',
left: '230rpx',
right: 0,
margin: 'auto',
height: '280rpx',
},
isBtn: false
},
{
url: this.webUrl + '/引导页素材/首页引导/Group6/Group 6-2.png',
style:{
position: 'absolute',
zIndex: 99,
width: '117rpx',
top: 213*2+'rpx',
left: -20*2+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'jump'
},
{
url: this.webUrl + '/引导页素材/首页引导/Group6/Group 6-3.png',
style:{
position: 'absolute',
zIndex: 99,
width: '117rpx',
top: 213*2+'rpx',
left: 140*2+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'next'
},
]
const index = menusUrl.indexOf(urls[6])
this.toEle('box-item' + index, imgs)
}
return
}
// 7 商户, 8 招商
if(this.functionGuideData.step == 7) {
if(menusUrl.indexOf(urls[7]) < 0) {
this.$refs.FunctionGuide.next()
return
}
if(menusUrl.indexOf(urls[7]) > -1) {
const imgs = [
{
url: this.webUrl + '/引导页素材/首页引导/Group13/Group 13-1.png',
style:{
position: 'absolute',
zIndex: 99,
width: 291.5*2+'rpx',
top: 280*2+'rpx',
left: 10*2+'rpx',
right: 0,
margin: 'auto',
height: 116.5*2+'rpx',
},
isBtn: false
},
{
url: this.webUrl + '/引导页素材/首页引导/Group13/Group 13-2.png',
style:{
position: 'absolute',
zIndex: 99,
width: '117rpx',
top: 213*2+'rpx',
left: -280*2+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'jump'
},
{
url: this.webUrl + '/引导页素材/首页引导/Group13/Group 13-3.png',
style:{
position: 'absolute',
zIndex: 99,
width: '117rpx',
top: 213*2+'rpx',
left: -150*2+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'next'
},
]
const index = menusUrl.indexOf(urls[7])
this.toEle('box-item' + index, imgs)
}
return
}
if(this.functionGuideData.step == 8) {
if(menusUrl.indexOf(urls[8]) < 0) {
this.$refs.FunctionGuide.next()
return
}
if(menusUrl.indexOf(urls[8]) > -1) {
const imgs = [
{
url: this.webUrl + '/引导页素材/首页引导/Group14/Group 14-1.png',
style:{
position: 'absolute',
zIndex: 99,
width: '539rpx',
top: 80*2+'rpx',
left: 100*2+'rpx',
right: 0,
margin: 'auto',
height: '265rpx',
},
isBtn: false
},
{
url: this.webUrl + '/引导页素材/首页引导/Group14/Group 14-2.png',
style:{
position: 'absolute',
zIndex: 99,
width: '117rpx',
top: 213*2+'rpx',
left: 150*2+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'next'
},
{
url: this.webUrl + '/引导页素材/首页引导/Group14/Group 14-3.png',
style:{
position: 'absolute',
zIndex: 99,
width: '117rpx',
top: 213*2+'rpx',
left: 10*2+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'jump'
},
]
const index = menusUrl.indexOf(urls[8])
this.toEle('box-item' + index, imgs)
}
return
}
if (this.functionGuideData.step == 10) {
const imgs = [
{
url: this.webUrl + '/引导页素材/首页引导/Group7/Group 7-1.png',
style:{
position: 'absolute',
zIndex: 99,
width: '438rpx',
top: 140*2+'rpx',
left: -164*2+'rpx',
right: 0,
margin: 'auto',
height: '336rpx',
},
isBtn: false
},
{
url: this.webUrl + '/引导页素材/首页引导/Group8/Group 8-2.png',
style:{
position: 'absolute',
zIndex: 99,
width: '129rpx',
top: 285*2+'rpx',
left: 0+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'jump'
},
{
url: this.webUrl + '/引导页素材/首页引导/Group8/Group 8-3.png',
style:{
position: 'absolute',
zIndex: 99,
width: '129rpx',
top: 285*2+'rpx',
left: 139 * 2+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'next'
},
]
this.toEle('dibiao', imgs)
return
}
if (this.functionGuideData.step == 9) {
const imgs = [
{
url: this.webUrl + '/引导页素材/首页引导/Group8/Group 8-1.png',
style:{
position: 'absolute',
zIndex: 99,
width: '574rpx',
top: 170*2+'rpx',
left: -0+'rpx',
right: 0,
margin: 'auto',
height: '238rpx',
},
isBtn: false
},
{
url: this.webUrl + '/引导页素材/首页引导/Group8/Group 8-2.png',
style:{
position: 'absolute',
zIndex: 99,
width: '118rpx',
top: 285*2+'rpx',
left: -290*2+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'jump'
},
{
url: this.webUrl + '/引导页素材/首页引导/Group8/Group 8-3.png',
style:{
position: 'absolute',
zIndex: 99,
width: '118rpx',
top: 285*2+'rpx',
left: -(290-130)*2+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'next'
}
]
this.toEle('qianxian', imgs)
return
}
if (this.functionGuideData.step == 11) {
const imgs = [
{
url: this.webUrl + '/引导页素材/首页引导/Group9/Group 9-1.png',
style:{
position: 'absolute',
zIndex: 99,
width: '444rpx',
top: 310*2+'rpx',
left: 144*2+'rpx',
right: 0,
margin: 'auto',
height: '252rpx',
},
isBtn: false
},
{
url: this.webUrl + '/引导页素材/首页引导/Group9/Group 9-2.png',
style:{
position: 'absolute',
zIndex: 99,
width: '118rpx',
top: 435*2+'rpx',
left: -235*2+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'jump'
},
{
url: this.webUrl + '/引导页素材/首页引导/Group9/Group 9-3.png',
style:{
position: 'absolute',
zIndex: 99,
width: '118rpx',
top: 435*2+'rpx',
left: -90*2+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'next'
}
]
this.toEle('xkd', imgs)
return
}
if (this.functionGuideData.step == 12) {
const imgs = [
{
url: this.webUrl + '/引导页素材/首页引导/Group11/Group 11-1.png',
style:{
position: 'absolute',
zIndex: 99,
width: '450rpx',
top: 465*2+'rpx',
left: 120*2+'rpx',
right: 0,
margin: 'auto',
height: '218rpx',
},
isBtn: false
},
{
url: this.webUrl + '/引导页素材/首页引导/Group11/Group 11-2.png',
style:{
position: 'absolute',
zIndex: 99,
width: '118rpx',
top: 575*2+'rpx',
left: -210*2+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'jump'
},
{
url: this.webUrl + '/引导页素材/首页引导/Group11/Group 11-3.png',
style:{
position: 'absolute',
zIndex: 99,
width: '118rpx',
top: 575*2+'rpx',
left: -70*2+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'next'
}
]
this.toEle('xpsx', imgs)
return
}
// top 140, buttom: 540
if(this.functionGuideData.step == 13) {
const imgs = [
{
url: this.webUrl + '/引导页素材/首页引导/Group10/Group 10-1.png',
style:{
position: 'absolute',
zIndex: 99,
width: '489rpx',
top: 580*2+'rpx',
left: 0+'rpx',
right: 0,
margin: 'auto',
height: '267rpx',
},
isBtn: false
},
{
url: this.webUrl + '/引导页素材/首页引导/Group10/Group 10-2.png',
style:{
position: 'absolute',
zIndex: 99,
width: '118rpx',
top: 555*2+'rpx',
left: 0+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'jump'
},
{
url: this.webUrl + '/引导页素材/首页引导/Group10/Group 10-3.png',
style:{
position: 'absolute',
zIndex: 99,
width: '118rpx',
top: 555*2+'rpx',
left: 140*2+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'next'
}
]
this.$nextTick(() => {
this.setFunctionGuideData({
imgs: imgs,
btnGroupPosition: '',
tipsPosition: '',
position: {
bottom: '10px',
left: this.tabIconPostion.left + 'px',
width: `${this.tabIconPostion.width}px`,
height: `${this.tabIconPostion.height}px`,
}
})
})
return
}
if (this.functionGuideData.step == 14) {
const imgs = [
{
url: this.webUrl + '/引导页素材/首页引导/Group12/Group 12-1.png',
style:{
position: 'absolute',
zIndex: 99,
width: '479rpx',
top: 665*2+'rpx',
left: 40*2+'rpx',
right: 0,
margin: 'auto',
height: '180rpx',
},
isBtn: false
},
{
url: this.webUrl + '/引导页素材/首页引导/Group12/Group 12-2.png',
style:{
position: 'absolute',
zIndex: 99,
width: '118rpx',
top: 750*2+'rpx',
left: 40*2+'rpx',
right: 0,
margin: 'auto',
height: '46rpx',
},
isBtn: 'next'
}
]
this.setFunctionGuideData({
imgs: imgs,
btnGroupPosition: '',
tipsPosition: '',
position: {
bottom: 10 + 'px',
left: this.messageIcon.left + 'px',
width: `${this.messageIcon.width}px`,
height: `${this.messageIcon.height}px`,
}
})
return
}
}
},
toEle(id, imgs) {
this.getElementData(`#${id}`, res=>{
if(res.left + res.width / 2 > this.screenWidth) {
@@ -1491,6 +756,7 @@ export default {
_this.bastLeftList = []
_this.bastRightList = []
_this.lotteryCanDraw = data.lotteryCanDraw || false
_this.initPosterPopupState(data)
if (data.bastList) {
for (let i = 0; i < data.bastList.length; i++) {
if (i % 2 === 0) {
@@ -1515,6 +781,9 @@ export default {
}
}
}
this.$nextTick(() => {
console.timeEnd()
})
}
uni.hideLoading()
}).catch(() => {
@@ -1540,6 +809,7 @@ export default {
this.$set(this, 'isOldUserPopupShow', data.isOldUserPopupShow || 0)
this.indexVideo = data.indexVideo ? data.indexVideo.videoUrl : ''
this.lotteryCanDraw = data.lotteryCanDraw || false
this.initPosterPopupState(data)
if (data.bastList) {
const newBastLeftList = []
const newBastRightList = []
@@ -1602,6 +872,81 @@ export default {
changeOldPopup(state) {
this.isOldUser = state
},
hasShownDrawPosterInSession() {
const app = getApp && getApp()
return Boolean(app && app.globalData && app.globalData.homeDrawPosterShownInSession)
},
markDrawPosterShownInSession() {
const app = getApp && getApp()
if (!app) return
if (!app.globalData) {
app.globalData = {}
}
app.globalData.homeDrawPosterShownInSession = true
},
initPosterPopupState(data = {}) {
const drawEntranceConfig = data.drawEntranceConfig || {}
this.$set(this, 'drawEntranceConfig', drawEntranceConfig)
const hasDrawPoster = Number(drawEntranceConfig.homePosterEnable) === 1
const hasShownDrawPosterInSession = this.hasShownDrawPosterInSession()
const shouldShowDrawPoster = hasDrawPoster && !hasShownDrawPosterInSession
if (shouldShowDrawPoster) {
this.markDrawPosterShownInSession()
}
this.canShowOldPoster = Boolean(
(data.isOldUserPopupShow || 0) &&
data.oldUserPopup &&
data.oldUserPopup.image &&
(data.lotteryCanDraw || false)
)
this.isDrawPosterVisible = shouldShowDrawPoster
this.isOldUser = !shouldShowDrawPoster && !hasShownDrawPosterInSession && this.canShowOldPoster
},
showNextPoster() {
if (!this.isDrawPosterVisible && this.canShowOldPoster) {
this.isOldUser = true
}
},
closeDrawPoster() {
this.isDrawPosterVisible = false
this.showNextPoster()
},
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 goDrawLotteryPage() {
const config = this.drawEntranceConfig || {}
const linkType = Number(config.homePosterLinkType) || 1
const activityId = Number(config.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
}
const url = opened
? `/pkg-video/views/county-winners?activityId=${activityId}`
: `/pkg-video/views/county-lottery?linkType=${linkType}&activityId=${activityId}`
uni.navigateTo({
url
})
},
tapDrawPoster() {
this.isDrawPosterVisible = false
this.goDrawLotteryPage()
this.showNextPoster()
},
// 民宿专题
goHomeStay(item) {
if (item.type === 1) {
File diff suppressed because it is too large Load Diff
-454
View File
@@ -1,454 +0,0 @@
<template>
<view class="pkg-product-land-mark" v-if="mapData">
<view class="top-box" :style="{'backgroundColor':topBoxBgColor}">
<view class="view-box">
<view class="search-box flex ai-center">
<input
v-model="keyword"
type="text"
placeholder="搜索商品"
placeholder-style="color:#999"
@confirm="search()"
/>
<image
:src="webUrl+'/20231223183627184005.png'"
mode="scaleToFill"
style="width:30rpx;height:30rpx"
@click="search()"
/>
</view>
<view class="map-box">
<image class="img-map" :src="mapData.mapImage" mode="widthFix"/>
<view
v-for="(item, index) in mapLocations"
:key="index"
class="item"
:style="{'left':item.gx+'rpx','top':item.gy+'rpx'}"
@click="goGoods(item.productId)"
>
<view class="round">
<view class="line" :class="'line-'+directionClass[item.labelDirection]"></view>
</view>
<view class="label flex ai-end" :class="'label-'+directionClass[item.labelDirection]">
<image class="cover flex-0" :src="item.mapImage" mode="scaleToFill" v-if="item.labelDirection===4"/>
<view class="title flex ai-center">{{ item.mapTitle }}</view>
<image class="cover flex-0" :src="item.mapImage" mode="scaleToFill" v-if="item.labelDirection!==4"/>
</view>
</view>
</view>
</view>
<view class="nav flex">
<view class="flex flex-0 ai-center" :class="{'active': navIndex===index}" v-for="(item,index) in navList"
:key="index" @click="changeNav(index)">{{ item.provinceName }}
</view>
</view>
</view>
<view class="main-box" v-if="mapData.recommended.storeImage"
@click="goGoods(mapData.recommended.productId)">
<image class="bg-main" :src="mapData.recommended.storeImage" mode="scaleToFill"/>
<view class="box-mask flex flex-col jc-end">
<view class="one-t bold">{{ mapData.recommended.title }}</view>
<view class="more-t">{{ mapData.recommended.description }}</view>
</view>
</view>
<view class="list-box flex flex-wrap">
<view class="item" v-for="item in goods" :key="item.id" @click="goGoods(item.productId)">
<image :src="item.storeImage" mode="scaleToFill"/>
<view class="content flex flex-col jc-between">
<view class="more-t bold">{{ item.title }}</view>
<view class="flex jc-between ai-center">
<text class="price">{{ item.price }}</text>
<image class="btn" :src="webUrl+'/20231114151028082368.png'" mode="scaleToFill"/>
<!-- <view class="btn flex jc-center ai-center">立即购买</view>-->
</view>
</view>
</view>
</view>
<image class="img-nodata" :src="webUrl+'/20231023131208675588.png'" mode="scaleToFill"
v-if="goods.length===0"/>
</view>
</template>
<script>
import {getProvince, getProvinceGoods, getProvinceList} from "@/api/product";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default {
name: 'LandMarkPage',
mixins: [pageListenMixins],
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
keyword: '',
page: 1,
navList: [],
navIndex: 0,
mapData: null,
mapLocations: [],
goods: [],
directionClass: ['', 'up', 'right', 'down', 'left'],
pageKeyId: Object.freeze('landmarkGoodsIndex')
}
},
computed: {
topBoxBgColor() {
return this.navList.length > 0 ? this.navList[this.navIndex]['backgroundColor'] : '#FFFFFF';
},
viewBoxBgColor() {
return this.mapData?.backgroundColor || '#FFFFFF';
},
scale() {
return 718 / (this.mapData?.mapImageWidth || 1);
}
},
onLoad() {
this.getNavList();
},
onHide() {
this.pageToHideHandle()
},
onReachBottom() {
this.page++;
this.fetchGoods();
},
methods: {
getNavList() {
getProvinceList().then(({data}) => {
this.navList = data;
this.changeNav(this.navIndex);
});
},
search() {
this.page = 1;
this.fetchGoods();
},
changeNav(index) {
this.navIndex = index;
this.page = 1;
this.getMap();
this.fetchGoods();
},
getMap() {
const id = this.navList[this.navIndex]['id']
getProvince(id).then(({data}) => {
this.mapData = data;
this.mapLocations = data.mapLocations;
this.calcPosition();
});
},
// 计算位置
calcPosition() {
this.mapLocations?.forEach(item => {
item.gx = item.x * this.scale;
item.gy = item.y * this.scale;
})
},
fetchGoods() {
const id = this.navList[this.navIndex]['id']
getProvinceGoods(id, this.keyword, this.page).then(({data}) => {
if (this.page === 1) this.goods = [];
for (let i = 0; i < data.length; i++) {
this.goods.push(data[i]);
}
})
},
goGoods(id) {
uni.navigateTo({
url: `/pages/shop/GoodsCon/index?id=${id}&from=landmark`
})
}
}
}
</script>
<style scoped lang="less">
.pkg-product-land-mark {
background: #F7F3ED;
image {
vertical-align: middle;
}
.top-box {
padding: 32rpx 0 20rpx;
.view-box {
position: relative;
margin: 0 16rpx;
border-radius: 40rpx;
overflow: hidden;
.search-box {
position: absolute;
top: 20rpx;
left: 34rpx;
width: 650rpx;
height: 64rpx;
padding: 0 32rpx;
box-sizing: border-box;
border-radius: 32rpx;
background: #FFFFFF;
z-index: 10;
input {
width: 100%;
height: 100%;
line-height: 64rpx;
font-size: 28rpx;
}
}
.map-box {
position: relative;
width: 718rpx;
.img-map {
width: 718rpx;
height: auto;
}
.item {
position: absolute;
.round {
width: 8rpx;
height: 8rpx;
border-radius: 50%;
box-shadow: 0 0 0 8rpx rgba(225, 38, 65, .4);;
background: #E12641;
}
.line {
position: relative;
border: 2rpx solid #E12641;
}
.line-up {
left: 50%;
transform: translate(-50%, -100%);
width: 0;
height: 30rpx;
}
.line-right {
top: 50%;
transform: translate(0, -50%);
width: 30rpx;
height: 0;
}
.line-down {
left: 50%;
transform: translate(-50%, 0);
width: 0;
height: 30rpx;
}
.line-left {
top: 50%;
transform: translate(-100%, -50%);
width: 30rpx;
height: 0;
}
.label {
position: relative;
.cover {
width: 60rpx;
height: 60rpx;
box-sizing: border-box;
border: 6rpx solid #E12641;
border-radius: 50%;
z-index: 20;
}
.title {
height: 32rpx;
box-sizing: border-box;
margin-bottom: 10rpx;
padding: 0 16rpx;
background: #E12641;
color: #FFFFFF;
font-size: 22rpx;
line-height: 32rpx;
white-space: nowrap;
z-index: 10;
}
}
.label-up {
top: -80rpx;
left: -50%;
.title {
margin-right: -9rpx;
border-radius: 20rpx 0 0 20rpx;
}
}
.label-right {
top: -40rpx;
left: 32rpx;
.title {
margin-right: -9rpx;
border-radius: 20rpx 0 0 20rpx;
}
}
.label-down {
left: -50%;
.title {
margin-right: -9rpx;
border-radius: 20rpx 0 0 20rpx;
}
}
.label-left {
left: -100%;
transform: translate(-30rpx, -40rpx);
.title {
margin-left: -9rpx;
border-radius: 0 20rpx 20rpx 0;
}
}
}
}
}
.nav {
padding: 30rpx 20rpx 0;
overflow-x: scroll;
view {
height: 52rpx;
box-sizing: border-box;
padding: 0 18rpx;
border: 4rpx solid transparent;
color: #FFFFFF;
font-size: 32rpx;
}
.active {
border-color: #FFFFFF;
border-radius: 26rpx;
}
}
}
.main-box {
position: relative;
width: 718rpx;
height: 360rpx;
margin: 24rpx 16rpx;
border-radius: 16rpx;
overflow: hidden;
.bg-main {
width: 718rpx;
height: 360rpx;
}
.box-mask {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 200rpx;
box-sizing: border-box;
padding: 20rpx 16rpx 16rpx;
background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000000 100%);
color: #FFFFFF;
.one-t {
margin-bottom: 16rpx;
font-size: 46rpx;
line-height: 52rpx;
}
.more-t {
width: 100%;
box-sizing: border-box;
padding-top: 10rpx;
border-top: 1rpx solid #FFFFFF;
font-size: 28rpx;
line-height: 32rpx;
}
}
}
.list-box {
margin-top: 24rpx;
padding: 0 16rpx 34rpx;
.item {
width: 234rpx;
height: 380rpx;
margin-right: 8rpx;
margin-bottom: 24rpx;
border-radius: 12rpx;
background: #FFFFFF;
overflow: hidden;
image {
width: 234rpx;
height: 234rpx;
}
.content {
height: 122rpx;
margin: 6rpx 6rpx 18rpx;
.more-t {
font-size: 28rpx;
line-height: 36rpx;
color: #333333;
}
.price {
font-size: 28rpx;
line-height: 36rpx;
color: #DC1616;
}
.btn {
width: 118rpx;
height: 42rpx;
//background: linear-gradient(180deg, #EFEDC7 0%, #EAC94B 100%);
//border-radius: 4rpx;
//color: #764A00;
//font-size: 24rpx;
}
}
}
.item:nth-child(3n) {
margin-right: 0;
}
}
.img-nodata {
position: relative;
top: 0;
left: 50%;
transform: translate(-50%, 0);
width: 352rpx;
height: 338rpx;
margin-bottom: 60rpx;
}
}
</style>
+164 -20
View File
@@ -120,7 +120,7 @@
<text v-if="order.bargainId > 0">砍价</text>
<text v-if="order.storeId > 0">门店</text>
</text>
订单号:{{ order.orderId }}
{{ order.isDrawOrder === 1 ? '奖品订单号' : '订单号' }}:{{ order.orderId }}
</view>
<view
v-if="order.isTickets === 1 && parseInt(order._status._type) === 1"
@@ -186,6 +186,64 @@
</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"
@@ -237,7 +295,7 @@
</view>
</view>
</view>
<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.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.createTime">
<span class="orderTime v12-font-24 v12-dark1-text">{{ order.createTime }}</span>
</view>
@@ -293,8 +351,9 @@
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"
v-if="[2, 3].includes(parseInt(order._status._type)) && order.isTickets === 0 && order.isDrawOrder === 0"
class="group-btn"
>
<text
@@ -308,7 +367,7 @@
@click="goRoom(order)"
>联系商家</view>
<view
v-if="order.isTravelGroup === 0"
v-if="order.isTravelGroup === 0 && order.refundSystemStatus !== 2"
class="btn flex jc-center ai-center v12-font-24"
@click="goRefund(order)"
>申请退款</view>
@@ -316,6 +375,12 @@
</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 &&
@@ -340,6 +405,7 @@
>删除订单</view>
</view>
</view>
</template>
<view class="flex">
<template v-if="parseInt(order._status._type) === 0">
@@ -348,7 +414,7 @@
@click="cancelOrder(order)"
>取消订单</view>
<view
v-if="order.isTravelGroup === 0"
v-if="order.isTravelGroup === 0 && order.isDrawOrder === 0"
class="bnt cancelBnt v12-dark-text v12-dark-border"
@click="addressTap(order)"
>修改地址</view>
@@ -369,7 +435,7 @@
@click="applyRefund(order)"
>{{ '申请退款' }}</view>
<view
v-if="canShowModifyAddress(order)"
v-if="canShowModifyAddress(order) && order.isDrawOrder === 0"
class="bnt service"
@click="addressTap(order)"
>修改地址</view>
@@ -404,7 +470,7 @@
</template>
<template v-if="parseInt(order._status._type) === 2 && order.isTickets === 0 && order.isTravelGroup === 0">
<view
v-if="order.isExtendedDelivery === 0"
v-if="order.isExtendedDelivery === 0 && order.isDrawOrder === 0"
class="bnt default"
@click="toDelay(order.orderId)"
>延长收货
@@ -536,6 +602,40 @@
@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>
@@ -559,10 +659,12 @@ 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],
mixins: [pageListenMixins, orderPaySuccessToCheckDrawStatus],
data() {
return {
giftItem: {},
@@ -950,9 +1052,14 @@ export default {
})
},
async toYuePay(payPwd) {
const that = this;
//网络请求
await yuePayOrderHandle(this.orderInfo.orderId, "yue", that.from, payPwd);
const that = this
const orderId = this.orderInfo.orderId
// 网络请求
await yuePayOrderHandle(orderId, "yue", that.from, payPwd).then(() => {
this.afterPaySuccess(orderId, (drawTicketResult) => {
this.setDrawTicketPopupFromQuery(drawTicketResult)
})
});
that.changeType();
this.payPassword = "";
},
@@ -967,11 +1074,7 @@ export default {
subscribePay(order) {
this.orderInfo = order
uni.requestSubscribeMessage({
tmplIds: [
'7O3wKw7_D4t7yfSOlvecKuOQP8QEPY88uBx2FJg43HE',
'TSmTnGibZ8IxWCiRWOvLxha6-0u7tE-V1-WbDCiPkKU',
'9Q6xLHe6HyjkU5Zn5k_2zxYPf2y4MxVyUbOSW8pcZRU'
],
tmplIds: settings.SubscribeMessageTmplIds,
complete: () => this.pay = true
})
},
@@ -993,6 +1096,19 @@ 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) {
@@ -1051,7 +1167,7 @@ export default {
},
goLogistics(order) {
this.$yrouter.push({
path: "/pages/order/Logistics/index",
path: "/pagesOrder/order/Logistics/index",
query: {
id: order.orderId
}
@@ -1078,7 +1194,7 @@ export default {
return
}
this.$yrouter.push({
path: "/pages/order/OrderDetails/index",
path: "/pagesOrder/order/OrderDetails/index",
query: {
id: order.orderId,
isGift: order.isGiftCardSend ? 1 : ''
@@ -1303,13 +1419,17 @@ export default {
}
},
toPay(type) {
const that = this
// 余额支付需要输入支付密码
if (type == "yue") {
this.isShowPayPwdPop = true
return
} else {
payOrderHandle(this.orderInfo.orderId, type, that.from)
const orderId = this.orderInfo.orderId
payOrderHandle(orderId, type, this.from).then(() => {
this.afterPaySuccess(orderId, (drawTicketResult) => {
this.setDrawTicketPopupFromQuery(drawTicketResult)
})
})
}
},
toDelay(id) {
@@ -1543,4 +1663,28 @@ 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
+47 -28
View File
@@ -328,7 +328,10 @@ 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()
@@ -342,7 +345,7 @@ export default {
passkeyborad,
CouponsPopup
},
mixins: [pageListenMixins],
mixins: [pageListenMixins, orderPaySuccessToCheckDrawStatus],
props: {},
data: function () {
return {
@@ -456,7 +459,7 @@ export default {
showStoreList() {
this.$store.commit("get_to", "orders")
this.$yrouter.push({
path: "/pages/shop/StoreList/index"
path: "/pagesShop/shop/StoreList/index"
})
},
force2Decimal(value) {
@@ -485,7 +488,7 @@ export default {
const data = res.data;
if (data.status === "EXTEND_ORDER") {
this.$yrouter.replace({
path: "/pages/order/OrderDetails/index",
path: "/pagesOrder/order/OrderDetails/index",
query: {
id: data.result.orderId
}
@@ -600,11 +603,7 @@ export default {
},
subscribePay() {
uni.requestSubscribeMessage({
tmplIds: [
'7O3wKw7_D4t7yfSOlvecKuOQP8QEPY88uBx2FJg43HE',
'TSmTnGibZ8IxWCiRWOvLxha6-0u7tE-V1-WbDCiPkKU',
'9Q6xLHe6HyjkU5Zn5k_2zxYPf2y4MxVyUbOSW8pcZRU'
],
tmplIds: settings.SubscribeMessageTmplIds,
complete: () => this.createOrder(false)
})
},
@@ -707,6 +706,7 @@ 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: "/pages/order/OrderDetails/index",
path: "/pagesOrder/order/OrderDetails/index",
query: {
id: data.result.orderId
id: orderId
}
})
break;
@@ -743,21 +743,21 @@ export default {
icon: "none",
duration: 2000
})
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
}
})
}
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
}
})
}
})
break;
case "WECHAT_H5_PAY":
// H5支付
@@ -770,7 +770,16 @@ export default {
break;
case "WECHAT_PAY":
// 小程序支付
weappPay(data.result.jsConfig).finally(() => {
weappPay(data.result.jsConfig).then(() => {
this.afterPaySuccess(orderId, () => {
this.$yrouter.replace({
path: "/pages/order/MyOrder/index",
query: {
type: 1
}
})
})
}).catch(() => {
this.$yrouter.replace({
path: "/pages/order/MyOrder/index",
query: {
@@ -781,13 +790,22 @@ export default {
break;
case "WECHAT_APP_PAY":
// APP支付
weappPay(data.result.jsConfig).finally(() => {
weappPay(data.result.jsConfig).then(() => {
this.afterPaySuccess(orderId, () => {
this.$yrouter.replace({
path: "/pages/order/MyOrder/index",
query: {
type: 1
}
})
})
}).catch(() => {
this.$yrouter.replace({
path: "/pages/order/MyOrder/index",
query: {
type: 1
}
});
})
})
break;
}
@@ -1007,4 +1025,5 @@ export default {
padding: 20rpx 0 0 0;
color: #999;
}
</style>
-34
View File
@@ -1,34 +0,0 @@
<template>
<view class="payment-status">
<!--失败时 用icon-iconfontguanbi fail替换icon-duihao2 bg-color-red-->
<view class="iconfont icon-duihao2 bg-color-red"></view>
<!-- 失败时订单支付失败 -->
<view class="status">订单支付成功</view>
<view class="wrapper">
<view class="item acea-row row-between-wrapper">
<view>订单编号</view>
<view class="itemCom">wx3265361456134568</view>
</view>
<view class="item acea-row row-between-wrapper">
<view>下单时间</view>
<view class="itemCom">2019-01-09 18:05</view>
</view>
<view class="item acea-row row-between-wrapper">
<view>支付方式</view>
<view class="itemCom">微信支付</view>
</view>
<view class="item acea-row row-between-wrapper">
<view>支付金额</view>
<view class="itemCom">2222.00</view>
</view>
<!--失败时加上这个 -->
<!--<view class='item acea-row row-between-wrapper'>-->
<!--<view>失败原因</view>-->
<!--<view class='itemCom'>账户余额不足</view>-->
<!--</view>-->
</view>
<!--失败时 重新购买 -->
<view class="returnBnt bg-color-red">返回查看订单</view>
<view class="returnBnt cart-color">返回首页</view>
</view>
</template>
+15 -3
View File
@@ -1070,12 +1070,12 @@ export default {
},
goStoreList() {
this.$yrouter.push({
path: '/pages/shop/StoreList/index'
path: '/pagesShop/shop/StoreList/index'
})
},
goEvaluateList(id) {
this.$yrouter.push({
path: '/pages/shop/EvaluateList/index',
path: '/pagesShop/shop/EvaluateList/index',
query: {
id
}
@@ -1495,6 +1495,9 @@ 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
@@ -1511,9 +1514,17 @@ 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: '/pkg_user/views/gift/gift?cartId=' + res.data.cartId + (that.storeInfo.discount ? '&discount=' + that.storeInfo.discount : '')
url: giftUrl
})
}
if(news === 0) {
@@ -2102,6 +2113,7 @@ export default {
.product-con .footer{
height: 140rpx !important;
padding-bottom: 20rpx;
z-index: 1002 !important;
}
.product-con .product-intro .conter view {
width: 100% !important;
+41 -7
View File
@@ -86,7 +86,7 @@
</view>
</view>
<view class="my-hdeader-bottom">
<view class="item" @click="linkTo('/pages/user/UserBill/index')">
<view class="item" @click="linkTo('/pagesUser/user/UserBill/index')">
<view v-if="!isNoLogin" class="number">
{{ userInfo.nowMoney ? force2Decimal(userInfo.nowMoney) : 0.00 }}
</view>
@@ -98,7 +98,7 @@
余额
</view>
</view>
<view class="item" @click="linkTo('/pages/user/Points/index')">
<view class="item" @click="linkTo('/pagesUser/user/Points/index')">
<view v-if="!isNoLogin" class="number">
{{ userInfo.integral || 0 }}
</view>
@@ -215,6 +215,13 @@
</view>
</view>
</view>
<view
v-if="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">
@@ -301,6 +308,7 @@ 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'
@@ -364,7 +372,7 @@ export default {
},
{
text: '账户明细',
url: '/pages/user/UserBill/index',
url: '/pagesUser/user/UserBill/index',
icon: '/icon/icon-coin.png',
allowEnter: true
},
@@ -376,19 +384,23 @@ export default {
},
{
text: '团队管理',
url: '/pages/user/promotion/UserPromotion/index',
url: '/pagesUser/user/promotion/UserPromotion/index',
icon: '/icon/icon-users.png',
allowEnter: true
},
{
text: '商品足迹',
url: '/pages/user/History/index',
url: '/pagesUser/user/History/index',
icon: '/icon/icon-help.png',
allowEnter: true
}
],
bannerBgUrl: '',
userCenterBannerUrl: '',
drawConfig: {
myTicketImage: '',
myTicketImageEnable: 0
},
pageKeyId: Object.freeze('userIndex'),
nowrap: true,
// 是否已登录
@@ -403,6 +415,7 @@ export default {
},
onShow() {
uni.$emit('updateUnreadMessageCount')
this.getDrawConfigReq()
if (this.$store.getters.token) {
this.isNoLogin = false
uni.showLoading({
@@ -429,6 +442,19 @@ 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(() => {
@@ -486,7 +512,7 @@ export default {
}
},
goReturnList() {
this.$yrouter.push('/pages/order/ReturnList/index')
this.$yrouter.push('/pagesOrder/order/ReturnList/index')
},
goMyOrder(type) {
if (this.isNoLogin) {
@@ -509,7 +535,7 @@ export default {
},
goUserAccount() {
this.$yrouter.push({
path: '/pages/user/UserAccount/index'
path: '/pagesUser/user/UserAccount/index'
})
},
goPersonalData() {
@@ -681,6 +707,14 @@ 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
File diff suppressed because it is too large Load Diff
@@ -76,7 +76,7 @@ export default {
},
goOrderDetails(order) {
this.$yrouter.push({
path: "/pages/order/OrderDetails/index",
path: "/pagesOrder/order/OrderDetails/index",
query: {id: order.orderId}
});
},
@@ -39,6 +39,9 @@
: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"
@@ -179,6 +182,13 @@ 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: {
@@ -186,6 +196,11 @@ export default {
}
})
},
isInvalidItem(item) {
if (!item) return false
if (item.isInvalid === true || item.isInvalid === 'true') return true
return Number(item.isInvalid) === 1
},
deleteHistoryItem(historyItem) {
const id = historyItem.id
if (!id) return
@@ -276,6 +291,26 @@ 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,13 +97,7 @@ export default {
methods: {
dataFormat,
toDetail(mid){
this.$yrouter.push('/pages/user/MessageDetail/MessageDetail?id='+mid);
// this.$yrouter.push({
// path: "/pages/user/MessageDetail/MessageDetail",
// query: {
// id:mid
// }
// });
this.$yrouter.push('/pagesUser/user/MessageDetail/MessageDetail?id='+mid);
}
},
onLoad:function(e){
@@ -198,7 +198,7 @@ export default {
},
goOrderDetails(order) {
this.$yrouter.push({
path: '/pages/order/OrderDetails/index',
path: '/pagesOrder/order/OrderDetails/index',
query: {
id: order.orderId
}
@@ -129,7 +129,7 @@ export default {
//
toggleProtocolPage() {
//this.$refs.popup.open();
this.$yrouter.push('/pages/user/UpgradeProtocolDetail/UpgradeProtocolDetail')
this.$yrouter.push('/pagesUser/user/UpgradeProtocolDetail/UpgradeProtocolDetail')
},
chooseIdCardFrontImage() {
@@ -8,7 +8,7 @@
<view style="color: #fff;">总资产()</view>
<view class="money">{{ now_money }}</view>
</view>
<!-- <navigator url="/pages/user/Recharge/index" class="recharge font-color-red">充值</navigator> -->
<!-- <navigator url="/pagesUser/user/Recharge/index" class="recharge font-color-red">充值</navigator> -->
</view>
<view class="cumulative acea-row row-top">
<view class="item">
@@ -66,7 +66,7 @@ export default {
methods: {
goUserBill(types) {
this.$yrouter.push({
path: "/pages/user/UserBill/index",
path: "/pagesUser/user/UserBill/index",
query: { types }
});
},
@@ -25,8 +25,7 @@ export default {
},
methods: {
goUserPromotion() {
this.$yrouter.back();
// this.$yrouter.push({ path: "/pages/user/promotion/UserPromotion/index" });
this.$yrouter.back();
}
}
};
@@ -127,19 +127,19 @@ export default {
return this.$force2Decimal(v);
},
goPoster() {
this.$yrouter.push("/pages/user/promotion/Poster/index");
this.$yrouter.push("/pagesUser/user/promotion/Poster/index");
},
goCashRecord() {
this.$yrouter.push('/pkg_user/views/withdrawalLog');
},
goPromoterList() {
this.$yrouter.push("/pages/user/promotion/PromoterList/index");
this.$yrouter.push("/pagesUser/user/promotion/PromoterList/index");
},
goCommissionDetails() {
this.$yrouter.push("/pages/user/promotion/CommissionDetails/index");
this.$yrouter.push("/pagesUser/user/promotion/CommissionDetails/index");
},
goPromoterOrder() {
this.$yrouter.push("/pages/user/promotion/PromoterOrder/index");
this.$yrouter.push("/pagesUser/user/promotion/PromoterOrder/index");
},
getInfo: function() {
let that = this;
-924
View File
@@ -1,924 +0,0 @@
{
"easycom": {
"^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue"
},
"pages": [
{
"path": "pages/Loading/index",
"style": {
"navigationBarTitleText": "香道滇",
"navigationStyle": "custom"
}
},
{
"path": "pages/authorization/index",
"style": {
"navigationBarTitleText": "微信授权"
}
},
{
"path": "pages/user/Login/index",
"style": {
"navigationBarTitleText": "登录"
}
},
{
"path": "pages/user/RetrievePassword/index",
"style": {
"navigationBarTitleText": "重置密码"
}
},
{
"path": "pages/home/index",
"style": {
"navigationBarTitleText": "香道滇",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
{
"path": "components/chose-city/chose-city",
"style": {
"navigationBarTitleText": "选择城市"
}
},
{
"path": "pages/foodInfomation/information",
"style": {
"navigationBarTitleText": "彩云资讯"
}
},
{
"path": "pages/foodInfomation/foodInfomation",
"style": {
"navigationBarTitleText": "美食攻略",
"navigationStyle": "custom",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true
}
},
{
"path": "pages/foodInfomation/foodInfomationDetail",
"style": {
"navigationBarTitleText": "资讯详情",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "pages/shop/GoodSearch/index",
"style": {
"navigationBarTitleText": "搜索商品"
}
},
{
"path": "pages/shop/GoodsClass/index",
"style": {
"navigationBarTitleText": "分类",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/shop/ShoppingCart/index",
"style": {
"navigationBarTitleText": "购物车",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/shop/StoreList/index",
"style": {
"navigationBarTitleText": "商家列表"
}
},
{
"path": "pages/shop/GoodsList/index",
"style": {
"navigationBarTitleText": "商品列表"
}
},
{
"path": "pages/NotDefined/index",
"style": {
"navigationBarTitleText": "404"
}
},
// {
// "path": "pages/cloud/cloud",
// "style": {
// "navigationBarTitleText": "七彩云上"
// }
// },
{
"path": "pages/cloud/haveFun",
"style": {
"navigationBarTitleText": "寻趣味",
"navigationStyle": "custom"
}
},
{
"path": "pages/user/User/index",
"style": {
"navigationBarTitleText": "我的",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/shop/GoodsCollection/index",
"style": {
"navigationBarTitleText": "商品收藏"
}
},
{
"path": "pages/shop/EvaluateList/index",
"style": {
"navigationBarTitleText": "评价列表"
}
},
{
"path": "pages/shop/GoodsEvaluate/index",
"style": {
"navigationBarTitleText": "商品评价"
}
},
{
"path": "pages/shop/GoodsPromotion/index",
"style": {
"navigationBarTitleText": "促销商品"
}
},
{
"path": "pages/shop/HotNewGoods/index",
"style": {
"navigationBarTitleText": "热门商品"
}
},
{
"path": "pages/shop/GoodsCon/index",
"style": {
"navigationBarTitleText": "商品详情",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/user/address/AddAddress/index",
"style": {
"navigationBarTitleText": "新增收货地址"
}
},
{
"path": "pages/user/UserAccount/index",
"style": {
"navigationBarTitleText": "账户余额"
}
},
{
"path": "pages/user/address/AddressManagement/index",
"style": {
"navigationBarTitleText": "收货地址"
}
},
{
"path": "pages/user/promotion/Poster/index",
"style": {
"navigationBarTitleText": "推广名片"
}
},
{
"path": "pages/user/signIn/Sign/index",
"style": {
"navigationBarTitleText": "签到"
}
},
{
"path": "pages/user/signIn/SignRecord/index",
"style": {
"navigationBarTitleText": "签到记录"
}
},
{
"path": "pages/user/promotion/CashAudit/index",
"style": {
"navigationBarTitleText": "提现结果"
}
},
{
"path": "pages/user/promotion/PromoterOrder/index",
"style": {
"navigationBarTitleText": "分销详情"
}
},
{
"path": "pages/user/promotion/PromoterList/index",
"style": {
"navigationBarTitleText": "分销列表",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "pages/user/promotion/UserPromotion/index",
"style": {
"navigationBarTitleText": "团队管理",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "pages/user/UserBill/index",
"style": {
"navigationBarTitleText": "账单记录"
}
},
{
"path": "pages/user/promotion/CashRecord/index",
"style": {
"navigationBarTitleText": "提现记录"
}
},
{
"path": "pages/user/promotion/CommissionDetails/index",
"style": {
"navigationBarTitleText": "佣金明细"
}
},
{
"path": "pages/user/signIn/Integral/index",
"style": {
"navigationBarTitleText": "我的积分"
}
},
{
"path": "pages/user/UserVip/index",
"style": {
"navigationBarTitleText": "用户vip"
}
},
{
"path": "pages/user/coupon/UserCoupon/index",
"style": {
"navigationBarTitleText": "优惠券"
}
},
{
"path": "pages/user/coupon/GetCoupon/index",
"style": {
"navigationBarTitleText": "领取优惠券"
}
},
{
"path": "pages/user/promotion/UserCash/index",
"style": {
"navigationBarTitleText": "提现"
}
},
{
"path": "pages/user/CustomerList/index",
"style": {
"navigationBarTitleText": "客服列表"
}
},
{
"path": "pages/user/Recharge/index",
"style": {
"navigationBarTitleText": "充值"
}
},
{
"path": "pages/order/MyOrder/index",
"style": {
"navigationBarTitleText": "我的订单",
"navigationBarBackgroundColor": "#fff"
}
},
{
"path": "pages/order/Logistics/index",
"style": {
"navigationBarTitleText": "查看物流"
}
},
{
"path": "pages/order/OrderDetails/index",
"style": {
"navigationBarTitleText": "订单详情"
}
},
{
"path": "pages/order/OrderSubmission/index",
"style": {
"navigationBarTitleText": "提交订单",
"navigationBarBackgroundColor": "#fff"
}
},
{
"path": "pages/order/PaymentStatus/index",
"style": {
"navigationBarTitleText": "支付状态"
}
},
{
"path": "pages/order/GoodsReturn/index",
"style": {
"navigationBarTitleText": "商品退货"
}
},
{
"path": "pages/order/ReturnList/index",
"style": {
"navigationBarTitleText": "退货列表"
}
},
{
"path": "pages/orderAdmin/OrderIndex/index",
"style": {
"navigationBarTitleText": "商家订单统计"
}
},
{
"path": "pages/orderAdmin/AdminOrderList/index",
"style": {
"navigationBarTitleText": "订单"
}
},
{
"path": "pages/orderAdmin/GoodsDeliver/index",
"style": {
"navigationBarTitleText": "发货"
}
},
{
"path": "pages/orderAdmin/AdminOrder/index",
"style": {
"navigationBarTitleText": "商家订单列表"
}
},
{
"path": "pages/orderAdmin/Statistics/index",
"style": {
"navigationBarTitleText": "商家统计数据"
}
},
{
"path": "pages/orderAdmin/OrderCancellation/index",
"style": {
"navigationBarTitleText": "商家取消订单"
}
},
{
"path": "pages/activity/Poster/index",
"style": {
"navigationBarTitleText": "推广海报"
}
},
{
"path": "pages/activity/DargainDetails/index",
"style": {
"navigationBarTitleText": "帮砍价"
}
},
{
"path": "pages/activity/GoodsBargain/index",
"style": {
"navigationBarTitleText": "砍价列表"
}
},
{
"path": "pages/activity/BargainRecord/index",
"style": {
"navigationBarTitleText": "砍价记录"
}
},
{
"path": "pages/activity/GoodsGroup/index",
"style": {
"navigationBarTitleText": "团购商品列表"
}
},
{
"path": "pages/activity/GroupDetails/index",
"style": {
"navigationBarTitleText": "团购商品详情"
}
},
{
"path": "pages/activity/GroupRule/index",
"style": {
"navigationBarTitleText": "团购规则"
}
},
{
"path": "pages/activity/GoodsSeckill/index",
"style": {
"navigationBarTitleText": "秒杀"
}
},
{
"path": "pages/activity/SeckillDetails/index",
"style": {
"navigationBarTitleText": "秒杀详情"
}
},
{
"path": "pages/map/index",
"style": {
"navigationBarTitleText": "地图"
}
},
{
"path": "pages/user/Message/Message",
"style": {
"navigationBarTitleText": "消息",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "pages/user/MessageDetail/MessageDetail",
"style": {
"navigationBarTitleText": "消息详情",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "pages/user/MemberUpgradeIntro/MemberUpgradeIntro",
"style": {
"navigationBarTitleText": "升级说明",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "pages/VideoPlayBackList/VideoPlayBackList",
"style": {
"navigationBarTitleText": "寻看点",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "pages/VideoPlayBackList/VideoPlayBackDetail",
"style": {
"navigationBarTitleText": "视频详情",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "pages/user/UpgradeElectronicProtocol/UpgradeElectronicProtocol",
"style": {
"navigationBarTitleText": "升级",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "pages/user/UpgradeProtocolDetail/UpgradeProtocolDetail",
"style": {
"navigationBarTitleText": "共享股东协议"
}
},
{
"path": "pages/LiveAndShortVideo/LiveAndShortVideo",
"style": {
"navigationBarTitleText": "直播/视频"
}
},
{
"path": "pages/LiveBroadcastList/LiveBroadcastList",
"style": {
"navigationBarTitleText": "直播列表"
}
},
{
"path": "pages/user/UserFavorite/UserFavorite",
"style": {
"navigationBarTitleText": "我的喜欢"
}
}
],
"subPackages": [
{
"root": "pagesInn",
"pages": [
{
"path": "inn/innHome",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "inn/innApply",
"style": {
"navigationBarTitleText": "店铺申请"
}
},
{
"path": "inn/innInfoPublish",
"style": {
"navigationBarTitleText": "发布店铺动态"
}
},
{
"path": "inn/innProfileEdit",
"style": {
"navigationBarTitleText": "修改店铺资料"
}
},
{
"path": "inn/innInfoDetail",
"style": {
"navigationBarTitleText": "资讯详情"
}
},
{
"path": "inn/innPartnerAgreement",
"style": {
"navigationBarTitleText": "店主合伙人条款协议"
}
}
]
},
{
"root": "pkg_common",
"pages": [
{
"path": "views/pdf",
"style": {
"navigationBarTitleText": "详情"
}
},
{
"path": "views/room",
"style": {
"navigationBarTitleText": "客服"
}
},
{
"path": "views/roomLogs",
"style": {
"navigationBarTitleText": "历史会话"
}
},
{
"path": "views/xiaoZhi",
"style": {
"navigationBarTitleText": ""
}
}
]
},
{
"root": "pkg_join",
"pages": [
{
"path": "views/index",
"style": {
"navigationBarTitleText": "商户入驻"
}
},
{
"path": "views/shop",
"style": {
"navigationBarTitleText": "店铺入驻"
}
},
{
"path": "views/supplier",
"style": {
"navigationBarTitleText": "供应商入驻"
}
},
{
"path": "views/wholesaler",
"style": {
"navigationBarTitleText": "采购批发商入驻"
}
}
]
},
{
"root": "pkg_orders",
"pages": [
{
"path": "views/refund",
"style": {
"navigationBarTitleText": "申请退款"
}
}
]
},
{
"root": "pkg_product",
"pages": [
{
"path": "views/healthList",
"style": {
"navigationBarTitleText": "康养 · 食材"
}
},
{
"path": "views/giftList",
"style": {
"navigationBarTitleText": "特色礼品",
"onReachBottomDistance": 100
}
},
{
"path": "views/landMark",
"style": {
"navigationBarTitleText": "地标好物"
}
},
{
"path": "views/famousList",
"style": {
"navigationBarTitleText": "千县名品"
}
},
{
"path": "views/famousStory",
"style": {
"navigationBarTitleText": "名品故事"
}
},
{
"path": "views/famousHot",
"style": {
"navigationBarTitleText": "爆款主推"
}
},
{
"path": "views/scenicSpot",
"style": {
"navigationBarTitleText": "景点门票"
}
},
{
"path": "views/seckill",
"style": {
"navigationBarTitleText": "天天秒杀"
}
},
{
"path": "views/sharpList",
"style": {
"navigationBarTitleText": "尖货推荐"
}
},
{
"path": "views/nativeList",
"style": {
"navigationBarTitleText": "特产",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#FF564A"
}
},
{
"path": "views/seasonList",
"style": {
"navigationBarTitleText": "时令尝鲜"
}
},
{
"path": "views/season",
"style": {
"navigationBarTitleText": "时令尝鲜"
}
}
]
},
{
"root": "pkg_user",
"pages": [
{
"path": "views/bankCardList",
"style": {
"navigationBarTitleText": "银行卡列表",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "views/addBankCard",
"style": {
"navigationBarTitleText": "添加银行卡",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "views/withdrawal",
"style": {
"navigationBarTitleText": "提现",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "views/personalData",
"style": {
"navigationBarTitleText": "个人资料"
}
},
{
"path": "views/bindPhone",
"style": {
"navigationBarTitleText": "绑定手机号"
}
},
{
"path": "views/payPassword",
"style": {
"navigationBarTitleText": "修改支付密码"
}
}
]
},
{
"root": "v4",
"pages": [
{
"path": "views/preSale/preSale",
"style": {
"navigationBarTitleText": "预售"
}
},
{
"path": "views/seckill/seckill",
"style": {
"navigationBarTitleText": "限时秒杀"
}
},
{
"path": "views/offer/offer",
"style": {
"navigationBarTitleText": "每天特价"
}
},
{
"path": "components/select-city",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "views/specialty/specialty",
"style": {
"navigationBarTitleText": "特产",
"enablePullDownRefresh": true
}
},
{
"path": "views/shop/shop",
"style": {
"navigationBarTitleText": "店铺"
}
},
{
"path": "views/shop/detail",
"style": {
"navigationBarTitleText": "店铺详情"
}
},
{
"path": "views/trial/trial",
"style": {
"navigationBarTitleText": "体验店"
}
},
{
"path": "views/live/live",
"style": {
"navigationBarTitleText": "直播"
}
},
{
"path": "views/attract/attract",
"style": {
"navigationBarTitleText": "招商"
}
},
{
"path": "views/attract/project",
"style": {
"navigationBarTitleText": "招商项目"
}
},
{
"path": "views/attract/projectList",
"style": {
"navigationBarTitleText": "招商项目"
}
},
{
"path": "views/luck/luck",
"style": {
"navigationBarTitleText": "幸运抽奖"
}
},
{
"path": "views/luck/logs",
"style": {
"navigationBarTitleText": "抽奖记录"
}
},
{
"path": "views/luck/receive",
"style": {
"navigationBarTitleText": "选择收货地址"
}
}
]
},
{
"root": "wenwan",
"pages": [
{
"path": "views/goodsClass",
"style": {
"navigationBarTitleText": "文玩"
}
},
{
"path": "views/store",
"style": {
"navigationBarTitleText": "文玩店铺详情",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
{
"path": "views/storeList",
"style": {
"navigationBarTitleText": "文玩"
}
}
]
}
],
"preloadRule": {
"pages/user/User/index": {
"network": "all",
"packages": [
"pagesInn"
]
}
},
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"tabBar": {
"color": "#8B8F99",
"selectedColor": "#FF564A",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/home/index",
"iconPath": "static/tabbar/icon-home.png",
"selectedIconPath": "static/tabbar/icon-home-hot.png",
"text": "首页"
},
{
"pagePath": "pages/shop/ShoppingCart/index",
"iconPath": "static/tabbar/icon-cart.png",
"selectedIconPath": "static/tabbar/icon-cart-hot.png",
"text": "购物车"
},
{
"pagePath": "pages/cloud/haveFun",
"iconPath": "static/tabbar/icon-cloud.png",
"selectedIconPath": "static/tabbar/icon-cloud-hot.png",
"text": "寻趣味"
},
{
"pagePath": "pages/user/User/index",
"iconPath": "static/tabbar/icon-user.png",
"selectedIconPath": "static/tabbar/icon-user-hot.png",
"text": "我的"
}
]
},
"condition": {
"current": 0,
"list": [
{
"name": "商品详情",
"path": "pages/shop/GoodsCon/index",
"query": "id=369"
},
{
"name": "DEBUG",
"path": "pages/shop/ShoppingCart/index",
"query": "id=297"
},
{
"name": "No.8",
"path": "pages/shop/GoodsEvaluate/index",
"query": "id=eb30f8a98b1c4952addbdccb1d37533d"
},
{
"name": "时令尝鲜",
"path": "pkg_product/views/season",
"query": "id=20"
}
]
}
}
File diff suppressed because it is too large Load Diff
+812
View File
@@ -0,0 +1,812 @@
<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: 38rpx;
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>
+171
View File
@@ -0,0 +1,171 @@
<template>
<view class="county-lottery-rules-page">
<!-- <view class="custom-header" :style="{ paddingTop: `${statusBarHeight}px` }">
<view class="header-inner">
<view class="header-back" @click="goBack">
<u-icon name="arrow-left" size="24" color="#333" class="header-back-icon"></u-icon>
</view>
<view class="header-title">活动规则</view>
<view class="header-right">
</view>
</view>
</view> -->
<view class="page-body" >
<view class="rule-card">
<view class="rule-content">
<rich-text v-if="ruleContent" :nodes="ruleContent" />
<view class="state-text" v-else>{{ loading ? '规则加载中...' : '暂无活动规则' }}</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { getDrawRuleConfig } from '@/api/lottery'
export default {
name: 'CountyLotteryRulesPage',
data() {
return {
statusBarHeight: 20,
loading: true,
ruleContent: ''
}
},
onLoad() {
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 20
this.fetchRuleConfig()
},
methods: {
fetchRuleConfig() {
this.loading = true
getDrawRuleConfig().then(res => {
const data = res.data || {}
this.ruleContent = data.ruleContent || ''
}).finally(() => {
this.loading = false
})
},
goBack() {
if (getCurrentPages().length > 1) {
uni.navigateBack()
return
}
uni.switchTab({
url: '/pages/home/index'
})
}
}
}
</script>
<style scoped lang="less">
.county-lottery-rules-page {
min-height: 100vh;
background: #f5f5f5;
}
.custom-header {
position: fixed;
left: 0;
top: 0;
width: 100%;
background: #f5f5f5;
z-index: 20;
}
.header-inner {
height: 88rpx;
padding: 0 24rpx;
display: flex;
align-items: center;
}
.header-back {
width: 56rpx;
height: 56rpx;
border-radius: 8rpx;
display: flex;
align-items: center;
justify-content: center;
background: #fff;
}
.header-back-icon {
font-size: 44rpx;
color: #111;
line-height: 1;
margin-top: -4rpx;
}
.header-title {
flex: 1;
text-align: center;
margin-left: 56rpx;
font-size: 34rpx;
color: #333;
font-weight: 700;
}
.header-right {
width: 88rpx;
height: 44rpx;
border-radius: 24rpx;
border: 2rpx solid #d8d8d8;
background: #fff;
display: flex;
align-items: center;
justify-content: center;
}
.right-dot {
width: 8rpx;
height: 8rpx;
border-radius: 50%;
background: #111;
margin-right: 14rpx;
}
.right-ring {
width: 18rpx;
height: 18rpx;
border-radius: 50%;
border: 2rpx solid #111;
}
.page-body {
padding: 24rpx;
box-sizing: border-box;
}
.rule-card {
background: #fff;
border-radius: 24rpx;
padding: 24rpx;
}
.rule-title {
font-size: 34rpx;
font-weight: 700;
color: #333;
line-height: 1.4;
}
.rule-content {
margin-top: 20rpx;
font-size: 32rpx;
color: #444;
line-height: 1.8;
}
.state-text {
color: #999;
font-size: 28rpx;
}
/deep/ .rule-content p {
margin-bottom: 10rpx;
}
</style>
+910
View File
@@ -0,0 +1,910 @@
<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"
@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 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>
+807
View File
@@ -0,0 +1,807 @@
<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>
+300
View File
@@ -0,0 +1,300 @@
<template>
<view class="realname-page">
<!-- <view class="custom-header" :style="{ paddingTop: `${statusBarHeight}px` }">
<view class="header-inner">
<view class="header-back" @click="goBack">
<u-icon name="arrow-left" size="24" color="#333" class="header-back-icon"></u-icon>
</view>
<view class="header-title">实名认证</view>
<view class="header-right">
<view class="dot"></view>
<view class="ring"></view>
</view>
</view>
</view> -->
<view class="page-body">
<view class="body-title">请完善以下信息</view>
<view class="body-desc">根据平台活动规则领取电子数码产品需要进行实名认
我们会对信息进行严格保密</view>
<view class="form-wrap">
<view class="form-row">
<text class="required">*</text>
<text class="label">真实姓名</text>
<input v-model="form.realName" class="input" placeholder="请输入真实姓名" placeholder-style="color:#999;" />
</view>
<view class="form-row">
<text class="required">*</text>
<text class="label">身份证号</text>
<input v-model="form.idCard" class="input" placeholder="请输入身份证号码" placeholder-style="color:#999;" />
</view>
<view class="form-row">
<text class="required">*</text>
<text class="label">手机号</text>
<input
v-model="form.phone"
class="input"
type="number"
maxlength="11"
placeholder="请输入手机号"
placeholder-style="color:#999;"
/>
</view>
</view>
</view>
<view class="submit-wrap">
<view class="submit-btn" @click="submitAuth">提交认证</view>
</view>
</view>
</template>
<script>
import { getDrawRealname, submitDrawRealname } from '@/api/lottery'
export default {
name: 'CountyRealnamePage',
data() {
return {
statusBarHeight: 20,
form: {
realName: '',
idCard: '',
phone: ''
}
}
},
onLoad() {
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 20
this.fetchRealnameStatus()
},
methods: {
fetchRealnameStatus() {
getDrawRealname().then((res) => {
const data = (res && res.data) || {}
if (Number(data.status) === 1) {
uni.setStorageSync('countyClaimAuthDone', 1)
uni.showToast({
title: data.result || '已完成实名认证',
icon: 'none'
})
setTimeout(() => {
this.backToClaimPage()
}, 300)
}
})
},
backToClaimPage() {
const targetRoute = 'pkg-video/views/county-claim-address'
const pages = getCurrentPages()
const targetIndex = pages.findIndex(
item =>
item.route === targetRoute ||
item.route === `/${targetRoute}`
)
if (targetIndex >= 0) {
const delta = pages.length - 1 - targetIndex
uni.navigateBack({
delta: delta > 0 ? delta : 1
})
return
}
uni.redirectTo({
url: '/pkg-video/views/county-claim-address'
})
},
goBack() {
uni.navigateBack()
},
async submitAuth() {
if (!this.form.realName) {
uni.showToast({ title: '请输入真实姓名', icon: 'none' })
return
}
const idCard = String(this.form.idCard || '').trim().toUpperCase()
this.form.idCard = idCard
if (!/^\d{15}$|^\d{17}[\dX]$/.test(idCard)) {
uni.showToast({ title: '请输入正确身份证号', icon: 'none' })
return
}
if (!/^1\d{10}$/.test(this.form.phone)) {
uni.showToast({ title: '请输入正确手机号', icon: 'none' })
return
}
uni.showLoading({ title: '认证中...' })
try {
const res = await submitDrawRealname({
realName: this.form.realName,
idCard,
phone: this.form.phone
})
const data = (res && res.data) || {}
if (Number(data.status) !== 1) {
uni.showToast({
title: data.result || '认证失败,请重试',
icon: 'none'
})
return
}
uni.setStorageSync('countyClaimAuthDone', 1)
uni.showToast({
title: data.result || '认证成功',
icon: 'success'
})
setTimeout(() => {
this.backToClaimPage()
}, 350)
} catch (e) {
uni.showToast({
title: (e && e.msg) || (e && e.message) || '认证失败',
icon: 'none'
})
} finally {
// uni.hideLoading()
}
}
}
}
</script>
<style scoped lang="less">
.realname-page {
min-height: 100vh;
background: #fff;
}
.custom-header {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 20;
background: #fff;
}
.header-inner {
height: 88rpx;
display: flex;
align-items: center;
padding: 0 24rpx;
}
.header-back {
width: 56rpx;
height: 56rpx;
display: flex;
align-items: center;
justify-content: center;
}
.header-back-icon {
font-size: 60rpx;
color: #111;
line-height: 1;
}
.header-title {
flex: 1;
text-align: center;
font-size: 34rpx;
font-weight: 700;
color: #222;
}
.header-right {
width: 88rpx;
height: 44rpx;
border-radius: 24rpx;
border: 2rpx solid #d8d8d8;
background: #fff;
display: flex;
align-items: center;
justify-content: center;
}
.dot {
width: 8rpx;
height: 8rpx;
border-radius: 50%;
background: #111;
margin-right: 14rpx;
}
.ring {
width: 18rpx;
height: 18rpx;
border: 2rpx solid #111;
border-radius: 50%;
}
.page-body {
padding: 28rpx 24rpx 180rpx;
}
.body-title {
font-size: 40rpx;
color: #333;
font-weight: 700;
padding: 20rpx;
}
.body-desc {
margin-top: 12rpx;
color: #666;
font-size: 28rpx;
line-height: 1.45;
padding: 20rpx;
background: rgba(244,244,244,0.39);
border-radius: 16rpx;
}
.form-wrap {
margin-top: 24rpx;
}
.form-row {
height: 94rpx;
display: flex;
align-items: center;
border-bottom: 2rpx solid #efefef;
}
.required {
color: #c23225;
font-size: 28rpx;
margin-right: 4rpx;
}
.label {
width: 150rpx;
color: #333;
font-size: 32rpx;
}
.input {
flex: 1;
font-size: 32rpx;
color: #333;
}
.submit-wrap {
position: fixed;
left: 0;
right: 0;
bottom: 0;
padding: 18rpx 24rpx calc(18rpx + env(safe-area-inset-bottom));
background: #fff;
}
.submit-btn {
border-radius: 44rpx;
background: #bd3124;
color: #fff;
line-height: 88rpx;
text-align: center;
font-size: 38rpx;
font-weight: 600;
letter-spacing: 14rpx;
}
</style>
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -104,7 +104,7 @@ export default {
if (res.confirm) {
console.log('用户点击确定')
uni.navigateTo({
url: '/pages/user/Points/index'
url: '/pagesUser/user/Points/index'
})
} else if (res.cancel) {
console.log('用户点击取消')
@@ -157,4 +157,4 @@ export default {
}
}
}
</style>
</style>
+2 -2
View File
@@ -144,7 +144,7 @@ export default {
},
methods: {
navToPoint() {
uni.navigateTo({url: '/pages/user/Points/index'})
uni.navigateTo({url: '/pagesUser/user/Points/index'})
},
init() {
getDetail().then(res => {
@@ -403,4 +403,4 @@ image {
background-size: 175rpx 185rpx;
}
}
</style>
</style>
+1 -1
View File
@@ -137,6 +137,7 @@ export default {
onShow() {
this.content = uni.getStorageSync(this.merName+this.uid+this.storeId)
this.connectSocketInit();
this.list = []
},
onUnload() {
if (this.socketOpen) {
@@ -158,7 +159,6 @@ export default {
},
methods: {
toGoods(item) {
console.log(item);
const itemJson = JSON.parse(item.msg_content)
if(!itemJson.goodsId) {
// 提示数据错误
+8 -2
View File
@@ -698,7 +698,10 @@ export default {
this.hotelTypeList = data.hotelTypeList || []
this.columnsType = this.hotelTypeList
this.notice = data.merchantApplyNotice
getCountyFamousHotelType().then(res => {
getCountyFamousHotelType({
page: 1,
limit: 9999
}).then(res => {
const listData = Array.isArray(res.data)
? res.data
: (res.data && (res.data.hotelTypeList || res.data.list || res.data.records)) || []
@@ -843,7 +846,10 @@ export default {
this.form.isCountyFamous = value
if (value === 1) {
if (this.countyFamousHotelTypeList.length === 0) {
getCountyFamousHotelType().then(res => {
getCountyFamousHotelType({
page: 1,
limit: 9999
}).then(res => {
const listData = Array.isArray(res.data)
? res.data
: (res.data && (res.data.hotelTypeList || res.data.list || res.data.records)) || []
+60 -5
View File
@@ -92,7 +92,18 @@
</view>
<view class="inn-signature-wrap">
<view class="triangle"></view>
<view class="inn-signature">
<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">
{{ inn.shopIntro }}
</view>
<view class="share-btn" @click="changeShare">
@@ -918,6 +929,7 @@ 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,
@@ -997,6 +1009,7 @@ export default {
shopList: [],
shopTypeList: [],
shopTypeActive: '',
detail: {}
}
},
onShareAppMessage() {
@@ -1035,7 +1048,7 @@ export default {
this.getGuideReq()
// this.initPoster()
this.getListReq()
this.getsaleList()
this.getSaleListReq()
this.queryGuide('countyFamousIndex')
this.getCityNewsCategoryReq()
},
@@ -1229,9 +1242,11 @@ export default {
}
})
},
getsaleList() {
getSaleListReq() {
const params = {
countyFamousDataId: this.id
countyFamousDataId: this.id,
page: 1,
limit: 9999
}
getSaleList(params).then(res => {
this.saleList = [{name: '全部', id: ''}].concat(res.data || [])
@@ -1307,6 +1322,7 @@ export default {
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 || []
@@ -1639,6 +1655,34 @@ 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,
@@ -1702,7 +1746,10 @@ export default {
}
},
getShopTypeList() {
getCountyFamousHotelType().then(res => {
getCountyFamousHotelType({
page: 1,
limit: 9999
}).then(res => {
const listData = Array.isArray(res.data)
? res.data
: (res.data && (res.data.hotelTypeList || res.data.list || res.data.records)) || []
@@ -2024,6 +2071,14 @@ 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 -1
View File
@@ -486,7 +486,7 @@ export default {
goEvaluateList() {
if (!this.id) return
this.$yrouter.push({
path: '/pages/shop/EvaluateList/index',
path: '/pagesShop/shop/EvaluateList/index',
query: {
id: this.id,
isTravelGroup: 1
+1 -1
View File
@@ -500,7 +500,7 @@ export default {
return
}
this.$yrouter.push({
path: '/pages/shop/GoodsEvaluate/index',
path: '/pagesShop/shop/GoodsEvaluate/index',
query: {
id: orderId,
isTravelGroup: 1
+2 -5
View File
@@ -138,6 +138,7 @@ 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],
@@ -399,11 +400,7 @@ export default {
},
subscribePay() {
uni.requestSubscribeMessage({
tmplIds: [
'7O3wKw7_D4t7yfSOlvecKuOQP8QEPY88uBx2FJg43HE',
'TSmTnGibZ8IxWCiRWOvLxha6-0u7tE-V1-WbDCiPkKU',
'9Q6xLHe6HyjkU5Zn5k_2zxYPf2y4MxVyUbOSW8pcZRU'
],
tmplIds: settings.SubscribeMessageTmplIds,
complete: () => this.createOrder(false)
})
},
+1 -1
View File
@@ -209,7 +209,7 @@ export default {
return
}
this.$yrouter.push({
path: "/pages/order/OrderDetails/index",
path: "/pagesOrder/order/OrderDetails/index",
query: {
id: this.order
}
+133 -8
View File
@@ -24,7 +24,7 @@
</view>
<view v-if="!isGroupBuy">
<u-number-box
v-if="showInput"
v-if="showInput && !isCountyLotteryGift"
v-model="goodsInfo.cartNum"
:max="goodsInfo['productInfo']['attrInfo']['stock']"
integer
@@ -48,7 +48,7 @@
</view>
</template>
</u-number-box>
<view v-else> x{{ goodsInfo['cartNum'] }} </view>
<view v-else> x{{ isCountyLotteryGift ? 1 : goodsInfo['cartNum'] }} </view>
</view>
</view>
</view>
@@ -71,7 +71,7 @@
<u-switch v-model="isBlind" activeColor="#c52733"></u-switch>
</view>
</view>
<view class="swich-btn" v-if="!isPayOk && !isGroupBuy">
<view class="swich-btn" v-if="!isPayOk && !isGroupBuy && !isCountyLotteryGift">
<view class="v12-font-28 v12-dark-text">一人领取所有礼品</view>
<view>
<u-switch v-model="isOneRecipient" activeColor="#c52733"></u-switch>
@@ -180,6 +180,28 @@
: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>
@@ -251,7 +273,10 @@ export default {
blindImage: '',
isGroupBuy: false,
popupCover: '',
showInput: true
showInput: true,
isCountyLotteryGift: false,
showLotteryGiftPopup: false,
isEligibleForDraw: false
}
},
watch: {
@@ -268,6 +293,7 @@ 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) {
@@ -391,6 +417,9 @@ export default {
this.giftNotice = res.data.giftCardGiftNotice
this.orderKey = res.data.orderKey
this.goodsInfo = goodsInfo
if (this.isCountyLotteryGift) {
this.$set(this.goodsInfo, 'cartNum', 1)
}
this.templateId = template.id
this.defaultIndex = this.coverList.findIndex(item => item.id === this.templateId)
console.log(this.defaultIndex, 'defaultIndex');
@@ -472,6 +501,9 @@ export default {
this.giftNotice = res.data.giftCardGiftNotice
this.orderKey = res.data.orderKey
this.goodsInfo = goodsInfo
if (this.isCountyLotteryGift) {
this.$set(this.goodsInfo, 'cartNum', 1)
}
this.templateId = template.id
this.selectedCover = template.cover
this.giftImage = template.image
@@ -480,11 +512,30 @@ export default {
// if(!this.couponId) {
// this.couponId = res.data.couponList.usable[0] && res.data.couponList.usable[0].id || ''
// }
this.computedPrice(this.goodsInfo.cartNum)
this.computedPrice(this.isCountyLotteryGift ? 1 : this.goodsInfo.cartNum)
}).finally(() => {
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 {*}
@@ -526,7 +577,7 @@ export default {
from: 'routine',
cartId: this.cartId,
couponId: this.couponId,
recipientsNum: this.goodsInfo.cartNum,
recipientsNum: this.isCountyLotteryGift ? 1 : this.goodsInfo.cartNum,
templateId: this.templateId,
message : this.message || '礼笺轻启,礼藏心意',
cover: this.selectedCover,
@@ -575,7 +626,7 @@ export default {
icon: "none",
duration: 2000
});
this.isPayOk = true;
this.handleGiftPaySuccess(data.isEligibleForDraw);
break;
case "WECHAT_H5_PAY":
// H5
@@ -592,7 +643,7 @@ export default {
icon: "none",
duration: 2000
});
this.isPayOk = true;
this.handleGiftPaySuccess(data.isEligibleForDraw);
}).catch(err => {
// this.makeAgain()
@@ -798,4 +849,78 @@ 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>
+1 -1
View File
@@ -461,7 +461,7 @@ export default {
}
// if (this.cateIndex === 0) return
this.$yrouter.push({
path: '/pages/order/OrderDetails/index',
path: '/pagesOrder/order/OrderDetails/index',
query: {
id: item.orderId,
isGift: this.cateIndex === 0 ? 1 : 0
+1 -1
View File
@@ -273,7 +273,7 @@ export default {
that.$refs.secrity.clear();
setTimeout(function () {
that.$yrouter.replace("/pages/user/promotion/CashAudit/index");
that.$yrouter.replace("/pagesUser/user/promotion/CashAudit/index");
}, 1000);
},
+8
View File
@@ -0,0 +1,8 @@
开奖缺少 是否领取奖品状态
缺少平台客服电话
缺少 立即领取图片
送礼逻辑没做
实付多少钱数据没有
查看订单没有奖品订单号
抽奖码页缺少中奖轮播数据
奖品订单 确认收货后直接完成
+1 -1
View File
@@ -56,7 +56,7 @@ export function dateFormatT(time) {
* @param format {String} 格式yyyy-MM-dd
*/
export function formatDateTime(time, format) {
export function formatDateTime(time, format = 'yyyy-MM-dd HH:mm:ss') {
var t = new Date(time);
var tf = function (i) {
return (i < 10 ? "0" : "") + i;