Merge branch 'dev' into test

This commit is contained in:
linxi
2026-07-24 11:28:26 +08:00
19 changed files with 1036 additions and 192 deletions
+15
View File
@@ -51,6 +51,7 @@ export const chatMixinsV2 = {
audioPlayId: '',
showGiftBtn: false,
buyLoading: false,
buyActionLock: false,
exceptionConfig: {
model_exception: '您提的问题未能理解,云灵思想跑偏啦,重新整理一下问题或者重新提问,让云灵再试试!',
voice_exception: ''
@@ -533,6 +534,10 @@ export const chatMixinsV2 = {
this.productItemBuyNowOrGiftBuy(item, 2)
},
productItemBuyNowOrGiftBuy(item, BuyNowOrGiftBuyType) {
if (this.buyActionLock) {
return
}
this.buyActionLock = true
this.audioStopHandle()
this.cart_num = 1
this.m_id = item.id
@@ -540,6 +545,7 @@ export const chatMixinsV2 = {
const { data } = res
this.storeInfo = {...data.storeInfo}
if(data.storeInfo.stock === 0) {
this.buyActionLock = false
uni.showToast({
title: "产品库存不足,请选择其他商品",
icon: "none",
@@ -577,6 +583,14 @@ export const chatMixinsV2 = {
return
}
this.attr.cartAttr = !this.isOpen ? true : false
this.buyActionLock = false
}).catch(error => {
this.buyActionLock = false
uni.showToast({
title: error.msg || '操作失败,请稍后重试',
icon: "none",
duration: 3000
})
})
},
buyNowOrGiftBuyReq(type) {
@@ -617,6 +631,7 @@ export const chatMixinsV2 = {
})
}).finally(() => {
_this.buyLoading = false
_this.buyActionLock = false
})
},
closeAttrWindow() {
+11
View File
@@ -102,6 +102,17 @@ export function postOrderRefund(data) {
return request.post("/order/refund/verify", data);
}
/**
* 取消退款申请
* @param uni
* @returns {*}
*/
export function cancelOrderRefund(uni) {
return request.post("/order/refund/cancel", {
uni
});
}
/**
* 确认收货
* @returns {*}
+5
View File
@@ -60,6 +60,11 @@ export function getCountyFamousCityGuideContent(param) {
return request.get('/countyFamous/guide/content', param, { login: true })
}
// 获取千县名品县城图文攻略详情
export function getCountyFamousGraphicGuideContent(param) {
return request.get('/countyFamous/guide/graphic/content', param, { login: true })
}
// 获取千县名品县城重点产业列表
export function getCountyFamousIndustry(param) {
return request.get('/countyFamous/industry', param, { login: true })
+8 -1
View File
@@ -490,7 +490,7 @@
{
"path": "views/giftList",
"style": {
"navigationBarTitleText": "特色礼品"
"navigationBarTitleText": "全国礼品"
}
},
{
@@ -532,6 +532,13 @@
"navigationStyle": "custom"
}
},
{
"path": "views/famousQianxianGraphicGuide",
"style": {
"navigationBarTitleText": "攻略详情",
"navigationStyle": "custom"
}
},
{
"path": "views/famousQianxianVillageShop",
"style": {
+29 -13
View File
@@ -7,21 +7,23 @@
</view>
<view class="list" v-if="list.length">
<custom-waterfalls-flow :value="list" imageKey="cover">
<view class="item" v-for="(item,index) in list" :key="index" slot="slot{{index}}" @click="goDetail(item)">
<image class="cover" :src="item.cover" mode="widthFix"></image>
<view class="content">
<view class="title more-t">{{ item.title }}</view>
<view class="footer flex jc-between ai-center">
<view class="visit flex ai-center">
<image class="icon" style="margin-right: 8rpx" :src="item.storeLogo" mode="scaleToFill"></image>
{{ item.storeName }}
<view class="video-waterfalls-wrap">
<custom-waterfalls-flow :value="list" imageKey="cover">
<view class="item" v-for="(item,index) in list" :key="index" slot="slot{{index}}" @click="goDetail(item)">
<image class="cover" :src="item.cover" mode="widthFix"></image>
<view class="content">
<view class="title more-t">{{ item.title }}</view>
<view class="footer flex jc-between ai-center">
<view class="visit flex ai-center">
<image class="icon" style="margin-right: 8rpx" :src="item.storeLogo" mode="scaleToFill"></image>
{{ item.storeName }}
</view>
<image class="icon flex-0" :src="webUrl+'/20210806121203835373.png'" mode="scaleToFill"></image>
</view>
<image class="icon flex-0" :src="webUrl+'/20210806121203835373.png'" mode="scaleToFill"></image>
</view>
</view>
</view>
</custom-waterfalls-flow>
</custom-waterfalls-flow>
</view>
</view>
<view class="v4-nodata" v-else>
@@ -114,6 +116,7 @@ export default {
border-radius: 20rpx;
background: #fff;
font-size: 26rpx;
white-space: nowrap;
}
.active {
@@ -125,6 +128,19 @@ export default {
.list {
margin: 28rpx 32rpx;
.video-waterfalls-wrap {
direction: ltr;
/deep/ .waterfalls-flow {
direction: ltr;
text-align: left;
}
/deep/ .waterfalls-flow-column {
float: left !important;
}
}
.item {
border-radius: 4rpx;
background: #fff;
@@ -174,4 +190,4 @@ export default {
}
}
}
</style>
</style>
+16 -13
View File
@@ -384,20 +384,23 @@ export default {
this.mescroll && this.mescroll.triggerDownScroll()
},
search() {
if(this.keyword === '') return
this.listGroup.findIndex((group, index) => {
let result
group.city.forEach(item => {
result = item.cityName.indexOf(this.keyword, 0)
if (result !== -1) {
this.asideTap(index);
return null;
}
})
if (result !== -1) {
return result
}
const keyword = (this.keyword || '').trim()
if (!keyword) return
const matchIndex = this.listGroup.findIndex(group => {
const cityList = Array.isArray(group.city) ? group.city : []
return cityList.some(item => item && item.cityName && item.cityName.indexOf(keyword) !== -1)
})
if (matchIndex !== -1) {
this.keyword = keyword
this.asideTap(matchIndex)
return
}
if (matchIndex === -1) {
uni.showToast({
title: '未找到该城市,请重新输入城市名称',
icon: 'none'
})
}
},
select(item) {
if (this.type === 0 && item.hasData === 0) return
+22 -4
View File
@@ -36,7 +36,7 @@
</view>
</view>
<view class="product-wrap v12-mt-3">
<view v-if="products.length > 0" class="product-wrap v12-mt-3">
<view class="product-card" v-for="(item, index) in products" :key="index" @click="toGoods(item)">
<image :src="item.productImage" class="product-card-img" mode="heightFix|widthFix"></image>
<view class="new-info">
@@ -53,6 +53,9 @@
</view>
</view>
</view>
<view v-else class="empty-wrap">
<view class="empty-text">暂无数据</view>
</view>
<ProductWindow
ref="attrWindow"
:attr="attr"
@@ -99,8 +102,12 @@ export default{
onLoad() {
queryNewZone().then(res => {
this.details = res.data
this.tabs = res.data.categories
this.handleClick(0, this.tabs[0])
this.tabs = Array.isArray(res.data.categories) ? res.data.categories : []
if (this.tabs.length > 0) {
this.handleClick(0, this.tabs[0])
} else {
this.products = []
}
})
},
computed: {
@@ -112,7 +119,7 @@ export default{
methods: {
handleClick(index, tab) {
this.activeIndex = index
this.products = tab.products
this.products = Array.isArray(tab && tab.products) ? tab.products : []
},
handleChange(e) {
this.current = e.detail.current
@@ -144,6 +151,17 @@ export default{
justify-content: space-between;
flex-wrap: wrap;
}
.empty-wrap{
min-height: 260rpx;
display: flex;
align-items: center;
justify-content: center;
}
.empty-text{
font-size: 28rpx;
color: #999999;
text-align: center;
}
.tab-line{
position: absolute;
bottom: 0;
+239 -70
View File
@@ -54,14 +54,14 @@
<view class="list v12-ma-0" style="padding: 0rpx 0 30rpx;">
<view
v-for="(order, orderListIndex) in orderList"
:key="orderListIndex"
:key="order.orderId || orderListIndex"
class="item"
>
<view
v-if="order.experienceOrderInfo"
class="shop-info flex jc-between ai-center"
style="padding-bottom: 0"
@click.stop="goStore(order)"
@click.stop="goStore(orderListIndex)"
>
<view class="flex ai-center">
<image
@@ -79,7 +79,7 @@
v-if="order.merName && !order.experienceOrderInfo"
class="shop-info flex jc-between ai-center"
style="padding-bottom: 0"
@click="goStore(order)"
@click="goStore(orderListIndex)"
>
<view class="flex ai-center">
<image
@@ -133,7 +133,7 @@
class="font-color-white statusTag v12-primary"
>{{ (order.isGiftCardSend || order.isGiftCardReceive) ? '礼包' : (getStatus(order) || (order._status && order._status._title) || '已完成') }}</view>
</view>
<view @click="goOrderDetails(order)">
<view @click="goOrderDetails(orderListIndex)">
<view
v-if="order.isGiftCardReceiveBlind === 1"
class="item-info acea-row row-between row-top"
@@ -254,22 +254,22 @@
<image
v-if="cart.combinationId === 0 && cart.bargainId === 0 &&cart.seckillId === 0"
:src="cart.productInfo.image"
@click.stop="gotoGoodDetail(cart, 1, { id: cart.productInfo.id })"
@click.stop="gotoGoodDetail(orderListIndex, cartInfoIndex)"
/>
<image
v-else-if="cart.combinationId > 0"
:src="cart.productInfo.image"
@click.stop="gotoGoodDetail(cart, 2, { id: cart.combinationId })"
@click.stop="gotoGoodDetail(orderListIndex, cartInfoIndex)"
/>
<image
v-else-if="cart.bargainId > 0"
:src="cart.productInfo.image"
@click.stop="gotoGoodDetail(cart, 3, { id: cart.bargainId })"
@click.stop="gotoGoodDetail(orderListIndex, cartInfoIndex)"
/>
<image
v-else-if="cart.seckillId > 0"
:src="cart.productInfo.image"
@click.stop="gotoGoodDetail(cart, 4, { id: cart.seckillId })"
@click.stop="gotoGoodDetail(orderListIndex, cartInfoIndex)"
/>
</view>
<view class="text" style="margin-top: 0 !important;">
@@ -334,17 +334,17 @@
<view
v-if="order.experienceOrderStatus === 0 || order.experienceOrderStatus === 1"
class="bnt service"
@click.stop="goRoom(order)"
@click.stop="goRoom(orderListIndex)"
>联系商家</view>
<view
v-if="order.experienceOrderStatus === 0"
class="bnt v12-primary v12-white-text v12-primary-border v12-radius-40"
@click.stop="goOrderDetails(order)"
@click.stop="goOrderDetails(orderListIndex)"
>去使用</view>
<view
v-if="order.experienceOrderStatus === 1 || order.experienceOrderStatus === 2"
class="bnt service"
@click.stop="delOrder(order)"
@click.stop="delOrder(orderListIndex)"
>删除订单</view>
</view>
<view
@@ -358,18 +358,18 @@
>
<text
class="btn-more v12-font-28 v12-font-bold"
@click.stop="tapShowMore(order, orderListIndex)"
@click.stop="tapShowMore(orderListIndex)"
>更多</text>
<view class="group-float" v-show="order.showMore">
<view
v-if="order.merName && order.isGiftCardReceiveBlind === 0"
class="btn btn-service flex jc-center ai-center v12-font-24"
@click="goRoom(order)"
@click="goRoom(orderListIndex)"
>联系商家</view>
<view
v-if="order.isTravelGroup === 0 && order.refundSystemStatus !== 2"
class="btn flex jc-center ai-center v12-font-24"
@click="goRefund(order)"
@click="goRefund(orderListIndex)"
>申请退款</view>
</view>
</view>
@@ -378,7 +378,7 @@
<view
v-if="order.isDrawOrder > 0"
class="bnt service"
@click.stop="callMerPhone(order)"
@click.stop="callMerPhone(orderListIndex)"
>联系客服
</view>
<view>
@@ -389,18 +389,18 @@
parseInt(order._status._type) !== 9
"
class="bnt service"
@click="goRoom(order)"
@click="goRoom(orderListIndex)"
>联系商家</view>
</view>
<view class="v12-justify-between">
<view
class="bnt service"
@click="goOrderDetails(order)"
@click="goOrderDetails(orderListIndex)"
v-if="[-1, -2, -3].includes(parseInt(order._status._type))"
>查看详情</view>
<view
class="bnt service"
@click="delOrder(order)"
@click="delOrder(orderListIndex)"
v-if="[9].includes(parseInt(order._status._type))"
>删除订单</view>
</view>
@@ -411,61 +411,61 @@
<template v-if="parseInt(order._status._type) === 0">
<view
class="bnt cancelBnt v12-dark-text v12-dark-border"
@click="cancelOrder(order)"
@click="cancelOrder(orderListIndex)"
>取消订单</view>
<view
v-if="order.isTravelGroup === 0 && order.isDrawOrder === 0"
class="bnt cancelBnt v12-dark-text v12-dark-border"
@click="addressTap(order)"
@click="addressTap(orderListIndex)"
>修改地址</view>
<view
class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40"
@click="subscribePay(order)"
@click="subscribePay(orderListIndex)"
>立即付款</view>
</template>
<template v-if="parseInt(order._status._type) === 1 && order.isTickets === 0">
<view
v-if="order.isTravelGroup === 1"
class="bnt service"
@click="editTime(order)"
@click="editTime(orderListIndex)"
>{{ '修改时间' }}</view>
<view
v-if="order.isTravelGroup === 1"
class="bnt service"
@click="applyRefund(order)"
@click="applyRefund(orderListIndex)"
>{{ '申请退款' }}</view>
<view
v-if="canShowModifyAddress(order) && order.isDrawOrder === 0"
class="bnt service"
@click="addressTap(order)"
@click="addressTap(orderListIndex)"
>修改地址</view>
<view
class="bnt service"
:class="{'v12-primary-text v12-primary-border': order.isTravelGroup === 1}"
@click="goOrderDetails(order)"
@click="goOrderDetails(orderListIndex)"
>{{ order.isTravelGroup === 0 ? '查看详情' : '查看券码' }}</view>
</template>
<template v-if="parseInt(order._status._type) === 1 && order.isTickets === 1">
<view
class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40"
@click="goOrderDetails(order)"
@click="goOrderDetails(orderListIndex)"
>立即核销</view>
</template>
<template v-if="parseInt(order._status._type) === 2 && order.isTickets === 0 && order.isTravelGroup === 1">
<view
v-if="order.isTravelGroup === 1"
class="bnt service"
@click="editTime(order)"
@click="editTime(orderListIndex)"
>{{ '修改时间' }}</view>
<view
v-if="order.isTravelGroup === 1"
class="bnt service"
@click="applyRefund(order)"
@click="applyRefund(orderListIndex)"
>{{ '申请退款' }}</view>
<view
class="bnt service"
:class="{'v12-primary-text v12-primary-border': order.isTravelGroup === 1}"
@click="goOrderDetails(order)"
@click="goOrderDetails(orderListIndex)"
>{{ order.isTravelGroup === 0 ? '查看详情' : '查看券码' }}</view>
</template>
<template v-if="parseInt(order._status._type) === 2 && order.isTickets === 0 && order.isTravelGroup === 0">
@@ -477,23 +477,23 @@
</view>
<view
class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40"
@click="takeOrder(order)"
@click="takeOrder(orderListIndex)"
>确认收货</view>
</template>
<template v-if="parseInt(order._status._type) === 3 && order.isTravelGroup === 0">
<view
class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40"
@click="goOrderDetails(order)"
@click="goOrderDetails(orderListIndex)"
>去评价</view>
</template>
<template v-if="parseInt(order._status._type) === 3 && order.isTravelGroup === 1">
<view
class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40"
@click="goOrderDetails(order)"
@click="goOrderDetails(orderListIndex)"
>去评价</view>
</template>
<template v-if="parseInt(order._status._type) === 4">
<view class="bnt service" @click="goOrderDetails(order)">查看订单</view>
<view class="bnt service" @click="goOrderDetails(orderListIndex)">查看订单</view>
</template>
</view>
</view>
@@ -505,7 +505,7 @@
<view
v-if="order.merName && order.isGiftCardReceiveBlind === 0"
class="bnt btn-service flex jc-center ai-center v12-font-24"
@click="goRoom(order)"
@click="goRoom(orderListIndex)"
>联系商家
</view>
<view class="v12-align-center">
@@ -519,14 +519,14 @@
"
open-type="share"
class="gift-btn service v12-primary-text v12-primary-border"
@click="shareGift(order)"
@click="shareGift(orderListIndex)"
>送给朋友</button>
<button
v-if="Number(order.status) === 0"
class="gift-btn service v12-primary-text v12-primary-border"
@click="subscribePay(order)"
@click="subscribePay(orderListIndex)"
>立即支付</button>
<view class="bnt service" @click="goOrderDetails(order)">查看详情</view>
<view class="bnt service" @click="goOrderDetails(orderListIndex)">查看详情</view>
</view>
</view>
</view>
@@ -725,7 +725,8 @@ export default {
showDatePicker: false,
dateRange: [],
userLatitude: null,
userLongitude: null
userLongitude: null,
orderListRequestId: 0
}
},
components: {
@@ -929,12 +930,28 @@ export default {
uni.hideLoading();
})
},
editTime(order) {
editTime(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
this.showDatePicker = true
this.travelGroupOrderInfo = order.travelGroupOrderInfo
this.orderInfo = order
},
applyRefund(order) {
applyRefund(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
// 这里可以添加申请退款的逻辑,比如跳转到退款页面
uni.navigateTo({
url: '/pkg_product/views/sojoumOrderRefund?id=' + order.orderId
@@ -950,8 +967,16 @@ export default {
}
return timeMap[type]
},
shareGift(item) {
this.giftItem = item
shareGift(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
this.giftItem = order
},
getGiftTips(giftCardInfo) {
// giftCardStatus int 礼品卡状态 0-未领取 1-已领取 2-已失效
@@ -982,14 +1007,30 @@ export default {
})
this.$forceUpdate()
},
delOrder(order) {
getOrderByIndex(orderOrIndex) {
if (typeof orderOrIndex === 'number') {
return this.orderList[orderOrIndex]
}
if (typeof orderOrIndex === 'string' && /^\d+$/.test(orderOrIndex)) {
return this.orderList[Number(orderOrIndex)]
}
return orderOrIndex
},
delOrder(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
delOrderHandle(order.orderId).then(() => {
this.page = 1
this.orderList = [];
this.getOrderListReq()
this.changeType()
})
},
goStore(order) {
goStore(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
return
}
@@ -1071,14 +1112,30 @@ export default {
this.toYuePay(payPwd)
this.isShowPayPwdPop = false
},
subscribePay(order) {
subscribePay(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
this.orderInfo = order
uni.requestSubscribeMessage({
tmplIds: settings.SubscribeMessageTmplIds,
complete: () => this.pay = true
})
},
addressTap(order) {
addressTap(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
this._orderId = order.orderId
uni.setStorageSync('updateOrderSourceAddress', {
id: order.addressId || order.userAddressId || '',
@@ -1096,7 +1153,8 @@ export default {
force2Decimal(v) {
return this.$force2Decimal(v)
},
callMerPhone(order) {
callMerPhone(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
const phone = String((order && order.merPhone) || '').trim()
if (!phone) {
uni.showToast({
@@ -1109,10 +1167,17 @@ export default {
phoneNumber: phone
})
},
goRoom(order) {
console.log(order);
goRoom(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
if (order.experienceOrderInfo) {
const phone = order.merchantPhone || order.merPhone || order.experienceOrderInfo.phone || order.companyTel;
const phone = order.merchantPhone || order.merPhone || order.experienceOrderInfo.phone || order.companyTel
if (phone) {
uni.makePhoneCall({
phoneNumber: phone
@@ -1143,7 +1208,15 @@ export default {
url: `/pkg_common/views/room?id=${order.merId}&name=${order.merName}&params=${JSON.stringify(params)}`
})
},
goRefund(order) {
goRefund(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
// fix bug#1631
if (this.type === 4 || parseInt(order._status._type) === 3) {
// 打开售后的目的就是开启已完成/待评价订单的退款功能,确认打开售后之后,小程序用户再点击申请退款,就可以进入退款申请填写页面,正常走退款流程,提交退款申请以后,订单状态变为退款中
@@ -1165,7 +1238,15 @@ export default {
})
}
},
goLogistics(order) {
goLogistics(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
this.$yrouter.push({
path: "/pagesOrder/order/Logistics/index",
query: {
@@ -1173,7 +1254,15 @@ export default {
}
});
},
goOrderDetails(order) {
goOrderDetails(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
if (order.experienceOrderInfo) {
this.$yrouter.push({
path: "/pkg_product/views/experienceCouponOrderDetail",
@@ -1210,9 +1299,39 @@ export default {
}
}
},
gotoGoodDetail(cart, type, query){
gotoGoodDetail(orderOrIndex, cartOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
const cartList = Array.isArray(order && order.cartInfo) ? order.cartInfo : []
const cart = typeof cartOrIndex === 'number' ? cartList[cartOrIndex] : cartOrIndex
if (!cart) {
uni.showToast({
title: '未获取到商品信息',
icon: 'none'
})
return
}
const productInfo = cart.productInfo || {}
let type = 1
let id = productInfo.id || cart.productId || ''
if (Number(cart.combinationId) > 0) {
type = 2
id = cart.combinationId
} else if (Number(cart.bargainId) > 0) {
type = 3
id = cart.bargainId
} else if (Number(cart.seckillId) > 0) {
type = 4
id = cart.seckillId
}
if (!id) {
uni.showToast({
title: '未获取到商品详情参数',
icon: 'none'
})
return
}
// isProductStillExist:0-不存在,1-存在
const isProductStillExist = cart.isProductStillExist || 0
const isProductStillExist = Number(cart.isProductStillExist || 0)
if (isProductStillExist === 0) {
this.$dialog.toast({ mes: '商品已下架' })
return
@@ -1232,14 +1351,32 @@ export default {
path = '/pages/activity/SeckillDetails/index'
break
}
this.$yrouter.push({ path, query })
if (!path) {
uni.showToast({
title: '未找到商品详情页',
icon: 'none'
})
return
}
this.$yrouter.push({
path,
query: { id }
})
},
getOrderData() {
getOrderData().then(res => {
this.orderData = res.data
})
},
takeOrder(order) {
takeOrder(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
const that = this
uni.showModal({
title: '是否确认收货?',
@@ -1260,6 +1397,23 @@ export default {
reload() {
this.changeType(this.type)
},
normalizeOrderList(list = []) {
const orderKeySet = new Set()
return list.reduce((result, item) => {
const orderKey = item && (item.orderId || item.id)
if (orderKey && orderKeySet.has(orderKey)) {
return result
}
if (orderKey) {
orderKeySet.add(orderKey)
}
result.push({
...item,
showMore: false
})
return result
}, [])
},
tabChange(item) {
this.type = item.index
this.$yroute.query.type = this.type
@@ -1300,6 +1454,7 @@ export default {
})
},
changeType() {
this.orderListRequestId += 1
this.orderList = []
this.page = 1
this.loaded = false
@@ -1308,7 +1463,8 @@ export default {
},
getOrderListReq() {
if (this.loading || this.loaded) return
// this.loading = true
this.loading = true
const currentRequestId = this.orderListRequestId
uni.showLoading({
mask: true,
})
@@ -1335,22 +1491,27 @@ export default {
keyword,
orderType
}).then(res => {
this.orderList = this.orderList.concat(res.data)
if (this.orderList.length > 0) {
this.orderList.forEach(item => {
item.showMore = false;
})
if (currentRequestId !== this.orderListRequestId) {
return
}
const nextOrderList = page === 1 ? res.data : this.orderList.concat(res.data)
this.orderList = this.normalizeOrderList(nextOrderList)
this.updateOrderDistances()
this.page++;
this.page = page + 1
this.loaded = res.data.length < this.limit
this.loading = false
}).finally(() => {
if (currentRequestId !== this.orderListRequestId) {
return
}
this.loading = false
uni.hideLoading()
});
},
tapShowMore(order, index) {
tapShowMore(index) {
const order = this.getOrderByIndex(index)
if (!order) {
return
}
order.showMore = !order.showMore;
this.$set(this.orderList, index, order);
},
@@ -1390,7 +1551,15 @@ export default {
}
return status
},
cancelOrder(order) {
cancelOrder(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
cancelOrderHandle(order.orderId).then(() => {
this.getOrderData();
this.orderList.splice(this.orderList.indexOf(order), 1)
+56 -16
View File
@@ -117,7 +117,7 @@
<text class="v12-font-28">{{ force2Decimal(orderPrice.payPostage) }}</text>
</view>
</view> -->
<view class="v12-justify-between v12-align-center v12-py-1">
<view v-if="!isLotteryOrder()" class="v12-justify-between v12-align-center v12-py-1">
<view class="v12-font-24 v12-dark-text v12-align-center">
<text>优惠券</text>
<view class="v12-align-center v12-ml-1" v-if="couponTitle">
@@ -255,7 +255,7 @@
</view>
<!-- v9 优惠券开始 -->
<u-popup
v-if="show"
v-if="!isLotteryOrder() && show"
:show="show"
:round="10"
mode="bottom"
@@ -263,7 +263,7 @@
@close="close"
>
<CouponsPopup
v-if="couponList.usable.length > 0 && show"
v-if="!isLotteryOrder() && couponList.usable.length > 0 && show"
:two-list="couponList"
@change="changeCoupons"
@close="close"
@@ -398,7 +398,8 @@ export default {
pageKeyId: Object.freeze('orderConfirm'),
total: 0,
couponTitle: '',
hasCoupon: false
hasCoupon: false,
pageQuery: {}
}
},
computed: mapGetters(["userInfo", "storeItems"]),
@@ -417,17 +418,18 @@ export default {
},
onLoad(opts) {
const that = this
if (that.$yroute.query.pinkid !== undefined) {
that.pinkId = that.$yroute.query.pinkid
that.pageQuery = Object.assign({}, that.resolvePageQuery(), opts || {})
if (that.pageQuery.pinkid !== undefined) {
that.pinkId = that.pageQuery.pinkid
}
if (that.$yroute.query.id !== undefined) {
that.cartid = that.$yroute.query.id
if (that.pageQuery.id !== undefined) {
that.cartid = that.pageQuery.id
console.log(that.cartid)
}
if (that.$yroute.query.lotteryRecordId !== undefined) {
that.lotteryRecordId = that.$yroute.query.lotteryRecordId
if (that.pageQuery.lotteryRecordId !== undefined) {
that.lotteryRecordId = that.pageQuery.lotteryRecordId
}
that.hasCoupon = opts.couponId !== ''
that.hasCoupon = !!(opts && opts.couponId !== '')
that.getCartInfo()
},
onShow() {
@@ -452,6 +454,37 @@ export default {
},
methods: {
isNullOrEmpty,
resolvePageQuery() {
if (this.$yroute && this.$yroute.query) {
return this.$yroute.query
}
if (this.$route && this.$route.query) {
return this.$route.query
}
if (this._route && this._route.query) {
return this._route.query
}
return {}
},
isLotteryOrder() {
const cartInfo = Array.isArray(this.orderGroupInfo && this.orderGroupInfo.cartInfo)
? this.orderGroupInfo.cartInfo
: []
return Boolean(
this.lotteryRecordId ||
this.pageQuery.from === 'countyLottery' ||
Number(this.pageQuery.drawActivityId || 0) > 0 ||
cartInfo.some(item => Number(
item.drawActivityId ||
(item.productInfo && item.productInfo.drawActivityId) ||
0
) > 0)
)
},
getOrderCouponId() {
if (this.isLotteryOrder()) return 0
return this.couponList.usable.length === 0 ? 0 : (this.couponId || 0)
},
couponMax(e) {
// this.couponTitle = e.couponTitle
// this.couponId = this.$yroute.query.couponId || uni.getStorageSync('couponId') || 0
@@ -477,12 +510,17 @@ export default {
postOrderComputed(this.orderGroupInfo.orderKey, {
addressId: this.addressInfo.id,
useIntegral: this.useIntegral ? 1 : 0,
couponId: this.couponList.usable.length === 0 ? 0 : this.couponId,
couponId: this.getOrderCouponId(),
usePoints: this.usePointsCheck ? 1 : 0,
shipping_type: parseInt(this.shipping_type) + 1
}).then(res => {
this.couponList = res.data.result.couponList
if(!f) {
if (this.isLotteryOrder()) {
this.couponTitle = ''
if (this.couponId !== 0) {
this.couponId = 0
}
} else if(!f) {
this.couponId = res.data.result.defaultCouponId
}
const data = res.data;
@@ -543,8 +581,8 @@ export default {
}
_this.systemStore = data.systemStore || {}
_this.storeSelfMention = data.storeSelfMention
if(_this.$yroute.query.address !== undefined ) {
_this.addressInfo = JSON.parse(_this.$yroute.query.address) || {}
if(_this.pageQuery.address !== undefined ) {
_this.addressInfo = JSON.parse(_this.pageQuery.address) || {}
_this.computedPrice()
} else {
// _this.addressInfo = uni.getStorageSync('sourceAddress') || data.addressInfo || {}
@@ -683,7 +721,7 @@ export default {
phone: this.contactsTel,
addressId: this.addressInfo.id,
useIntegral: this.useIntegral ? 1 : 0,
couponId: this.couponList.usable.length === 0 ? 0 : this.couponId || 0,
couponId: this.getOrderCouponId(),
usePoints: this.usePointsNumber || 0,
payType: this.active,
pinkId: this.pinkId,
@@ -811,11 +849,13 @@ export default {
this.show = !this.show
},
showCouponsPopup() {
if (this.isLotteryOrder()) return
if (this.couponList.usable.length === 0) return
this.show = !this.show
},
// v9-2
changeCoupons(item) {
if (this.isLotteryOrder()) return
if(!item) return
if (this.couponList.usable.length === 0) return
this.show = !this.show
+60 -54
View File
@@ -32,9 +32,9 @@
<image :src="webUrl+'/20210806121714655368.png'" mode="" style="width: 36rpx;height: 36rpx;"></image>
</view>
</view>
<view v-if="couponListLimit2ToShow.length > 0 || attr.productSelect.earnPoints" class="v12-mt-1 v12-mb-1">
<view v-if="(!isCountyLotteryGoodsDetail() && couponListLimit2ToShow.length > 0) || attr.productSelect.earnPoints" class="v12-mt-1 v12-mb-1">
<view class="cell flex jc-between ai-center">
<view v-if="couponListLimit2ToShow.length > 0" class="v12-justify-start">
<view v-if="!isCountyLotteryGoodsDetail() && couponListLimit2ToShow.length > 0" class="v12-justify-start">
<view
v-for="(item, index) in couponListLimit2ToShow"
:key="index"
@@ -48,7 +48,7 @@
</view>
<view
v-if="couponListLimit2ToShow.length > 0"
v-if="!isCountyLotteryGoodsDetail() && couponListLimit2ToShow.length > 0"
class="value value2 v12-font-24 v12-primary-text"
@click="changeCoupons()"
>
@@ -201,7 +201,7 @@
</view>
<!-- v9 优惠券开始 -->
<u-popup :show="show" :round="10" mode="bottom" closeOnClickOverlay @close="changeCoupons()">
<u-popup v-if="!isCountyLotteryGoodsDetail()" :show="show" :round="10" mode="bottom" closeOnClickOverlay @close="changeCoupons()">
<CouponsPopup
:two-list="couponList"
@ok="setCoupon"
@@ -540,7 +540,7 @@ import {
getProductSkuBySelected
} from '@/api/store'
import { userBindParent } from '@/api/user'
import { handleQrCode, isWeixin } from '@/utils'
import { handleLoginFailure, handleQrCode, isWeixin } from '@/utils'
import { getHomeData } from '@/api/public'
import {
getDailyGoods,
@@ -655,7 +655,8 @@ export default {
pageKeyId: '',
couponListLimit2ToShow: [],
qualifications: [],
couponId: null
couponId: null,
submitActionLock: false
}
},
computed: mapGetters(['isLogin', 'location', 'userInfo']),
@@ -731,6 +732,7 @@ export default {
console.log("getLaunchOptionsSync", uni.getLaunchOptionsSync())
console.log("getEnterOptionsSync", uni.getEnterOptionsSync())
uni.removeStorageSync('couponId')
const pageQuery = Object.assign({}, this.resolvePageQuery(), options || {})
const from = options.from
const id = options.id
switch (from) {
@@ -778,10 +780,10 @@ export default {
if (url && url.productId) {
this.id = url.productId
} else if (options.id) {
this.id = options.id || null
this.partnerId = options.partnerId || null
this.activityId = this._route.query.activityId
this.source = this._route.query.from || ''
this.id = pageQuery.id || options.id || null
this.partnerId = pageQuery.partnerId || options.partnerId || null
this.activityId = Number(pageQuery.activityId || pageQuery.drawActivityId || 0)
this.source = pageQuery.from || ''
} else {
const obj = uni.getEnterOptionsSync()
if (options.scene != null || obj.query.scene != null) {
@@ -821,6 +823,7 @@ export default {
}
},
onShow() {
this.submitActionLock = false
this.getMapData()
getGiftCardSendBackground().then(res => {
if (res.status === 200) {
@@ -845,6 +848,18 @@ export default {
}
},
methods: {
resolvePageQuery() {
if (this.$yroute && this.$yroute.query) {
return this.$yroute.query
}
if (this.$route && this.$route.query) {
return this.$route.query
}
if (this._route && this._route.query) {
return this._route.query
}
return {}
},
gift() {
this.goCat(2)
},
@@ -876,6 +891,15 @@ export default {
})
},
goRoom() {
if (!this.isLogin) {
uni.showToast({
title: '请先登录后联系客服',
icon: 'none',
duration: 2000
})
handleLoginFailure()
return
}
console.log(this.storeInfo);
const params = {
goodsId: this.id,
@@ -1500,17 +1524,29 @@ export default {
q.drawActivityId = Number(this.activityId || 0)
break
}
if (that.submitActionLock) {
return
}
that.submitActionLock = true
postCartAdd(q).then(function (res) {
that.isOpen = false
that.attr.cartAttr = false
if (news === 1) {
const orderQuery = {
id: res.data.cartId,
discount: that.storeInfo.discount,
}
if (that.source === 'countyLottery') {
orderQuery.from = 'countyLottery'
orderQuery.drawActivityId = Number(that.activityId || 0)
}
that.$yrouter.push({
path: "/pages/order/OrderSubmission/index",
query: {
id: res.data.cartId,
discount: that.storeInfo.discount,
}
query: orderQuery
})
setTimeout(() => {
that.submitActionLock = false
}, 1500)
return
}
if(news === 2) {
@@ -1527,8 +1563,12 @@ export default {
// + '&couponId=' + coupId
url: giftUrl
})
setTimeout(() => {
that.submitActionLock = false
}, 1500)
}
if(news === 0) {
that.submitActionLock = false
uni.showToast({
title: "添加购物车成功",
icon: "success",
@@ -1541,6 +1581,7 @@ export default {
}
}).catch(error => {
that.isOpen = false;
that.submitActionLock = false
uni.showToast({
title: error.msg,
icon: "none",
@@ -1576,11 +1617,16 @@ export default {
listenerActionClose() {
this.posters = false
},
isCountyLotteryGoodsDetail() {
return this.source === 'countyLottery' && Number(this.activityId || 0) > 0
},
// v9-2
changeCoupons(e) {
if (this.isCountyLotteryGoodsDetail()) return
this.show = !this.show
},
setCoupon(couponId) {
if (this.isCountyLotteryGoodsDetail()) return
this.couponId = couponId
},
async checkFavorite() {
@@ -2248,43 +2294,3 @@ export default {
word-break: keep-all;
}
</style>
}
.gift-wrap{
position: relative;
}
.gift-bg{
position: absolute;
left: 0;
width: 100%;
}
.ll-text{
margin-left: 250rpx;
word-break: keep-all;
}
</style>
.gift-img{
width: 34rpx;
height: 34rpx;
margin-right: 10rpx;
}
.gift-wrap{
position: relative;
}
.gift-bg{
position: absolute;
left: 0;
width: 100%;
}
.ll-text{
margin-left: 250rpx;
word-break: keep-all;
}
</style>
left: 0;
width: 100%;
}
.ll-text{
margin-left: 250rpx;
word-break: keep-all;
}
</style>
+7 -1
View File
@@ -588,7 +588,8 @@ export default {
pageKeyId: '',
shareImg: '',
videoPlayers: [],
isView: false
isView: false,
skipRefreshOnShow: false
}
},
// 必须在页面加 onPageScroll(e){} ,才能滑动显示背景
@@ -679,6 +680,10 @@ export default {
if (!this.isLoad) {
return
}
if (this.skipRefreshOnShow) {
this.skipRefreshOnShow = false
return
}
this.fetchInnDetail()
if(this.isView) return
if(this.activeIndex === 1) {
@@ -834,6 +839,7 @@ export default {
})
},
infoClick: function (info) {
this.skipRefreshOnShow = true
this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id)
},
coverPlay(){
+44 -3
View File
@@ -554,8 +554,9 @@
</view>
</template>
<template v-if="status.type == -1">
<view style="width: 100%">
<view class="v12-justify-between" style="width: 100%">
<view class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view>
<view class="bnt v12-primary-text v12-primary-border cancel" @click="cancelRefund">取消退款</view>
</view>
</template>
<template v-if="status.type == -2">
@@ -570,7 +571,11 @@
<view class="v12-justify-between ">
<view class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view>
<view class="bnt v12-primary-text v12-primary-border" @click="routerGo(orderInfo.cartInfo[0])">立即评价</view>
<view
v-if="!isGiftOrder(orderInfo)"
class="bnt v12-primary-text v12-primary-border"
@click="routerGo(orderInfo.cartInfo[0])"
>立即评价</view>
</view>
</view>
</template>
@@ -654,7 +659,7 @@
<script>
import passkeyborad from '@/components/yzc-paykeyboard/yzc-paykeyboard'
import OrderGoods from "@/components/OrderGoods";
import {orderDetail, orderDelay, aginConfirm, express, applyEditAddress, orderExpectedArrivalTime, groupOrderDetail} from "@/api/order";
import {orderDetail, orderDelay, aginConfirm, express, applyEditAddress, orderExpectedArrivalTime, groupOrderDetail, cancelOrderRefund} from "@/api/order";
import Payment from "@/components/Payment";
import DataFormat from "@/components/DataFormat";
import {copyClipboard} from "@/utils";
@@ -1056,6 +1061,9 @@ export default {
}
return imgUrl;
},
isGiftOrder(order = {}) {
return Number(order.isGiftCardSend || 0) === 1 || Number(order.isGiftCardReceive || 0) === 1
},
subscribePay() {
uni.requestSubscribeMessage({
tmplIds: settings.SubscribeMessageTmplIds,
@@ -1166,6 +1174,39 @@ export default {
this.getDetail();
});
},
cancelRefund() {
uni.showModal({
title: '取消退款申请',
content: '确认取消退款申请吗?',
showCancel: true,
cancelText: '再想想',
confirmText: '确认取消',
confirmColor: '#C52733 ',
success: (res) => {
if (!res.confirm) return;
uni.showLoading({
title: '取消中'
});
cancelOrderRefund(this.orderInfo.orderId).then((res) => {
uni.showToast({
title: res.msg || '已取消退款申请',
icon: 'none',
duration: 2000
});
this.getDetail();
}).catch((err) => {
const message = err.msg || (err.response && err.response.data && (err.response.data.msg || err.response.data.message)) || '取消退款失败';
uni.showToast({
title: message,
icon: 'none',
duration: 3000
});
}).finally(() => {
uni.hideLoading();
});
}
});
},
takeOrder() {
takeOrderHandle(this.orderInfo.orderId).finally(() => {
this.getDetail();
+68
View File
@@ -29,6 +29,13 @@
</view>
<view class="card form-card">
<view class="form-card-header">
<view class="form-card-title">填写收货地址</view>
<view class="select-address-entry" @click="chooseExistingAddress">
<text class="select-address-text" style="margin-bottom: 4rpx;">选择现有地址 </text>
<u-icon name="arrow-right" size="14" color="#BD3124"></u-icon>
</view>
</view>
<view class="form-row">
<text class="label">收货人</text>
<input v-model="form.realName" class="input" placeholder="请填写收货人" placeholder-style="color:#b2b2b2;" />
@@ -190,6 +197,7 @@ export default {
this.fetchRealnameStatus()
},
onShow() {
this.handleChooseAddress()
const done = uni.getStorageSync('countyClaimAuthDone')
const needAutoSubmit = uni.getStorageSync('countyClaimNeedAutoSubmit')
if (done && (this.waitSubmitAfterRealname || needAutoSubmit)) {
@@ -219,6 +227,41 @@ export default {
goBack() {
uni.navigateBack()
},
chooseExistingAddress() {
uni.setStorageSync('sourceAddress', {
realName: this.form.realName || '',
phone: this.form.phone || '',
userAddress: `${this.address.province || ''}${this.address.city || ''}${this.address.district || ''}${this.form.detail || ''}`,
province: this.address.province || '',
city: this.address.city || '',
district: this.address.district || '',
detail: this.form.detail || ''
})
this.$yrouter.push({
path: '/pages/user/address/AddressManagement/index',
query: {
choosMode: 1
}
})
},
handleChooseAddress() {
const chooseAddress = uni.getStorageSync('chooseAddress') || {}
if (!chooseAddress.id) return
uni.setStorageSync('chooseAddress', {})
this.fillAddressForm(chooseAddress)
},
fillAddressForm(address = {}) {
this.form.realName = address.realName || address.real_name || ''
this.form.phone = address.phone || ''
this.form.detail = address.detail || ''
this.address = {
province: address.province || '',
city: address.city || '',
district: address.district || '',
city_id: address.city_id || address.cityId || address.city_id
}
this.addressText = `${this.address.province} ${this.address.city} ${this.address.district}`.trim()
},
getCityList() {
getCity().then(res => {
this.district = res.data || []
@@ -585,6 +628,31 @@ export default {
padding: 0 24rpx 24rpx;
}
.form-card-header {
min-height: 88rpx;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 2rpx dashed #e5e5e5;
}
.form-card-title {
color: #262626;
font-size: 30rpx;
font-weight: 700;
}
.select-address-entry {
display: flex;
align-items: center;
color: #BD3124;
}
.select-address-text {
font-size: 26rpx;
margin-right: 8rpx;
}
.form-row {
min-height: 92rpx;
display: flex;
+1 -2
View File
@@ -284,8 +284,7 @@ export default {
return [1, 2, -1].includes(Number(item.status)) && !!item.prizeName
},
getInvalidReason(item) {
if (Number(item.claimStatus) === -1) return '奖品过期未领取'
return '订单取消'
return item.invalidReason || ''
},
formatPrizeText(item = {}) {
const prizeName = item.prizeName || '神秘奖品'
+3 -3
View File
@@ -6,21 +6,21 @@
mode="scaleToFill"
/>
<image
v-show="partnerType === 'province_partner' || partnerType === ''"
v-show="partnerType === 'province_partner' || partnerType === '' || partnerType === 'county_agent'"
:src="images.goodSupplierImage"
class="img-item"
mode="widthFix"
@click="goto('goods_supplier')"
/>
<image
v-show="partnerType === 'pioneer' || partnerType === ''"
v-show="partnerType === 'pioneer' || partnerType === '' || partnerType === 'county_agent'"
:src="images.wenwanSupplierImage"
class="img-item"
mode="widthFix"
@click="goto('wenwan_supplier')"
/>
<image
v-show="partnerType === 'pioneer' || partnerType === ''"
v-show="partnerType === 'pioneer' || partnerType === '' || partnerType === 'county_agent'"
:src="images.hotelImage"
class="img-item"
mode="widthFix"
@@ -0,0 +1,374 @@
<template>
<view class="graphic-guide-page">
<hx-navbar
:fixed="true"
:background-color="[0,[0,0,0,0],[0,0,0,0]]"
statusBarFontColor="#ffffff"
barPlaceholder="hidden"
transparent="auto"
color="#ffffff"
/>
<view v-if="isLoad">
<swiper
v-if="bannerImages.length"
class="banner-swiper"
circular
autoplay
:interval="5000"
>
<swiper-item
v-for="(item, index) in bannerImages"
:key="index"
>
<image
:src="item"
class="banner-image"
mode="aspectFill"
/>
</swiper-item>
</swiper>
<image
v-else-if="detail.image"
:src="detail.image"
class="banner-fallback"
mode="aspectFill"
/>
<view class="article-card">
<view class="article-title">{{ detail.title || '' }}</view>
<view v-if="detail.intro" class="article-intro">
{{ detail.intro }}
</view>
</view>
<view
v-for="(item, index) in detailList"
:key="index"
class="detail-card"
>
<view v-if="item.placeName" class="section-title">
{{ item.placeName }}
</view>
<view v-if="item.content" class="rich-content">
<u-parse :content="item.content" />
</view>
<view
v-if="item.hotelId"
class="shop-card"
@click="goShop(item)"
>
<image
:src="item.hotelLogo || detail.image"
class="shop-logo"
mode="aspectFill"
/>
<view class="shop-main">
<view class="shop-name">{{ item.hotelName || '关联店铺' }}</view>
<view v-if="getServiceTime(item)" class="shop-time-pill">
经营时间{{ getServiceTime(item) }}
</view>
<view v-if="item.hotelAddress" class="shop-address">
{{ item.hotelAddress }}
</view>
</view>
<view class="shop-btn">点击进入</view>
</view>
<view v-if="item.address" class="section-address">
<text>定位{{ item.address }}</text>
</view>
<scroll-view
v-if="item.images && item.images.length"
class="image-scroll"
scroll-x
show-scrollbar="false"
>
<view class="image-list">
<image
v-for="(img, imgIndex) in item.images"
:key="imgIndex"
:src="img"
class="detail-image"
mode="aspectFill"
@click="previewImage(item.images, imgIndex)"
/>
</view>
</scroll-view>
</view>
<view v-if="!detailList.length" class="empty-text">暂无图文内容</view>
</view>
<goo-skeleton v-else />
</view>
</template>
<script>
import { getCountyFamousGraphicGuideContent } from '@/api/qianxian'
export default {
name: 'FamousQianxianGraphicGuide',
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
isLoad: false,
detail: {}
}
},
computed: {
bannerImages() {
return this.detail.bannerImages || []
},
detailList() {
return this.detail.graphicDetails || []
}
},
onLoad(options) {
const id = options.id
if (!id) {
uni.showToast({
title: '缺少攻略ID',
icon: 'none'
})
return
}
this.getDetailReq(id)
},
methods: {
getDetailReq(id) {
getCountyFamousGraphicGuideContent({
guideId: id
}).then(res => {
const { success, data } = res
if (success) {
this.detail = data || {}
uni.setNavigationBarTitle({
title: this.detail.title || '攻略详情'
})
}
}).finally(() => {
this.isLoad = true
})
},
formatDate(time) {
if (!time) return ''
return time.replace(/-/g, '.').slice(0, 10)
},
previewImage(images = [], index = 0) {
if (!images.length) return
uni.previewImage({
urls: images,
current: index
})
},
getServiceTime(item) {
const start = item.serviceTime || ''
const end = item.serviceEndTime || ''
if (start && end) return `${start}-${end}`
return start || end || ''
},
goShop(item) {
if (!item || !item.hotelId) return
this.$yrouter.push({
path: '/pagesInn/inn/innHome',
query: {
id: item.hotelId
}
})
}
}
}
</script>
<style scoped lang="less">
.graphic-guide-page {
min-height: 100vh;
background: #f6f6f6;
}
.banner-swiper,
.banner-fallback {
width: 100%;
height: 750rpx;
}
.banner-image {
display: block;
width: 100%;
height: 100%;
}
.article-card {
padding: 28rpx 24rpx 32rpx;
position: relative;
z-index: 2;
border-radius: 24rpx;
background: #fff;
}
.article-title {
font-size: 40rpx;
line-height: 56rpx;
color: #333;
font-weight: bold;
}
.article-meta {
margin-top: 12rpx;
font-size: 24rpx;
color: #333;
}
.article-intro {
margin-top: 20rpx;
padding: 20rpx 0rpx;
border-radius: 16rpx;
font-size: 30rpx;
line-height: 44rpx;
color: #333;
font-weight: bold;
}
.detail-card {
padding: 28rpx 24rpx;
border-radius: 24rpx;
background: #fff;
}
.section-title {
font-size: 36rpx;
line-height: 50rpx;
color: #333;
font-weight: bold;
}
.section-address {
display: flex;
align-items: center;
margin-top: 16rpx;
font-size: 30rpx;
line-height: 40rpx;
color: #333;
font-weight: bold;
}
.address-icon {
width: 28rpx;
height: 28rpx;
margin-right: 8rpx;
flex-shrink: 0;
}
.image-list {
display: inline-flex;
flex-wrap: nowrap;
}
.image-scroll {
width: 100%;
margin-top: 24rpx;
white-space: nowrap;
}
.detail-image {
width: 280rpx;
height: 280rpx;
margin-right: 16rpx;
border-radius: 16rpx;
display: block;
}
.detail-image:last-child {
margin-right: 0;
}
.rich-content {
margin-top: 12rpx;
font-size: 28rpx;
line-height: 46rpx;
color: #333;
word-break: break-word;
}
.shop-card {
display: flex;
align-items: center;
margin-top: 12rpx;
padding: 16rpx;
border-radius: 16rpx;
background: #f4f4f4;
}
.shop-logo {
width: 140rpx;
height: 140rpx;
border-radius: 12rpx;
flex-shrink: 0;
}
.shop-main {
flex: 1;
min-width: 0;
margin-left: 20rpx;
display: flex;
flex-direction: column;
justify-content: center;
}
.shop-head {
display: flex;
flex-direction: column;
align-items: flex-start;
}
.shop-name {
font-size: 32rpx;
color: #333;
font-weight: bold;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.shop-time-pill {
display: inline-flex;
align-items: center;
margin-top: 10rpx;
padding: 4rpx 16rpx;
border: 2rpx solid #c52733;
border-radius: 100rpx;
color: #c52733;
font-size: 22rpx;
width: fit-content;
background: transparent;
}
.shop-time-label {
margin-right: 8rpx;
font-weight: bold;
}
.shop-address {
margin-top: 12rpx;
font-size: 24rpx;
line-height: 34rpx;
color: #666;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.shop-btn {
margin-left: 20rpx;
padding: 12rpx 24rpx;
border-radius: 100rpx;
background: #c52733;
color: #fff;
font-size: 26rpx;
font-weight: 500;
flex-shrink: 0;
}
.empty-text {
padding: 120rpx 0;
text-align: center;
font-size: 28rpx;
color: #999;
}
</style>
+7 -1
View File
@@ -1820,7 +1820,13 @@ export default {
this.hotelItemClick({ id: linkHotelId })
},
guideItemClickHandle(item) {
// 如果没有开启专题页,则不进入
if (!item || !item.id) return
const guideType = item.guideType || 'topic'
if (guideType === 'graphic') {
uni.navigateTo({ url: `/pkg_product/views/famousQianxianGraphicGuide?id=${item.id}` })
return
}
// topic 类型保持原逻辑
if (!item.isContentPage) return
uni.navigateTo({ url: `/pkg_product/views/famousQianxianTheme?id=${item.id}` })
},
+4
View File
@@ -309,6 +309,10 @@ export default {
// console.log(searchMap);
const filterMap = searchMap.filter(el => el.cityName.includes(this.keyword))
if(filterMap.length === 0) {
uni.showToast({
title: '未找到该城市,请重新输入城市名称',
icon: 'none'
})
return
} else {
this.asideIndex = filterMap[0].index
+67 -11
View File
@@ -95,7 +95,7 @@
<text class="v12-dark-text v12-font-30">{{ computedResult.discountPrice }}</text>
</view>
</view>
<view class="v12-justify-between v12-align-center v12-font-28 v12-mt-1">
<view v-if="!isCountyLotteryGift" class="v12-justify-between v12-align-center v12-font-28 v12-mt-1">
<view class="v12-font-24 v12-dark-text v12-align-center">
<view class="">
优惠券
@@ -163,6 +163,7 @@
@confirm="onPayConfirm"
/>
<u-popup
v-if="!isCountyLotteryGift"
:show="showPopup"
:round="10"
mode="bottom"
@@ -281,6 +282,13 @@ export default {
},
watch: {
async couponId(value) {
if (this.isCountyLotteryGift) {
this.couponTitle = ''
if (Number(value || 0) !== 0) {
this.couponId = 0
return
}
}
this.couponIndex = this.couponList['usable']?.findIndex(item => item.id === +value)
this.couponTitle = this.couponList['usable']?.[this.couponIndex]?.couponTitle
if(this.isGroupBuy) {
@@ -291,11 +299,12 @@ export default {
}
},
onLoad(opts) {
this.cartId = opts.cartId
this.isGroupBuy = opts.isGroupBuy === '1'
this.isCountyLotteryGift = opts.from === 'countyLottery' || opts.isCountyLotteryGift === '1' || !!opts.drawActivityId
const pageQuery = Object.assign({}, this.resolvePageQuery(), opts || {})
this.cartId = pageQuery.cartId
this.isGroupBuy = pageQuery.isGroupBuy === '1'
this.isCountyLotteryGift = pageQuery.from === 'countyLottery' || pageQuery.isCountyLotteryGift === '1' || !!pageQuery.drawActivityId
// this.couponId = opts.couponId || 0
this.discount = opts.discount
this.discount = pageQuery.discount
if(this.isGroupBuy) {
this.getGroupBuyInfo()
} else {
@@ -324,6 +333,39 @@ export default {
}
},
methods: {
resolvePageQuery() {
if (this.$yroute && this.$yroute.query) {
return this.$yroute.query
}
if (this.$route && this.$route.query) {
return this.$route.query
}
if (this._route && this._route.query) {
return this._route.query
}
return {}
},
getCouponId() {
if (this.isCountyLotteryGift) return 0
return this.couponId || 0
},
isCountyLotteryCartItem(item) {
return Number(
(item && item.drawActivityId) ||
(item && item.productInfo && item.productInfo.drawActivityId) ||
0
) > 0
},
syncCountyLotteryGiftFlag(item) {
if (!this.isCountyLotteryGift && this.isCountyLotteryCartItem(item)) {
this.isCountyLotteryGift = true
}
if (!this.isCountyLotteryGift) return
this.couponTitle = ''
if (Number(this.couponId || 0) !== 0) {
this.couponId = 0
}
},
adjustCoverListForProductStory(coverList, productInfo, defaultTemplate) {
if (!productInfo || !productInfo.productStory) {
return {
@@ -356,14 +398,19 @@ export default {
computedTravelGroupPrice(useDefaultCouponId) {
const params = {
key: this.orderKey,
couponId: this.couponId
couponId: this.getCouponId()
}
computedSojoumGroupBuyGiftOrderPrice(params).then(res => {
this.computedResult = res.data.result
this.couponList = res.data.result.couponList
this.payPrice = res.data.result.payPrice
this.$forceUpdate()
if(useDefaultCouponId) {
if (this.isCountyLotteryGift) {
this.couponTitle = ''
if (this.couponId !== 0) {
this.couponId = 0
}
} else if(useDefaultCouponId) {
this.couponId = res.data.result.defaultCouponId || 0
}
})
@@ -372,6 +419,7 @@ export default {
this.showCoverPicker = true
},
showCouponsPopup() {
if (this.isCountyLotteryGift) return
if (this.couponList.usable && this.couponList.usable.length === 0) return
if(this.isPayOk) return
this.showPopup = !this.showPopup
@@ -380,6 +428,7 @@ export default {
this.showPopup = !this.showPopup
},
changeCoupons(item) {
if (this.isCountyLotteryGift) return
if(!item) return
if (this.couponList.usable && this.couponList.usable.length === 0) return
this.showPopup = !this.showPopup
@@ -417,6 +466,7 @@ export default {
this.giftNotice = res.data.giftCardGiftNotice
this.orderKey = res.data.orderKey
this.goodsInfo = goodsInfo
this.syncCountyLotteryGiftFlag(goodsInfo)
this.templateId = template.id
this.defaultIndex = this.coverList.findIndex(item => item.id === this.templateId)
console.log(this.defaultIndex, 'defaultIndex');
@@ -448,7 +498,7 @@ export default {
computedPrice(num, f) {
const params = {
cartId: this.cartId,
couponId: this.couponId,
couponId: this.getCouponId(),
cartNum : num
}
if(this.discount) {
@@ -456,7 +506,12 @@ export default {
}
getGiftCardSendOrderAmount(this.orderKey, params).then(res => {
this.couponList = res.data.result.couponList
if(!f) {
if (this.isCountyLotteryGift) {
this.couponTitle = ''
if (this.couponId !== 0) {
this.couponId = 0
}
} else if(!f) {
this.couponId = res.data.result.defaultCouponId || 0
this.$forceUpdate()
}
@@ -498,6 +553,7 @@ export default {
this.giftNotice = res.data.giftCardGiftNotice
this.orderKey = res.data.orderKey
this.goodsInfo = goodsInfo
this.syncCountyLotteryGiftFlag(goodsInfo)
this.templateId = template.id
this.selectedCover = template.cover
this.giftImage = template.image
@@ -564,13 +620,13 @@ export default {
message : this.message || '礼笺轻启,礼藏心意',
canTransfer: this.canTransfer ? 1 : 0,
passwordPay: this.payPassword || '',
couponId: this.couponId,
couponId: this.getCouponId(),
payType: this.payType,
} : {
orderKey: this.orderKey,
from: 'routine',
cartId: this.cartId,
couponId: this.couponId,
couponId: this.getCouponId(),
recipientsNum: this.goodsInfo.cartNum,
templateId: this.templateId,
message : this.message || '礼笺轻启,礼藏心意',