diff --git a/aiChat/mixins/chatMixinsV2.js b/aiChat/mixins/chatMixinsV2.js index 224950a..a854680 100644 --- a/aiChat/mixins/chatMixinsV2.js +++ b/aiChat/mixins/chatMixinsV2.js @@ -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() { diff --git a/api/order.js b/api/order.js index 83dc391..18c0ca1 100644 --- a/api/order.js +++ b/api/order.js @@ -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 {*} diff --git a/api/qianxian.js b/api/qianxian.js index dd6b38a..0062b28 100644 --- a/api/qianxian.js +++ b/api/qianxian.js @@ -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 }) diff --git a/pages.json b/pages.json index ed7e8ae..92728cc 100644 --- a/pages.json +++ b/pages.json @@ -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": { diff --git a/pages/VideoPlayBackList/VideoPlayBackList.vue b/pages/VideoPlayBackList/VideoPlayBackList.vue index b006734..b2fd8c7 100644 --- a/pages/VideoPlayBackList/VideoPlayBackList.vue +++ b/pages/VideoPlayBackList/VideoPlayBackList.vue @@ -7,21 +7,23 @@ - - - - - {{ item.title }} - - - - {{ item.storeName }} + + + + + + {{ item.title }} + + + + {{ item.storeName }} + + - - - + + @@ -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 { } } } - \ No newline at end of file + diff --git a/pages/chose-city/chose-city.vue b/pages/chose-city/chose-city.vue index ce34a9c..3e80905 100644 --- a/pages/chose-city/chose-city.vue +++ b/pages/chose-city/chose-city.vue @@ -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 diff --git a/pages/home/newZone.vue b/pages/home/newZone.vue index c185413..a76ff92 100644 --- a/pages/home/newZone.vue +++ b/pages/home/newZone.vue @@ -36,7 +36,7 @@ - + @@ -53,6 +53,9 @@ + + 暂无数据 + { 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; diff --git a/pages/order/MyOrder/index.vue b/pages/order/MyOrder/index.vue index 8345232..79a070d 100644 --- a/pages/order/MyOrder/index.vue +++ b/pages/order/MyOrder/index.vue @@ -54,14 +54,14 @@ {{ (order.isGiftCardSend || order.isGiftCardReceive) ? '礼包' : (getStatus(order) || (order._status && order._status._title) || '已完成') }} - + @@ -334,17 +334,17 @@ 联系商家 去使用 删除订单 更多 联系商家 申请退款 @@ -378,7 +378,7 @@ 联系客服 @@ -389,18 +389,18 @@ parseInt(order._status._type) !== 9 " class="bnt service" - @click="goRoom(order)" + @click="goRoom(orderListIndex)" >联系商家 查看详情 删除订单 @@ -411,61 +411,61 @@ @@ -505,7 +505,7 @@ 联系商家 @@ -519,14 +519,14 @@ " open-type="share" class="gift-btn service v12-primary-text v12-primary-border" - @click="shareGift(order)" + @click="shareGift(orderListIndex)" >送给朋友 - 查看详情 + 查看详情 @@ -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}¶ms=${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) diff --git a/pages/order/OrderSubmission/index.vue b/pages/order/OrderSubmission/index.vue index c45c512..47422d0 100644 --- a/pages/order/OrderSubmission/index.vue +++ b/pages/order/OrderSubmission/index.vue @@ -117,7 +117,7 @@ {{ force2Decimal(orderPrice.payPostage) }} --> - + 优惠券 @@ -255,7 +255,7 @@ 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 diff --git a/pages/shop/GoodsCon/index.vue b/pages/shop/GoodsCon/index.vue index 1a8cd60..b2bd15f 100644 --- a/pages/shop/GoodsCon/index.vue +++ b/pages/shop/GoodsCon/index.vue @@ -32,9 +32,9 @@ - + - + @@ -201,7 +201,7 @@ - + { 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; } -} -.gift-wrap{ - position: relative; -} -.gift-bg{ - position: absolute; - left: 0; - width: 100%; -} -.ll-text{ - margin-left: 250rpx; - word-break: keep-all; -} - -.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; -} - - left: 0; - width: 100%; -} -.ll-text{ - margin-left: 250rpx; - word-break: keep-all; -} - diff --git a/pagesInn/inn/innHome.vue b/pagesInn/inn/innHome.vue index fc6fb98..7198152 100644 --- a/pagesInn/inn/innHome.vue +++ b/pagesInn/inn/innHome.vue @@ -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(){ diff --git a/pagesOrder/order/OrderDetails/index.vue b/pagesOrder/order/OrderDetails/index.vue index 75a6a23..4b427ed 100644 --- a/pagesOrder/order/OrderDetails/index.vue +++ b/pagesOrder/order/OrderDetails/index.vue @@ -554,8 +554,9 @@ @@ -654,7 +659,7 @@ + + diff --git a/pkg_product/views/famousQianxianShop.vue b/pkg_product/views/famousQianxianShop.vue index bcfca4b..5e1e572 100644 --- a/pkg_product/views/famousQianxianShop.vue +++ b/pkg_product/views/famousQianxianShop.vue @@ -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}` }) }, diff --git a/pkg_product/views/healthList.vue b/pkg_product/views/healthList.vue index 86837c3..0224766 100644 --- a/pkg_product/views/healthList.vue +++ b/pkg_product/views/healthList.vue @@ -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 diff --git a/pkg_user/views/gift/gift.vue b/pkg_user/views/gift/gift.vue index 25e87d8..dd26b6a 100644 --- a/pkg_user/views/gift/gift.vue +++ b/pkg_user/views/gift/gift.vue @@ -95,7 +95,7 @@ {{ computedResult.discountPrice }} - + 优惠券: @@ -163,6 +163,7 @@ @confirm="onPayConfirm" /> 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 || '礼笺轻启,礼藏心意',