Merge branch 'dev' into test

This commit is contained in:
lifizer
2026-04-13 15:32:21 +08:00
27 changed files with 4525 additions and 154 deletions
+3 -1
View File
@@ -2,7 +2,7 @@ import {
getSseConfigV1,
getCompletionsV2,
deleteChatItemByConversationId,
getAnalyzeKeywordsV1,
// getAnalyzeKeywordsV1,
getAnalyzeKeywordsChangeV1
} from '@/api/chat/index'
import { VUE_APP_API_URL } from '@/config'
@@ -230,6 +230,7 @@ export const chatMixins = {
_this.chatErrorSetContent()
})
})
/*
getAnalyzeKeywordsV1({
'chatNumber': _this.chatNumber,
conversationId,
@@ -256,6 +257,7 @@ export const chatMixins = {
console.log(_this.chatMessageList[_this.chatMessageListLength - 1])
}
})
*/
} else {
_this.chatErrorSetContent()
}
+16
View File
@@ -55,6 +55,22 @@ export function saveWholesaler(wholesalerInfo) {
return request.post("/merchantApply/wholesaler/submit", param, {login: true})
}
export function saveExperienceStore(params) {
return request.post("/merchantApply/experienceStore/submit", params, {login: true})
}
export function saveExperienceStoreDraft(params) {
return request.post("/merchantApply/experienceStore/saveDraft", params, {login: true})
}
export function getExperienceStoreCategoryList() {
return request.get("/experienceStore/categoryList", {}, {login: true})
}
export function getExperienceStoreInfo(params) {
return request.get("merchantApply/info/experienceStore", params, {login: true})
}
// 撤销入驻申请
export function removeApply() {
return request.post("/merchantApply/revoke")
+9
View File
@@ -188,6 +188,15 @@ export function editAddress(params) {
return request.post('/order/editAddress', params)
}
/**
* 申请修改订单收货地址
* @param {*} params
* @returns
*/
export function applyEditAddress(params) {
return request.post('/order/applyEditAddress', params)
}
/**
* 订单预计到达时间
* @param {*} params
+29 -1
View File
@@ -159,4 +159,32 @@ export function hadView(data) {
export function getShareImg(id) {
return request.get('/landmarkGoods/poster/' + id, {}, {login: false})
}
}
export function getLatestExperienceCoupon() {
return request.get('/experienceCoupon/latest', {}, {login: true})
}
export function getExperienceCouponList() {
return request.get('/experienceCoupon/list', {}, {login: true})
}
export function getExperienceCouponItems(params) {
return request.get('/experienceCoupon/items', params, {login: true})
}
export function getExperienceCouponCategoryList(params) {
return request.get('/experienceCoupon/categoryList', params, {login: true})
}
export function createExperienceCouponOrder(data) {
return request.post('/experienceCoupon/order/create', data, {login: true})
}
export function getExperienceCouponOrderDetail(orderId) {
return request.get(`/experienceCoupon/order/detail/${orderId}`, {}, {login: true})
}
export function checkExperienceCoupon(params) {
return request.get('/experienceCoupon/check', params, {login: true})
}
+17
View File
@@ -316,3 +316,20 @@ export function getCityShopList(params) {
export function getCountyFamousHotelType() {
return request.get('/countyFamous/hotelType', {}, {login: true})
}
/**
* б
* travelMerchantId int þ̻ID
* experienceStoreCategoryId int ID
*/
export function getExperienceStoreList(params) {
return request.get('/experienceStore/list', params, { login: true })
}
export function getExperienceStoreProject(experienceMerchantId) {
return request.get('/experienceStoreProject/' + experienceMerchantId, {}, { login: true })
}
export function getExperienceStoreDetail(id) {
return request.get('/experienceStore/detail/' + id, {}, { login: true })
}
+4
View File
@@ -295,4 +295,8 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked {
font-style: normal;
font-size: 28rpx;
color: #C2C5CC;
}
.bg-color-hui {
background-color: #999 !important;
}
+40 -1
View File
@@ -235,7 +235,8 @@
"path": "pages/order/MyOrder/index",
"style": {
"navigationBarTitleText": "我的订单",
"navigationBarBackgroundColor": "#fff"
"navigationBarBackgroundColor": "#fff",
"navigationStyle": "custom"
}
},
{
@@ -477,6 +478,13 @@
"navigationBarTitleText": "旅居商家入驻",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "views/experienceStore",
"style": {
"navigationBarTitleText": "体验店入驻",
"navigationBarBackgroundColor": "#FFFFFF"
}
}
]
},
@@ -730,6 +738,37 @@
"navigationBarTitleText": "时令尝鲜"
}
},
{
"path": "views/experienceCoupon",
"style": {
"navigationBarTitleText": "体验券详情",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "views/experienceCouponOrderDetail",
"style": {
"navigationBarTitleText": "订单核销",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "views/experienceProjectDetail",
"style": {
"navigationBarTitleText": "体验项目详情",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationStyle": "custom"
}
},
{
"path": "views/storeLicense",
"style": {
"navigationBarTitleText": "营业执照",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationStyle": "custom"
}
},
{
"path": "views/submitOrder",
"style": {
+37
View File
@@ -85,6 +85,17 @@
</view>
</scroll-view>
</view>
<view
v-if="hasExperienceCoupon && experienceCouponImage"
class="experience-coupon-banner"
@click="goExperienceCoupon"
>
<image
:src="experienceCouponImage"
mode="widthFix"
class="experience-coupon-img"
/>
</view>
<!-- 千县名品和地标好物 -->
<view
v-if="landmarkGoodsImage.image || countyFamousImage.image"
@@ -439,6 +450,10 @@ export default {
bastRightList: [],
// 尖货推荐横幅
bannerList: [],
// 体验券
hasExperienceCoupon: 0,
hasUnusedExperienceCoupon: 0,
experienceCouponImage: '',
// 老用户弹窗
isOldUser: true,
oldUserPopup: {},
@@ -1381,6 +1396,15 @@ export default {
toNewZone() {
this.$yrouter.push('/pages/home/newZone')
},
goExperienceCoupon() {
if (this.hasUnusedExperienceCoupon === 0) {
uni.navigateTo({
url: '/pages/order/MyOrder/index?type=3&tabIndex=1'
})
return
}
this.$yrouter.push('/pkg_product/views/experienceCoupon')
},
init() {
sharpBannar().then(res => {
const { data } = res
@@ -1429,6 +1453,9 @@ export default {
_this.$set(_this, 'contentHomestay', data.contentHomestayV2 || [])
_this.$set(_this, 'contentFestival', data.contentFestivalV2 || [])
_this.$set(_this, 'newZone', data.newGoods || [])
_this.$set(_this, 'hasExperienceCoupon', data.hasExperienceCoupon || 0)
_this.$set(_this, 'hasUnusedExperienceCoupon', data.hasUnusedExperienceCoupon || 0)
_this.$set(_this, 'experienceCouponImage', data.experienceCouponImage || '')
_this.$set(_this, 'isOldUserPopupShow', data.isOldUserPopupShow || 0)
_this.indexVideo = data.indexVideo ? data.indexVideo.videoUrl : ''
_this.bastLeftList = []
@@ -1802,6 +1829,16 @@ export default {
}
}
}
.experience-coupon-banner {
position: relative;
z-index: 5;
padding-top: 16rpx;
.experience-coupon-img {
display: block;
width: 100%;
border-radius: 20rpx;
}
}
.hotel-list-wrap {
position: relative;
width: 344rpx;
+324 -27
View File
@@ -1,5 +1,12 @@
<template>
<view class="my-order v12-mx-2" ref="container" @click="handleBody">
<u-navbar
title="我的订单"
:autoBack="false"
@leftClick="goUserCenter"
:fixed="true"
:placeholder="true"
/>
<view class="m-search-wrap v12-mb-2 v12-mt-3">
<u-search
v-model="keyword"
@@ -51,8 +58,27 @@
class="item"
>
<view
v-if="order.merName"
v-if="order.experienceOrderInfo"
class="shop-info flex jc-between ai-center"
style="padding-bottom: 0"
@click.stop="goStore(order)"
>
<view class="flex ai-center">
<image
:src="webUrl+'/orderIcon/shop.png'"
style="width: 32rpx;height: 32rpx"
/>
<text class="name v12-font-weight-400 v12-dark-text v12-font-24">{{ order.merName || order.storeName }}</text>
<image
:src="webUrl+'/orderIcon/arrow.png'"
style="width: 24rpx;height: 24rpx; margin-top: 5rpx"
/>
</view>
</view>
<view
v-if="order.merName && !order.experienceOrderInfo"
class="shop-info flex jc-between ai-center"
style="padding-bottom: 0"
@click="goStore(order)"
>
<view class="flex ai-center">
@@ -74,7 +100,16 @@
<text class="address v12-dark-text v12-font-bold v12-font-24">{{ order.merCityName }}</text>
</view>
</view>
<view class="title acea-row row-between-wrapper" style="padding: 0 0 0 30rpx !important;">
<view v-if="order.experienceOrderInfo" class="title acea-row row-between-wrapper" style="padding: 0 0 0 16rpx !important;">
<view class="acea-row row-middle">
订单号:{{ order.orderId }}
</view>
<view
class="font-color-white statusTag"
:class="{'v12-primary': order.experienceOrderStatus === 0, 'v12-primary': order.experienceOrderStatus === 1, 'bg-color-hui': order.experienceOrderStatus === 2}"
>{{ ['待使用', '已完成', '已过期'][order.experienceOrderStatus] }}</view>
</view>
<view v-if="!order.experienceOrderInfo" class="title acea-row row-between-wrapper" style="padding: 0 0 0 16rpx !important;">
<view class="acea-row row-middle">
<text
v-if="order.combinationId || order.seckillId || order.bargainId || order.storeId"
@@ -118,7 +153,7 @@
:src="order.travelGroupOrderInfo.travelGroupProduct.mainImage"
/>
</view>
<view class="text">
<view class="text" style="margin-top: 0 !important;">
<view class="acea-row name-wrap">
<view class="name more-t v12-font-bold">{{ order.travelGroupOrderInfo.travelGroupProduct.name }}</view>
<view class="money">
@@ -132,6 +167,25 @@
</view>
</view>
</view>
<view v-else-if="order.experienceOrderInfo">
<view class="item-info acea-row row-between row-top ssj">
<view class="pictrue">
<image :src="order.experienceOrderInfo.themeImage" />
</view>
<view class="text" style="margin-top: 0 !important;">
<view class="acea-row name-wrap">
<view class="name one-t v12-font-bold">{{ order.experienceOrderInfo.themeName }}</view>
</view>
<view class="v12-secondary-dark-text v12-font-24" style="margin-top: 10rpx;">
有效期至{{ order.experienceOrderInfo.endTime }}
</view>
<view class="v12-secondary-dark-text v12-font-24 flex ai-center" style="margin:10rpx 0;" v-if="order.distance || order.experienceOrderInfo.distance">
<image :src="webUrl+'/orderIcon/map.png'" style="width: 24rpx;height: 24rpx;margin-right: 6rpx;" />
<text>距该地{{ order.distance || order.experienceOrderInfo.distance }}</text>
</view>
</view>
</view>
</view>
<view v-else>
<view
v-for="(cart,cartInfoIndex) in order.cartInfo"
@@ -160,7 +214,7 @@
@click.stop="gotoGoodDetail(cart, 4, { id: cart.seckillId })"
/>
</view>
<view class="text">
<view class="text" style="margin-top: 0 !important;">
<view class="acea-row name-wrap">
<view class="name more-t v12-font-bold">{{ cart.productInfo.storeName }}</view>
<view class="money">
@@ -183,7 +237,7 @@
</view>
</view>
</view>
<view class="totalPrice acea-row row-between row-middle" :style="{'padding-bottom': order.isTravelGroup === 1 ? '0rpx !important' : '30rpx'}">
<view v-if="!order.experienceOrderInfo" class="totalPrice acea-row row-between row-middle" :style="{'padding-bottom': order.isTravelGroup === 1 ? '0rpx !important' : '30rpx'}">
<view v-if="order.createTime">
<span class="orderTime v12-font-24 v12-dark1-text">{{ order.createTime }}</span>
</view>
@@ -208,7 +262,7 @@
入住时间: {{ order.travelGroupOrderInfo.orderStartDate }}
</text>
</view>
<view v-if="order._status && ['1'].includes(order._status._type) && order.confirmTimeout" class="v12-ml-4 v12-mb-2" >
<view v-if="!order.experienceOrderInfo && order._status && ['1'].includes(order._status._type) && order.confirmTimeout" class="v12-ml-4 v12-mb-2" >
<view class="v12-primary-text v12-font-24 v12-align-center">
等待商家确认时间剩余
<u-count-down format="HH:mm:ss" autoStart :time="$global.diffSSS(order.confirmTimeout)" />
@@ -216,7 +270,27 @@
</view>
</view>
<view
v-if="!order.isGiftCardSend"
v-if="order.experienceOrderInfo"
class="bottom flex jc-end ai-center"
>
<view
v-if="order.experienceOrderStatus === 0 || order.experienceOrderStatus === 1"
class="bnt service"
@click.stop="goRoom(order)"
>联系商家</view>
<view
v-if="order.experienceOrderStatus === 0"
class="bnt v12-primary v12-white-text v12-primary-border v12-radius-40"
@click.stop="goOrderDetails(order)"
>去使用</view>
<view
v-if="order.experienceOrderStatus === 1 || order.experienceOrderStatus === 2"
class="bnt service"
@click.stop="delOrder(order)"
>删除订单</view>
</view>
<view
v-if="!order.isGiftCardSend && !order.experienceOrderInfo"
class="bottom flex jc-between ai-center"
>
<view
@@ -294,6 +368,11 @@
class="bnt service"
@click="applyRefund(order)"
>{{ '申请退款' }}</view>
<view
v-if="canShowModifyAddress(order)"
class="bnt service"
@click="addressTap(order)"
>修改地址</view>
<view
class="bnt service"
:class="{'v12-primary-text v12-primary-border': order.isTravelGroup === 1}"
@@ -352,7 +431,7 @@
</template>
</view>
</view>
<view class="bottom" v-else>
<view class="bottom" v-else-if="order.isGiftCardSend">
<view class="v12-font-24 v12-grey tips-text" >
{{ Number(order.status) === 0 ? '待支付' : getGiftTips(order.giftCardInfo) }}
</view>
@@ -366,6 +445,7 @@
<view class="v12-align-center">
<button
v-if="Number(order.status) !== 0 &&
order.giftCardInfo &&
order.giftCardInfo.giftCardStatus !== 9 &&
getGiftTips(order.giftCardInfo) &&
order.giftCardInfo.giftCardStatus !== 2 &&
@@ -385,13 +465,28 @@
</view>
</view>
<view
v-if="parseInt(order._status._type) === 1 && order.isFastPost !== 0"
v-if="parseInt(order._status._type) === 1 && order.isFastPost !== 0 && Number(order.isAddressUpdate || 0) === 0"
class="v12-px-3 v12-pb-4"
>
<view
class="v12-font-22 v12-secondary-dark-text order-tips"
>商家已接收您的订单,支付成功后预计{{ getTime(order.isFastPost) }}发货</view>
</view>
<view
v-if="!isRefundFlow(order) && Number(order.isAddressUpdate) === 1 && [0, 2].includes(Number(order.addressUpdateStatus))"
class="v12-px-3 v12-pb-4"
>
<view
v-if="Number(order.addressUpdateStatus) === 0"
class="v12-font-24 v12-primary-text"
style="background: rgba(246,246,246,0.7); border-radius: 40rpx; padding: 12rpx;"
>修改地址正在审核中,请耐心等待</view>
<view
v-if="Number(order.addressUpdateStatus) === 2"
class="v12-font-24 v12-primary-text"
style="background: rgba(246,246,246,0.7); border-radius: 40rpx; padding: 12rpx ;"
>修改地址审核未通过,{{ order.addressUpdateReason }}</view>
</view>
</view>
</view>
<u-modal
@@ -449,7 +544,7 @@ import {
getOrderData,
getOrderList,
orderDelay,
editAddress
applyEditAddress
} from "@/api/order"
import {
cancelOrderHandle,
@@ -524,7 +619,9 @@ export default {
keyword: '',
_orderId: '',
showDatePicker: false,
dateRange: []
dateRange: [],
userLatitude: null,
userLongitude: null
}
},
components: {
@@ -536,29 +633,29 @@ export default {
computed: mapGetters(["userInfo"]),
onShow() {
const _this = this
const chooseAddress = uni.getStorageSync('chooseAddress') || {}
const needRefreshOrderList = uni.getStorageSync('needRefreshMyOrderList')
const chooseAddress = uni.getStorageSync('updateOrderAddress') || {}
const addressId = chooseAddress.id || ''
// 监听到选择收货地址
if (addressId) {
uni.setStorageSync('chooseAddress', {})
if (addressId && this._orderId) {
uni.setStorageSync('updateOrderAddress', {})
uni.showModal({
title:'确定修改地址吗?',
content: '',
content: '提交后将进入审核流程,请确认是否继续',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
success:(success)=>{
if(success.confirm) {
uni.showLoading()
editAddress({
applyEditAddress({
addressId,
orderId: _this._orderId
}).then(res => {
uni.showToast({
icon: 'success',
title: '修改成功!'
title: '已提交审核'
})
uni.setStorageSync('sourceAddress', chooseAddress)
_this.changeType()
}).finally(() => {
uni.hideLoading()
@@ -572,11 +669,19 @@ export default {
_this._orderId = ''
}
})
} else if (needRefreshOrderList) {
uni.removeStorageSync('needRefreshMyOrderList')
this.changeType()
}
},
onLoad() {
this.type = this.type || parseInt(this.$yroute.query.type) || 0
this.changeType(this.type)
this.orderTypeTabIndex = parseInt(this.$yroute.query.tabIndex) || 0
this.initUserLocation()
this.orderTypeTabChange({
...this.orderTypeTabList[this.orderTypeTabIndex],
index: this.orderTypeTabIndex
})
},
onShareAppMessage() {
uni.updateShareMenu({
@@ -590,6 +695,113 @@ export default {
}
},
methods: {
isRefundFlow(order) {
if (!order) {
return false
}
const statusType = Number(order._status && order._status._type)
return statusType < 0
},
canShowModifyAddress(order) {
if (this.isRefundFlow(order)) {
return false
}
if (!order || order.isTravelGroup === 1 || order.isTickets === 1) {
return false
}
const type = parseInt(order._status && order._status._type)
if (type !== 1) {
return false
}
const isAddressUpdate = Number(order.isAddressUpdate || 0)
const addressUpdateStatus = Number(order.addressUpdateStatus || 0)
if (isAddressUpdate === 0) {
return true
}
return false
},
initUserLocation() {
uni.getLocation({
type: 'gcj02',
success: res => {
this.userLatitude = Number(res.latitude)
this.userLongitude = Number(res.longitude)
this.updateOrderDistances()
}
})
},
getOrderLocation(order) {
const info = order
const latitude = Number(info.merLatitude || 0)
const longitude = Number( info.merLongitude || 0)
if (!Number.isFinite(latitude) || !Number.isFinite(longitude) || latitude === 0 || longitude === 0) {
return null
}
return { latitude, longitude }
},
hasValidDistance(distance) {
if (distance == null) {
return false
}
const text = String(distance).trim().toLowerCase()
if (!text || text === '0' || text === '0km' || text === '0.0km') {
return false
}
return true
},
calculateDistance(lat1, lon1, lat2, lon2) {
if (!lat1 || !lon1 || !lat2 || !lon2) {
return ''
}
const R = 6371
const dLat = (lat2 - lat1) * Math.PI / 180
const dLon = (lon2 - lon1) * Math.PI / 180
const a =
Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) *
Math.sin(dLon / 2) * Math.sin(dLon / 2)
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
const d = R * c
return d.toFixed(1) + 'km'
},
updateOrderDistances() {
if (!this.orderList.length || this.userLatitude == null || this.userLongitude == null) {
return
}
this.orderList = this.orderList.map(order => {
if (!order.experienceOrderInfo) {
return order
}
const oldDistance = order.distance || (order.experienceOrderInfo && order.experienceOrderInfo.distance)
if (this.hasValidDistance(oldDistance)) {
return order
}
const location = this.getOrderLocation(order)
if (!location) {
return order
}
const distance = this.calculateDistance(
this.userLatitude,
this.userLongitude,
location.latitude,
location.longitude
)
if (!distance) {
return order
}
const experienceOrderInfo = order.experienceOrderInfo
? {
...order.experienceOrderInfo,
distance
}
: order.experienceOrderInfo
return {
...order,
distance,
experienceOrderInfo
}
})
},
handleDateSelected(dateRange) {
const params = {
@@ -674,10 +886,52 @@ export default {
})
},
goStore(order) {
if(order.isTravelGroup === 1) {
// uni.showToast({
// title: '该订单为团体订单,无法查看店铺信息!'
// })
if (!order) {
return
}
if (order.experienceOrderInfo) {
const experienceMerchantId =
order.merId ||
order.merchantId ||
order.hotelId ||
(order.experienceOrderInfo && order.experienceOrderInfo.merId) ||
(order.experienceOrderInfo && order.experienceOrderInfo.merchantId)
if (!experienceMerchantId) {
uni.showToast({
title: '未找到体验店信息',
icon: 'none'
})
return
}
this.$yrouter.push({
path: "/pkg_product/views/experienceProjectDetail",
query: {
experienceMerchantId
}
})
return
}
if (order.isTravelGroup === 1) {
const travelStoreId =
order.merId ||
order.hotelId ||
order.travelMerchantId ||
(order.travelGroupOrderInfo && order.travelGroupOrderInfo.travelMerchantId) ||
(order.travelGroupOrderInfo && order.travelGroupOrderInfo.travelGroupProduct && order.travelGroupOrderInfo.travelGroupProduct.travelMerchantId)
if (!travelStoreId) {
uni.showToast({
title: '未找到旅居店铺信息',
icon: 'none'
})
return
}
this.$yrouter.push({
path: "/pkg_product/views/sojoumStore",
query: {
id: travelStoreId
}
})
return
}
if(!order.hotelId) {
@@ -721,10 +975,16 @@ export default {
},
addressTap(order) {
this._orderId = order.orderId
uni.setStorageSync('updateOrderSourceAddress', {
id: order.addressId || order.userAddressId || '',
realName: order.realName || '',
phone: order.userPhone || '',
userAddress: order.userAddress || ''
})
this.$yrouter.push({
path: "/pages/user/address/AddressManagement/index",
query: {
choosMode: 1
choosMode: 4
}
})
},
@@ -733,6 +993,17 @@ export default {
},
goRoom(order) {
console.log(order);
if (order.experienceOrderInfo) {
const phone = order.merchantPhone || order.merPhone || order.experienceOrderInfo.phone || order.companyTel;
if (phone) {
uni.makePhoneCall({
phoneNumber: phone
})
} else {
uni.showToast({ title: '暂无商家电话', icon: 'none' })
}
return
}
if(order.isTravelGroup === 1) {
// 拨打商家电话
uni.makePhoneCall({
@@ -785,6 +1056,15 @@ export default {
});
},
goOrderDetails(order) {
if (order.experienceOrderInfo) {
this.$yrouter.push({
path: "/pkg_product/views/experienceCouponOrderDetail",
query: {
orderId: order.orderId
}
});
return
}
if(order.isTravelGroup === 1) {
this.$yrouter.push({
path: "/pkg_product/views/sojoumOrderDetails",
@@ -871,7 +1151,7 @@ export default {
this.orderTypeTabIndex = item.index
this.orderType = item.orderType
this.updateTabListByOrderType()
this.changeType()
this.changeType(this.type)
},
updateTabListByOrderType() {
if (this.orderType === 'travel') {
@@ -896,6 +1176,11 @@ export default {
]
}
},
goUserCenter() {
this.$yrouter.switchTab({
path: '/pages/user/User/index'
})
},
changeType() {
this.orderList = []
this.page = 1
@@ -935,6 +1220,7 @@ export default {
item.showMore = false;
})
}
this.updateOrderDistances()
this.page++;
this.loaded = res.data.length < this.limit
this.loading = false
@@ -1107,6 +1393,7 @@ page {
.title {
border-bottom: none;
height: 70rpx !important
}
.item-info {
@@ -1155,7 +1442,17 @@ page {
overflow: hidden;
margin: 0.7 * 100rpx auto 0.5 * 100rpx auto;
}
.ssj.pictrue{
width: 160rpx !important;
height: 160rpx !important;
border-radius: 16rpx !important;
}
.my-order .list .item .item-info .text {
width: 448rpx !important;
font-size: 28rpx;
color: #999;
margin-top: 6rpx;
}
.noCart .pictrue image {
width: 408rpx;
height: 414rpx;
@@ -1208,7 +1505,7 @@ page {
margin: 10rpx 0 0 0;
}
.my-order .list .item .item-info .text .name {
width: calc(100% - 160rpx);
width: calc(100% - 120rpx);
}
.tips-text{
padding: 0 12rpx;
+90 -23
View File
@@ -35,14 +35,51 @@
剩余<u-count-down format="HH:mm:ss" autoStart :time="$global.diffSSS(orderInfo.paymentTimeout)" />订单将自动取消
</view>
<u-divider></u-divider>
<div class="name v12-mb-3 v12-font-28 v12-font-bold">
<text class="v12-mr-3"> {{ orderInfo.realName }}</text>
<text class="phone">{{ orderInfo.userPhone }}</text>
</div>
<div class="v12-font-28 v12-secondary-dark-text v12-justify-between">
<text class=" more-t" style="flex: 2;">{{ orderInfo.userAddress }}</text>
<view v-if="getStatus(orderInfo) === '待付款'" @click="goAddress" class="v12-btn cancel v12-dark-text v12-dark-border v12-radius-40" >修改地址</view>
</div>
<template v-if="Number(orderInfo.isAddressUpdate) === 1 && [0, 2].includes(Number(orderInfo.addressUpdateStatus))">
<div class="name v12-mb-3 v12-font-28 v12-font-bold flex ai-center">
<text class="v12-mr-3"> {{ orderInfo.oldRealName }}</text>
<text class="phone">{{ orderInfo.oldUserPhone }}</text>
<text class="v12-font-22 v12-px-2 v12-ml-2 v12-primary-text v12-primary-border" style="border-radius: 8rpx; padding: 2rpx 10rpx;">原地址</text>
</div>
<div class="v12-font-28 v12-secondary-dark-text v12-justify-between">
<text class=" more-t" style="flex: 2;">{{ orderInfo.oldUserAddress }}</text>
</div>
<div class="name v12-mb-3 v12-mt-4 v12-font-28 v12-font-bold flex ai-center">
<text class="v12-mr-3"> {{ orderInfo.realName }}</text>
<text class="phone">{{ orderInfo.userPhone }}</text>
<text class="v12-font-22 v12-px-2 v12-ml-2 v12-primary-text v12-primary-border" style="border-radius: 8rpx; padding: 2rpx 10rpx;">新地址</text>
</div>
<div class="v12-font-28 v12-secondary-dark-text v12-justify-between">
<text class=" more-t" style="flex: 2;">{{ orderInfo.userAddress }}</text>
</div>
</template>
<template v-else>
<div class="name v12-mb-3 v12-font-28 v12-font-bold">
<text class="v12-mr-3"> {{ orderInfo.realName }}</text>
<text class="phone">{{ orderInfo.userPhone }}</text>
</div>
<div class="v12-font-28 v12-secondary-dark-text v12-justify-between">
<text class=" more-t" style="flex: 2;">{{ orderInfo.userAddress }}</text>
<view v-if="canShowModifyAddress(orderInfo)" @click="goAddress" class="v12-btn cancel v12-dark-text v12-dark-border v12-radius-40" >修改地址</view>
</div>
</template>
<view
v-if="!isrefund && Number(orderInfo.isAddressUpdate) === 1 && [0, 2].includes(Number(orderInfo.addressUpdateStatus))"
class="v12-mt-3"
>
<view
v-if="Number(orderInfo.addressUpdateStatus) === 0"
class="v12-font-24 v12-primary-text"
style="background: rgba(246,246,246,0.7); border-radius: 40rpx; padding: 12rpx;"
>修改地址正在审核中请耐心等待</view>
<view
v-if="Number(orderInfo.addressUpdateStatus) === 2"
class="v12-font-24 v12-primary-text"
style="background: rgba(246,246,246,0.7); border-radius: 40rpx; padding: 12rpx;"
>修改地址审核未通过{{ orderInfo.addressUpdateReason }}</view>
</view>
</view>
</view>
<view v-if="orderInfo.deliveryId !== null && ([-1, -2, 3, 4].includes(orderInfo._status._type) || (orderInfo._status._type == 2 && orderInfo.isTickets !== 1))">
@@ -437,6 +474,7 @@
<view class="v12-justify-between ">
<view v-if="orderInfo.isGiftCardReceiveBlind === 0" class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view>
<view class="bnt v12-dark-text v12-dark-border cancel" @click="delayOrder">催发货</view>
<view v-if="canShowModifyAddress(orderInfo)" class="bnt v12-dark-text v12-dark-border cancel" @click="goAddress">修改地址</view>
</view>
<view class="bnt v12-primary-text v12-primary-border cancel" @click="goGoodsReturn2(orderInfo)">申请退款</view>
</view>
@@ -531,7 +569,7 @@
<script>
import passkeyborad from '@/components/yzc-paykeyboard/yzc-paykeyboard'
import OrderGoods from "@/components/OrderGoods";
import {orderDetail, orderDelay, aginConfirm, express, editAddress, orderExpectedArrivalTime, groupOrderDetail} from "@/api/order";
import {orderDetail, orderDelay, aginConfirm, express, applyEditAddress, orderExpectedArrivalTime, groupOrderDetail} from "@/api/order";
import Payment from "@/components/Payment";
import DataFormat from "@/components/DataFormat";
import {copyClipboard} from "@/utils";
@@ -592,10 +630,15 @@ export default {
isGift: false,
isGroup: false,
key: "",
loading: true
loading: true,
addressEditOrderId: ""
};
},
computed: {
isrefund() {
const status = Number(this.orderInfo._status._type)
return status< 0
},
refundOrder() {
return this.orderInfo.refund_status > 0;
},
@@ -607,39 +650,38 @@ export default {
this.key = opts.key || ''
},
onShow() {
const chooseAddress = uni.getStorageSync('chooseAddress') || {}
const chooseAddress = uni.getStorageSync('updateOrderAddress') || {}
const addressId = chooseAddress.id || ''
console.log(addressId, 'addressId');
// 监听到选择收货地址
if (addressId) {
uni.setStorageSync('chooseAddress', {})
if (addressId && this.addressEditOrderId) {
uni.setStorageSync('updateOrderAddress', {})
uni.showModal({
title:'确定修改地址吗?',
content: '',
content: '提交后将进入审核流程,请确认是否继续',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
success:(success)=>{
if(success.confirm) {
uni.showLoading()
editAddress({
applyEditAddress({
addressId,
orderId: this.orderInfo.orderId
}).then(res => {
orderId: this.addressEditOrderId
}).then(() => {
uni.showToast({
icon: 'success',
title: '修改成功!'
title: '已提交审核'
})
uni.setStorageSync('sourceAddress', chooseAddress)
this.getDetail()
}).finally(() => {
uni.hideLoading()
})
} else {
this.getDetail()
}
},
complete:(complete)=>{
uni.hideLoading()
this.addressEditOrderId = ''
}
})
} else {
@@ -649,12 +691,30 @@ export default {
this.getDetail();
}
},
onUnload() {
uni.setStorageSync('needRefreshMyOrderList', 1)
},
// inject: ["app"],
mounted: function () {
this.id = this.$yroute.query.id;
},
methods: {
copyClipboard,
canShowModifyAddress(order) {
if (!order || this.isGroup || Number(order.isTickets || 0) === 1) {
return false
}
const type = Number(order._status && order._status._type)
if (type !== 1) {
return false
}
const isAddressUpdate = Number(order.isAddressUpdate || 0)
const addressUpdateStatus = Number(order.addressUpdateStatus || 0)
if (isAddressUpdate === 0) {
return true
}
return false
},
//催发货
delayOrder() {
uni.showToast({
@@ -740,10 +800,17 @@ export default {
})
},
goAddress() {
this.addressEditOrderId = this.orderInfo.orderId
uni.setStorageSync('updateOrderSourceAddress', {
id: this.orderInfo.addressId || this.orderInfo.userAddressId || '',
realName: this.orderInfo.realName || this.orderInfo.oldRealName || '',
phone: this.orderInfo.userPhone || this.orderInfo.oldUserPhone || '',
userAddress: this.orderInfo.userAddress || this.orderInfo.oldUserAddress || ''
})
this.$yrouter.push({
path:'/pages/user/address/AddressManagement/index',
query: {
choosMode: 1
choosMode: 4
}
})
},
@@ -150,6 +150,11 @@ export default {
uni.setStorageSync('giftChooseAddress', item)
this.$yrouter.back()
}
// 来源修改订单地址(复用订单创建页的choosMode但避免污染chooseAddress
if (this.choosMode === 4) {
uni.setStorageSync('updateOrderAddress', item)
this.$yrouter.back()
}
},
refresh() {
this.addressList = []
@@ -185,6 +190,24 @@ export default {
if (this.choosMode === 3) {
this.currentId = uni.getStorageSync('giftChooseAddress') ? uni.getStorageSync('giftChooseAddress').id : this.addressList.find(e => e.isDefault === 1) ? this.addressList.find(e => e.isDefault === 1).id : null
}
// 来源修改订单地址
if (this.choosMode === 4) {
const sourceAddress = uni.getStorageSync('updateOrderSourceAddress') || {}
let currentId = sourceAddress.id || null
if (!currentId && sourceAddress.userAddress) {
const sourceAddressText = String(sourceAddress.userAddress).replace(/\s+/g, '')
const sourceRealName = String(sourceAddress.realName || '').trim()
const sourcePhone = String(sourceAddress.phone || '').trim()
const matched = this.addressList.find(e => {
const addressText = `${e.province || ''}${e.city || ''}${e.district || ''}${e.detail || ''}`.replace(/\s+/g, '')
const sameAddress = sourceAddressText && addressText === sourceAddressText
const samePerson = sourceRealName && sourcePhone && String(e.realName || '').trim() === sourceRealName && String(e.phone || '').trim() === sourcePhone
return sameAddress || samePerson
})
currentId = matched ? matched.id : null
}
this.currentId = currentId || (this.addressList.find(e => e.isDefault === 1) ? this.addressList.find(e => e.isDefault === 1).id : null)
}
})
},
/**
+934
View File
@@ -0,0 +1,934 @@
<template>
<view class="container">
<view
v-if="form.reviewStatus === 2"
class="v12-pa-2 reason-box"
>
驳回原因: {{ form.reviewMsg }}
</view>
<view
v-if="form.isDraft === 0 && form.reviewStatus === 0"
class="v12-pa-2 reason-box"
>
审核中请耐心等待审核结果
</view>
<view class="form-item">
<view class="title">
<text class="required">* </text>
名称:
</view>
<view class="input">
<u-textarea
v-model="form.name"
border="none"
:disabled="form.isDraft === 0 && (form.reviewStatus === 0 || form.reviewStatus === 1)"
placeholder="请输入名称"
:placeholder-style="inputPlaceholderStyle"
/>
</view>
</view>
<view class="form-item v12-mt-2 v12-d-flex v12-justify-start">
<view>
<view class="title">
<text class="required">* </text>
主图:
</view>
<view class="input">
<u-upload
:fileList="coverImg.filter(item => item.url)"
:disabled="form.isDraft === 0 && (coverImg.length > 0 || form.reviewStatus === 0 || form.reviewStatus === 1)"
:deletable="form.isDraft === 1 || (form.reviewStatus !== 0 && form.reviewStatus !== 1)"
:maxCount="1"
count="1"
name="coverImg"
multiple
@afterRead="afterRead($event, 'coverImg')"
@delete="deletePic($event, 'coverImg')"
/>
</view>
</view>
<view class="v12-ml-2">
<view class="title">
<text class="required">* </text>
头像:
</view>
<view class="input">
<u-upload
:fileList="avatarImg.filter(item => item.url)"
:disabled="form.isDraft === 0 && (avatarImg.length > 0 || form.reviewStatus === 0 || form.reviewStatus === 1)"
:deletable="form.isDraft === 1 || (form.reviewStatus !== 0 && form.reviewStatus !== 1)"
:maxCount="1"
count="1"
name="avatarImg"
multiple
@afterRead="afterRead($event, 'avatarImg')"
@delete="deletePic($event, 'avatarImg')"
/>
</view>
</view>
</view>
<view class="form-item v12-mt-2">
<view class="title">
<text class="required">* </text>
轮播图:
</view>
<view class="input">
<u-upload
:fileList="bannerImg"
:disabled="form.isDraft === 0 && (bannerImg.length > 8 || form.reviewStatus === 0 || form.reviewStatus === 1)"
:deletable="form.isDraft === 1 || (form.reviewStatus !== 0 && form.reviewStatus !== 1)"
:maxCount="9"
count="9"
name="bannerImg"
multiple
@afterRead="afterRead($event, 'bannerImg')"
@delete="deletePic($event, 'bannerImg')"
/>
</view>
</view>
<view class="form-item v12-mt-2">
<view class="title">
视频:
</view>
<view class="input">
<u-upload
v-if="videos.length === 0"
accept="video"
multiple
:max-count="1"
:fileList="videos"
:disabled="form.isDraft === 0 && (videos.length > 0 || form.reviewStatus === 0 || form.reviewStatus === 1)"
:deletable="form.isDraft === 1 || (form.reviewStatus !== 0 && form.reviewStatus !== 1)"
count="1"
name="videoImg"
:previewFullImage="true"
@afterRead="afterRead($event, 'videos', 'video')"
@delete="deletePic($event, 'videos')"
/>
<view
v-else
class="video-wrapper"
>
<video
:src="videos[0].url"
:poster="videos[0].url + '?vframe/jpg/offset/1'"
:controls="false"
play-btn-position="center"
class="video-item"
/>
<view
v-if="form.isDraft === 1 || (form.reviewStatus !== 0 && form.reviewStatus !== 1)"
class="delete-badge"
@click.stop="deleteVideo(0)"
>
x
</view>
</view>
</view>
</view>
<view class="form-item v12-mt-2 v12-d-flex v12-justify-start v12-align-center">
<view class="title">
<text class="required">* </text>
公司名称
</view>
<view
class="v12-ml-2"
style="flex: 1;"
>
<input
v-model="form.companyName"
type="text"
:placeholder-style="inputPlaceholderStyle"
:disabled="form.isDraft === 0 && (form.reviewStatus === 0 || form.reviewStatus === 1)"
placeholder="请输入公司名称"
/>
</view>
</view>
<u-divider />
<view class="form-item v12-mt-2 v12-d-flex v12-justify-start v12-align-center">
<view class="title">
<text class="required">* </text>
店铺分类
</view>
<view
class="v12-ml-2"
style="flex: 1;"
>
<picker
:value="experienceStoreCategoryIndex"
:range="experienceStoreCategoryList"
:disabled="form.isDraft === 0 && (form.reviewStatus === 0 || form.reviewStatus === 1)"
range-key="name"
mode="selector"
@change="handleCategoryChange"
>
<view class="one-t">
<text :style="{'color': form.experienceStoreCategoryName ? '#333' : '#999999'}">
{{ form.experienceStoreCategoryName || '请选择店铺分类' }}
</text>
</view>
</picker>
</view>
</view>
<u-divider />
<view class="form-item v12-mt-2 v12-d-flex v12-justify-start v12-align-center">
<view class="title">
<text class="required">* </text>
简介
</view>
<view
class="v12-ml-2"
style="flex: 1;"
>
<input
v-model="form.intro"
type="text"
:disabled="form.isDraft === 0 && (form.reviewStatus === 0 || form.reviewStatus === 1)"
:placeholder-style="inputPlaceholderStyle"
placeholder="请输入简介"
/>
</view>
</view>
<u-divider />
<view class="form-item v12-mt-2 v12-d-flex v12-justify-start v12-align-center">
<view class="title">
<text class="required">* </text>
联系人
</view>
<view
class="v12-ml-2"
style="flex: 1;"
>
<input
v-model="form.contact"
type="text"
:placeholder-style="inputPlaceholderStyle"
:disabled="form.isDraft === 0 && (form.reviewStatus === 0 || form.reviewStatus === 1)"
placeholder="请输入联系人姓名"
/>
</view>
</view>
<u-divider />
<view
class="form-item v12-mt-2 v12-d-flex v12-justify-start v12-align-center"
@click="showTimePicker"
>
<view class="title">
<text class="required">* </text>
营业时间
</view>
<view class="v12-ml-2">
<view>
<text :style="{'color': form.serviceTime ? '#333' : '#999999'}">
{{ form.serviceTime || '起始时间' }}
</text>
-
<text :style="{'color': form.serviceEndTime ? '#333' : '#999999'}">
{{ form.serviceEndTime || '结束时间' }}
</text>
</view>
<tpf-time-range
ref="TimePickerPopupRef"
startTime="00:00"
endTime="23:59"
:disabled="form.isDraft === 0 && (form.reviewStatus === 0 || form.reviewStatus === 1)"
:startDefaultTime="form.serviceTime"
:endDefaultTime="form.serviceEndTime"
@timeRange="timeRange"
/>
</view>
</view>
<u-divider />
<view class="form-item v12-mt-2 v12-d-flex v12-justify-start v12-align-center">
<view class="title">
<text class="required">* </text>
省市区
</view>
<view
class="v12-ml-2 one-t"
style="flex: 1;"
>
<CitySelect
ref="cityselect"
:disabled="form.isDraft === 0 && (form.reviewStatus === 0 || form.reviewStatus === 1)"
:defaultValue="form.area || '请选择'"
:items="district"
@callback="resultCity"
/>
</view>
</view>
<u-divider />
<view class="form-item v12-mt-2 v12-d-flex v12-justify-start v12-align-center">
<view class="title">
<text class="required">* </text>
详细地址
</view>
<view
class="v12-ml-2"
style="flex: 1;"
>
<input
v-model="form.address"
:placeholder-style="inputPlaceholderStyle"
:disabled="form.isDraft === 0 && (form.reviewStatus === 0 || form.reviewStatus === 1)"
type="text"
placeholder="请输入详细地址"
/>
</view>
</view>
<u-divider />
<view
class="form-item v12-mt-2 v12-d-flex v12-justify-start v12-align-center"
@click="chooLocation"
>
<view class="title">
<text class="required">* </text>
地理定位
</view>
<view
class="v12-ml-2"
style="flex: 1;"
>
<u--text
v-if="form.position"
:text="form.position"
/>
<u--text
v-else
text="请选择"
color="#c0c4cc"
/>
</view>
</view>
<u-divider />
<view class="form-item v12-mt-2 v12-d-flex v12-justify-start v12-align-center">
<view class="title">
<text class="required">* </text>
商家电话
</view>
<view
class="v12-ml-2"
style="flex: 1;"
>
<u-input
v-model="form.phone"
type="text"
:placeholder-style="inputPlaceholderStyle"
:disabled="form.isDraft === 0 && (form.reviewStatus === 0 || form.reviewStatus === 1)"
placeholder="请输入商家电话"
maxlength="11"
border="none"
>
<template slot="suffix">
<u-code
v-if="form.isDraft === 1 || (form.reviewStatus !== 0 && form.reviewStatus !== 1)"
ref="uCode"
seconds="30"
changeText="X秒重新获取"
@change="codeChange"
/>
<u-button
v-if="form.isDraft === 1 || (form.reviewStatus !== 0 && form.reviewStatus !== 1)"
:text="tips"
type="success"
color="#4A97FC"
@tap="getCode"
/>
</template>
</u-input>
</view>
</view>
<u-divider />
<view class="form-item v12-mt-2 v12-d-flex v12-justify-start v12-align-center">
<view class="title">
<text class="required">* </text>
填写验证码
</view>
<view
class="v12-ml-2"
style="flex: 1;"
>
<input
v-model="form.captcha"
type="text"
:placeholder-style="inputPlaceholderStyle"
:disabled="form.isDraft === 0 && (form.reviewStatus === 0 || form.reviewStatus === 1)"
placeholder="请输入验证码"
/>
</view>
</view>
<u-divider />
<view class="form-item v12-mt-2 v12-d-flex v12-justify-start v12-align-center">
<view class="title">
<!-- <text class="required">* </text> -->
商家微信
</view>
<view
class="v12-ml-2"
style="flex: 1;"
>
<input
v-model="form.wechat"
type="text"
:placeholder-style="inputPlaceholderStyle"
placeholder="请输入微信号"
:disabled="form.isDraft === 0 && (form.reviewStatus === 0 || form.reviewStatus === 1)"
/>
</view>
</view>
<u-divider />
<view class="form-item v12-mt-2">
<view class="title">
<text class="required">* </text>
资质:
</view>
<view class="input">
<u-upload
:fileList="qualificationImg"
:disabled="(form.isDraft === 0 && (form.reviewStatus === 0 || form.reviewStatus === 1)) || qualificationImg.length > 98"
:deletable="form.isDraft === 1 || (form.reviewStatus !== 0 && form.reviewStatus !== 1)"
:maxCount="99"
count="99"
name="qualificationImg"
multiple
@afterRead="afterRead($event, 'qualificationImg')"
@delete="deletePic($event, 'qualificationImg')"
/>
</view>
</view>
<view v-if="form.isDraft === 0 && form.reviewStatus !== 1">
<view
class="v12-primary v12-white-text submit-btn"
:style="{'background': form.reviewStatus === 0 ? '#FA979F !important' : '#4A97FC'}"
@click="submitForm"
>
{{ form.reviewStatus === 0 ? '撤销申请' : form.reviewStatus === 2 ? '重新提交' : '提交审核' }}
</view>
</view>
<view v-if="form.reviewStatus === null || (form.isDraft === 1 && form.reviewStatus === 0)">
<view
class="v12-primary v12-white-text submit-btn"
@click="submitForm"
>
提交审核
</view>
</view>
<u-popup
:show="show"
mode="center"
round="10"
@close="show=false"
>
<view class="popup-body">
<view class="tc bold">
入驻申请须知
</view>
<view class="content">
<rich-text :nodes="notice" />
</view>
<view class="agree-box v12-mb-2">
<checkbox-group @change="changeAgree">
<label>
<checkbox
value="yes"
style="transform:scale(0.8)"
/>
</label>
<text>我已仔细阅读并同意</text>
</checkbox-group>
</view>
<u-button
type="error"
text="确定"
:disabled="!isAgree"
@click="savePopup"
/>
</view>
</u-popup>
</view>
</template>
<script>
import CitySelect from '@/components/CitySelect'
import { getCity, registerVerify } from '@/api/user'
import { uploadVideo, uploadImage } from '@/utils'
import {
getShopData,
saveExperienceStore,
saveExperienceStoreDraft,
getExperienceStoreCategoryList,
getExperienceStoreInfo,
removeApply
} from '@/api/join'
export default {
components: {
CitySelect
},
data() {
return {
isAgree: false,
show: false,
notice: '',
tips: '获取验证码',
inputPlaceholderStyle: {
fontSize: '32rpx'
},
coverImg: [],
avatarImg: [],
bannerImg: [],
videos: [],
district: [],
qualificationImg: [],
partnerId: 0,
experienceStoreCategoryList: [],
experienceStoreCategoryIndex: 0,
form: {
captcha: '',
name: '',
cover: '',
avatar: '',
banner: '',
video: '',
companyName: '',
experienceStoreCategoryId: null,
experienceStoreCategoryName: '',
serviceTime: '00:00',
serviceEndTime: '23:59',
provinceId: 0,
provinceName: '',
cityId: 0,
cityName: '',
areaId: 0,
areaName: '',
address: '',
longitude: 0,
latitude: 0,
contact: '',
phone: '',
wechat: '',
qualification: '',
intro: '',
reviewMsg: '',
reviewStatus: null,
isDraft: null,
position: '',
area: ''
}
}
},
onLoad(opts) {
this.partnerId = opts.partnerId
this.queryCity()
getShopData().then(({ data }) => {
this.notice = data.merchantApplyNotice
})
getExperienceStoreCategoryList().then(({ data }) => {
this.experienceStoreCategoryList = data || []
if (this.experienceStoreCategoryList.length > 0) {
this.experienceStoreCategoryIndex = 0
}
this.initInfo()
})
},
onUnload() {
this.saveDraft()
},
onHide() {
this.saveDraft()
},
methods: {
initInfo() {
getExperienceStoreInfo().then(res => {
const data = res.data || {}
const info = data.experienceStoreInfo || {}
if (!info || Object.keys(info).length === 0) {
this.form.isDraft = 1
this.show = true
return
}
this.form = { ...this.form, ...info }
this.coverImg = info.cover ? this.stringToMapArr(info.cover) : []
this.avatarImg = info.avatar ? this.stringToMapArr(info.avatar) : []
this.bannerImg = info.banner ? this.stringToMapArr(info.banner) : []
this.videos = info.video ? this.stringToMapArr(info.video) : []
this.qualificationImg = info.qualification ? this.stringToMapArr(info.qualification) : []
this.form.reviewStatus = data.reviewStatus != null ? data.reviewStatus : null
this.form.reviewMsg = data.reviewMsg || ''
this.form.isDraft = data.isDraft != null ? data.isDraft : null
this.form.latitude = info.latitude || 0
this.form.longitude = info.longitude || 0
this.form.position = this.form.longitude && this.form.latitude
? this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6)
: ''
this.form.area = `${this.form.provinceName || ''} ${this.form.cityName || ''} ${this.form.areaName || ''}`.trim()
if (this.experienceStoreCategoryList && this.experienceStoreCategoryList.length > 0) {
const idx = this.experienceStoreCategoryList.findIndex(item => item.id === this.form.experienceStoreCategoryId)
if (idx !== -1) {
this.experienceStoreCategoryIndex = idx
this.form.experienceStoreCategoryName = this.experienceStoreCategoryList[idx].name
}
}
if (this.form.isDraft === 1 && (this.form.reviewStatus === null || this.form.reviewStatus === undefined)) {
this.show = true
}
}).catch(() => {
this.form.isDraft = 1
this.show = true
})
},
changeAgree(e) {
this.isAgree = e.detail.value.includes('yes')
},
savePopup() {
this.show = false
},
stringToMapArr(str, split = ',') {
return str.split(split).map(item => ({ url: item }))
},
saveDraft() {
this.form.cover = this.coverImg.filter(item => item.url).map(item => item.url).join(',')
this.form.avatar = this.avatarImg.filter(item => item.url).map(item => item.url).join(',')
this.form.banner = this.bannerImg.filter(item => item.url).map(item => item.url).join(',')
this.form.video = this.videos.filter(item => item.url).map(item => item.url).join(',')
this.form.qualification = this.qualificationImg.filter(item => item.url).map(item => item.url).join(',')
const params = {
experienceStoreInfo: { ...this.form },
partnerId: this.partnerId
}
saveExperienceStoreDraft(params).catch(err => {
uni.$u.toast(err.msg)
})
},
handleCategoryChange(e) {
const idx = parseInt(e.detail.value)
this.experienceStoreCategoryIndex = idx
const item = this.experienceStoreCategoryList[idx]
if (item) {
this.form.experienceStoreCategoryId = item.id
this.form.experienceStoreCategoryName = item.name
}
},
submitForm() {
if (this.form.reviewStatus === 0 && this.form.isDraft === 0) {
this.revokeExperienceStore()
return
}
this.form.cover = this.coverImg.filter(item => item.url).map(item => item.url).join(',')
this.form.avatar = this.avatarImg.filter(item => item.url).map(item => item.url).join(',')
this.form.banner = this.bannerImg.filter(item => item.url).map(item => item.url).join(',')
this.form.video = this.videos.filter(item => item.url).map(item => item.url).join(',')
this.form.qualification = this.qualificationImg.filter(item => item.url).map(item => item.url).join(',')
if (!this.form.name) {
uni.$u.toast('请输入名称')
return
}
if (!this.form.cover) {
uni.$u.toast('请上传主图')
return
}
if (!this.form.avatar) {
uni.$u.toast('请上传头像')
return
}
if (!this.form.banner) {
uni.$u.toast('请上传轮播图')
return
}
if (!this.form.companyName) {
uni.$u.toast('请输入公司名称')
return
}
if (!this.form.experienceStoreCategoryId) {
uni.$u.toast('请选择店铺分类')
return
}
if (!this.form.intro) {
uni.$u.toast('请输入简介')
return
}
if (!this.form.serviceTime) {
uni.$u.toast('请选择营业开始时间')
return
}
if (!this.form.serviceEndTime) {
uni.$u.toast('请选择营业结束时间')
return
}
if (!this.form.provinceId) {
uni.$u.toast('请选择省份')
return
}
if (!this.form.cityId) {
uni.$u.toast('请选择城市')
return
}
if (!this.form.areaId) {
uni.$u.toast('请选择区域')
return
}
if (!this.form.address) {
uni.$u.toast('请输入详细地址')
return
}
if (!this.form.longitude || !this.form.latitude) {
uni.$u.toast('请选择地理定位')
return
}
if (!this.form.qualification) {
uni.$u.toast('请上传资质')
return
}
if (!this.form.contact) {
uni.$u.toast('请输入联系人姓名')
return
}
if (!this.form.phone) {
uni.$u.toast('请输入手机号')
return
}
if (!this.form.captcha) {
uni.$u.toast('请输入验证码')
return
}
// if (!this.form.wechat) {
// uni.$u.toast('请输入联系微信')
// return
// }
const params = {
experienceStoreInfo: { ...this.form },
partnerId: this.partnerId,
captcha: this.form.captcha
}
saveExperienceStore(params).then(res => {
if (res.status === 200) {
uni.showToast({
title: '您的入驻申请已提交成功,请耐心等待审核',
icon: 'none',
success: () => {
this.form.isDraft = 0
this.form.reviewStatus = 0
this.show = false
}
})
}
}).catch(err => {
uni.$u.toast(err.msg)
})
},
revokeExperienceStore() {
uni.showModal({
title: '提示',
content: '确定撤销申请吗?',
success: res => {
if (res.confirm) {
removeApply().then(result => {
if (result.status === 200) {
uni.$u.toast('撤销申请成功')
this.form.reviewStatus = null
this.form.isDraft = 1
this.show = true
this.initInfo()
} else {
uni.$u.toast(result.msg || '撤销失败')
}
}).catch(err => {
uni.$u.toast(err.msg)
})
}
}
})
},
getCode() {
if (!this.form.phone) {
uni.$u.toast('请输入手机号')
return
}
if (this.form.phone.length !== 11) {
uni.$u.toast('请输入11位手机号')
return
}
if (this.$refs.uCode && this.$refs.uCode.canGetCode) {
uni.showLoading({
title: '正在获取验证码'
})
registerVerify({
phone: this.form.phone,
type: 'merchantExperienceStoreApply'
}).then(() => {
uni.hideLoading()
uni.$u.toast('验证码已发送')
this.$refs.uCode.start()
}).catch(err => {
uni.hideLoading()
uni.$u.toast(err.msg)
})
} else {
uni.$u.toast('倒计时结束后再发送')
}
},
codeChange(text) {
this.tips = text
},
chooLocation() {
if (this.form.isDraft === 0 && (this.form.reviewStatus === 0 || this.form.reviewStatus === 1)) {
return
}
uni.chooseLocation({
success: res => {
this.form.address = res.address
this.form.longitude = this.$forceToDecimal(res.longitude, 6)
this.form.latitude = this.$forceToDecimal(res.latitude, 6)
this.form.position = this.$forceToDecimal(res.longitude, 6) + ',' + this.$forceToDecimal(res.latitude, 6)
}
})
},
resultCity(values) {
const address = {
province: values.province.name || '',
city: values.city.name || '',
district: values.district.name || '',
provinceId: values.province.id,
cityId: values.city.id,
areaId: values.district.id
}
this.form.area = `${address.province || ''} ${address.city || ''} ${address.district || ''}`
this.form.areaName = address.district || ''
this.form.provinceName = address.province || ''
this.form.cityName = address.city || ''
this.form.provinceId = address.provinceId
this.form.cityId = address.cityId
this.form.areaId = address.areaId
},
queryCity() {
getCity().then(({ data }) => {
this.district = data
})
},
showTimePicker() {
if (this.form.isDraft === 0 && (this.form.reviewStatus === 0 || this.form.reviewStatus === 1)) {
return
}
this.$refs.TimePickerPopupRef.open()
},
timeRange(e) {
this.form.serviceTime = e[0]
this.form.serviceEndTime = e[1]
this.$forceUpdate()
},
afterRead(e, imgField, type) {
const uploadFunc = type === 'video' ? uploadVideo : uploadImage
if (e.file.length > 0) {
e.file.forEach(item => {
if (!item.url) return
uploadFunc(item.url, img => {
if (!img) return
this[imgField].push({ url: img })
})
})
}
},
deleteVideo(index) {
if (this.form.isDraft === 0 && (this.form.reviewStatus === 0 || this.form.reviewStatus === 1)) {
return
}
uni.showModal({
title: '确认删除',
content: '确定删除该视频?',
success: res => {
if (res.confirm) {
this.deletePic({ index }, 'videos')
}
}
})
},
deletePic(e, imgField) {
if (this.form.isDraft === 0 && (this.form.reviewStatus === 0 || this.form.reviewStatus === 1)) {
return
}
this[imgField].splice(e.index, 1)
}
}
}
</script>
<style scoped lang="scss">
.popup-body {
width: 80vw;
height: 80vh;
padding: 30rpx;
overflow: hidden;
}
.popup-body .content {
height: 52vh;
overflow-y: auto;
margin: 30rpx 0;
}
.popup-body .agree-box {
margin: 60rpx 0;
font-size: 28rpx;
color: #666;
}
.popup-body {
.title {
line-height: 80rpx;
text-align: center;
}
}
.container {
padding: 20rpx;
background: #fff;
}
.title {
font-size: 32rpx;
font-weight: 500;
color: #333;
}
.required {
color: #c52733;
}
.input {
margin-top: 20rpx;
}
.submit-btn {
width: 100%;
height: 100rpx;
text-align: center;
line-height: 100rpx;
}
.reason-box {
background: rgba(255, 160, 167, 0.39);
border-radius: 8rpx;
color: #c52733;
font-size: 30rpx;
margin-bottom: 20rpx;
}
.title {
white-space: nowrap;
}
.video-item {
width: 160rpx;
height: 160rpx;
}
.video-wrapper {
position: relative;
display: inline-block;
}
.delete-badge {
position: absolute;
top: 0rpx;
right: 0rpx;
background: #000;
color: #fff;
padding: 2rpx 8rpx;
border-radius: 0 0 0rpx 200rpx;
font-size: 22rpx;
z-index: 10;
text-align: center;
}
</style>
<style>
.input .u-textarea {
background-color: #F3F3F3 !important;
}
</style>
+16
View File
@@ -38,6 +38,13 @@
mode="widthFix"
@click="toTravelResidence"
/>
<image
v-show="partnerType === 'pioneer' || partnerType === ''"
:src="images.experienceStoreImage"
class="img-item"
mode="widthFix"
@click="goto('experience_store')"
/>
</view>
</template>
@@ -56,6 +63,7 @@ export default {
hasHotel: null,
hasSupplier: null,
hasWholesaler: null,
hasExperienceStore: null,
hasTravel: null,
images: null,
pageKeyId: Object.freeze('merchantApplyIndex'),
@@ -73,6 +81,7 @@ export default {
this.hasWholesaler = data.hasWholesaler
this.canApplyHotel = data.canApplyHotel
this.hasTravel = data.hasTravel
this.hasExperienceStore = data.hasExperienceStore
})
},
methods: {
@@ -116,6 +125,13 @@ export default {
}
this.$yrouter.push('/pkg_join/views/shop?partnerId=' + this.partnerId)
break
case 'experience_store':
if(this.hasExperienceStore === 1) {
this.$global.goSupplierMini()
return
}
this.$yrouter.push('/pkg_join/views/experienceStore?partnerId=' + this.partnerId)
break
case 'wholesaler':
if (this.hasWholesaler === 1) {
this.$global.goSupplierMini()
+2 -1
View File
@@ -210,6 +210,7 @@
mode="selector"
range-key="name"
class="picker"
style="width: 100%"
@change="typeChange"
>
<u-cell title="店铺类型" :border="false" isLink>
@@ -289,7 +290,7 @@
</u-cell>
</u-form-item>
<u-form-item prop="area">
<u-cell title="省市区" :border="false" isLink>
<u-cell title="省市区" :border="false" isLink @click="$refs.cityselect.open()">
<template #icon>
<text class="required">*</text>
</template>
+9 -6
View File
@@ -161,7 +161,7 @@
</u-cell>
</view>
<u-form-item prop="area">
<u-cell title="省市区" :border="false" isLink>
<u-cell title="省市区" :border="false" isLink @click="$refs.cityselect.open()">
<template #icon>
<text class="required">*</text>
</template>
@@ -349,7 +349,7 @@
</u-cell>
</u-form-item>
<u-form-item prop="typeText">
<u-cell title="店铺类型" :border="false" isLink>
<u-cell title="店铺类型" :border="false">
<template #icon>
<text class="required">*</text>
</template>
@@ -358,13 +358,16 @@
:value="indexType"
:range="columnsType"
:disabled="reviewing"
mode=selector
mode="selector"
range-key="name"
class="picker"
@change="typeChange"
>
<u--text v-if="form.typeText" :text="form.typeText"></u--text>
<u--text v-else text="请选择类型" color="#c0c4cc"></u--text>
<view style="display: flex; align-items: center; justify-content: flex-end;">
<u--text v-if="form.typeText" :text="form.typeText"></u--text>
<u--text v-else text="请选择类型" color="#c0c4cc"></u--text>
<u-icon name="arrow-right" color="#909399" size="18"></u-icon>
</view>
</picker>
</template>
</u-cell>
@@ -401,7 +404,7 @@
</u-cell>
</u-form-item>
<u-form-item prop="area">
<u-cell title="省市区" :border="false" isLink>
<u-cell title="省市区" :border="false" isLink @click="$refs.cityselect2.open()">
<template #icon>
<text class="required">*</text>
</template>
+2 -2
View File
@@ -648,11 +648,11 @@ export default {
}
// 请选择物理位置
if (!this.form.longitude) {
uni.$u.toast('请选择物理位置')
uni.$u.toast('请选择地理定位')
return
}
if (!this.form.latitude) {
uni.$u.toast('请选择物理位置')
uni.$u.toast('请选择地理定位')
return
}
if (!this.form.culture) {
+858
View File
@@ -0,0 +1,858 @@
<script>
import dayjs from 'dayjs'
import { getLatestExperienceCoupon, getExperienceCouponList, getExperienceCouponItems, createExperienceCouponOrder, getExperienceCouponCategoryList } from '@/api/product'
export default {
data() {
const webUrl = this.$VUE_APP_RESOURCES_URL
return {
webUrl,
headerImage: webUrl + '/experienceCoupon/header.png',
totalCount: 0,
selectedCount: 0,
initialUsedCount: 0,
remainNum: 0,
startTime: '',
endTime: '',
expireDate: '',
couponList: [],
activeCouponId: null,
categoryList: [
{ id: 'all', name: '全部体验' }
],
activeCategoryId: 'all',
experienceList: [],
selectedProjectIds: [],
userLatitude: null,
userLongitude: null,
merId: ''
}
},
computed: {
filteredList() {
if (this.activeCategoryId === 'all') {
return this.experienceList
}
return this.experienceList.filter(item => item.categoryId === this.activeCategoryId)
},
remainCount() {
return Math.max(this.totalCount - this.selectedCount, 0)
}
},
onLoad() {
this.initPage()
},
methods: {
formatDateByTimestamp(value) {
if (value == null || value === '') {
return ''
}
if (typeof value === 'number') {
const ts = value > 1000000000000 ? value : value * 1000
return dayjs(ts).format('YYYY-MM-DD')
}
const num = Number(value)
if (!Number.isNaN(num)) {
const ts = num > 1000000000000 ? num : num * 1000
return dayjs(ts).format('YYYY-MM-DD')
}
return value
},
initPage() {
this.getUserLocation()
this.fetchExperienceCoupon()
this.fetchCouponList()
this.fetchCategoryList()
},
getUserLocation() {
uni.getLocation({
type: 'gcj02',
success: (res) => {
this.userLatitude = res.latitude
this.userLongitude = res.longitude
this.updateDistances()
},
fail: (err) => {
console.error('获取位置失败', err)
}
})
},
updateDistances() {
if (!this.experienceList.length || !this.userLatitude || !this.userLongitude) {
return
}
this.experienceList = this.experienceList.map(item => {
if (item.latitude && item.longitude) {
return {
...item,
distance: this.calculateDistance(this.userLatitude, this.userLongitude, item.latitude, item.longitude)
}
}
return item
})
},
calculateDistance(lat1, lon1, lat2, lon2) {
if (!lat1 || !lon1 || !lat2 || !lon2) return ''
const R = 6371 // 地球半径 km
const dLat = (lat2 - lat1) * Math.PI / 180
const dLon = (lon2 - lon1) * Math.PI / 180
const a =
Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) *
Math.sin(dLon / 2) * Math.sin(dLon / 2)
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
const d = R * c
return d.toFixed(1) + 'km'
},
setActiveCoupon(coupon) {
if (!coupon) {
return
}
this.activeCouponId = coupon.id
this.activeCategoryId = 'all'
this.totalCount = coupon.totalNum || 0
const remain = coupon.remainNum != null ? coupon.remainNum : 0
this.remainNum = remain
this.initialUsedCount = Math.max(this.totalCount - remain, 0)
this.selectedProjectIds = []
this.selectedCount = this.initialUsedCount
this.startTime = coupon.startTime || ''
this.endTime = coupon.endTime || ''
this.expireDate = this.endTime || this.expireDate
this.headerImage = coupon.experienceCouponImage || (this.webUrl + '/experienceCoupon/header.png')
this.fetchCategoryList()
this.fetchExperienceItems()
},
fetchExperienceCoupon() {
getLatestExperienceCoupon().then(({ data }) => {
if (!data) {
return
}
const latest = {
...data,
startTime: this.formatDateByTimestamp(data.startTime),
endTime: this.formatDateByTimestamp(data.endTime)
}
this.merId = latest.merId || ''
this.setActiveCoupon(latest)
if (!this.couponList.length) {
this.couponList = [latest]
}
}).catch(() => {})
},
fetchCouponList() {
getExperienceCouponList().then(({ data }) => {
const list = (data || []).map(item => ({
...item,
startTime: this.formatDateByTimestamp(item.startTime),
endTime: this.formatDateByTimestamp(item.endTime)
}))
this.couponList = list
if (!this.activeCouponId && list.length > 0) {
this.setActiveCoupon(list[0])
}
}).catch(() => {})
},
fetchCategoryList() {
if (!this.activeCouponId) {
this.categoryList = [{ id: 'all', name: '全部体验' }]
return
}
const params = { couponId: this.activeCouponId }
getExperienceCouponCategoryList(params).then(({ data }) => {
const list = data || []
this.categoryList = [
{ id: 'all', name: '全部体验' },
...list.map(item => ({
id: item.id,
name: item.name
}))
]
}).catch(() => {
this.categoryList = [{ id: 'all', name: '全部体验' }]
})
},
fetchExperienceItems() {
if (!this.activeCouponId) {
this.experienceList = []
return
}
const params = {
couponId: this.activeCouponId
}
if (this.activeCategoryId && this.activeCategoryId !== 'all') {
params.experienceStoreCategoryId = this.activeCategoryId
}
getExperienceCouponItems(params).then(({ data }) => {
const list = data || []
const selectedSet = new Set(this.selectedProjectIds)
this.experienceList = list.map(item => {
const lat = Number(item.latitude || 0)
const lon = Number(item.longitude || 0)
let distance = ''
if (this.userLatitude && this.userLongitude && lat && lon) {
distance = this.calculateDistance(this.userLatitude, this.userLongitude, lat, lon)
}
const id = item.id != null ? item.id : (item.projectId != null ? item.projectId : item.merId)
return {
id,
experienceMerchantId: item.merId || item.experienceMerchantId || item.storeId || '',
title: item.name || '',
subTitle: item.projectName || item.intro || '',
distance,
latitude: lat,
longitude: lon,
businessTime: item.serviceTime && item.serviceEndTime ? `${item.serviceTime}-${item.serviceEndTime}` : (item.serviceTime || '00:00-23:59'),
tags: item.intro || '',
categoryId: this.activeCategoryId === 'all' ? 'all' : this.activeCategoryId,
image: item.image || item.cover || '',
selected: selectedSet.has(id),
rawData: item
}
})
this.selectedCount = this.initialUsedCount + this.selectedProjectIds.length
}).catch(() => {
this.experienceList = []
})
},
changeCoupon(coupon) {
this.setActiveCoupon(coupon)
},
changeCategory(id) {
this.activeCategoryId = id
this.fetchExperienceItems()
},
toggleSelect(item) {
if (!item.selected && this.remainCount === 0) {
uni.showToast({
title: '体验券数量已达上限',
icon: 'none'
})
return
}
item.selected = !item.selected
const id = item.id
if (item.selected) {
if (!this.selectedProjectIds.includes(id)) {
this.selectedProjectIds.push(id)
}
} else {
this.selectedProjectIds = this.selectedProjectIds.filter(pid => pid !== id)
}
this.selectedCount = this.initialUsedCount + this.selectedProjectIds.length
},
goExperienceStoreDetail(item) {
const merchantId = item.merId
if (!merchantId) {
uni.showToast({
title: '未找到体验店信息',
icon: 'none'
})
return
}
const query = []
query.push('experienceMerchantId=' + encodeURIComponent(merchantId))
uni.navigateTo({
url: '/pkg_product/views/experienceProjectDetail?' + query.join('&')
})
},
submitOrder() {
if (!this.activeCouponId) {
uni.showToast({
title: '当前无可用体验券',
icon: 'none'
})
return
}
if (!this.selectedProjectIds.length) {
uni.showToast({
title: '请先选择体验项目',
icon: 'none'
})
return
}
const projectIds = this.selectedProjectIds.slice()
const data = {
couponId: this.activeCouponId,
projectIds
}
createExperienceCouponOrder(data).then((res) => {
if (res.success || (res.data && res.data.status === 'SUCCESS')) {
uni.showToast({
title: '下单成功',
icon: 'success'
})
setTimeout(() => {
uni.navigateTo({
url: '/pages/order/MyOrder/index?type=3&tabIndex=1'
})
}, 1500)
} else {
uni.showToast({
title: res.msg || '下单失败,请稍后重试',
icon: 'none'
})
}
}).catch(() => {
uni.showToast({
title: '下单失败,请稍后重试',
icon: 'none'
})
})
},
handleContinueSelect() {
this.submitOrder()
},
handleGoExperience() {
this.submitOrder()
},
handleConfirm() {
this.submitOrder()
}
}
}
</script>
<template>
<view class="experience-coupon-page">
<view class="header">
<image
:src="headerImage"
class="header-bg"
mode="aspectFill"
/>
<view class="header-mask" />
<view class="header-blur-transition" />
<view class="header-content">
<scroll-view
v-if="couponList.length > 1"
scroll-x
class="coupon-tabs-scroll"
:show-scrollbar="false"
>
<view class="coupon-tabs">
<view
v-for="(coupon, index) in couponList"
:key="coupon.id"
class="header-tag-main"
:class="{ active: activeCouponId === coupon.id }"
@click="changeCoupon(coupon)"
>
体验券{{ index + 1}}
</view>
</view>
</scroll-view>
<view class="header-tag-main active" v-if="couponList.length === 1">请选择您的免费体验券</view>
<view class="header-main">
<view class="line-info flex ai-center">
根据您的套餐您有 <view class="num-badge">{{ totalCount }}</view> 张体验券可以选择
</view>
<view class="line-status flex ai-center">
<view class="status-pill flex ai-center" style="flex-shrink: 0;">
<u-icon name="checkmark-circle" color="#fff" size="14" style="margin-left: 6rpx; flex-shrink: 0;" />
<text class="status-text" style="white-space: nowrap;">已选清单</text>
<view class="count-badge" style="white-space: nowrap;">{{ selectedCount }}/{{ totalCount }}</view>
</view>
<view class="date-info flex ai-center" style="flex-shrink: 0;">
<text style="white-space: nowrap;">请在</text>
<view class="date-badge" style="white-space: nowrap;">{{ expireDate }}</view>
<text style="white-space: nowrap;">内选择使用</text>
</view>
</view>
<view class="line-library flex ai-center">
<image :src="webUrl + '/piaoquan.png'" class="icon-shop" mode="widthFix" />
<text class="v12-font-32">可用体验券库</text>
</view>
</view>
</view>
</view>
<view class="content">
<scroll-view scroll-x class="tabs-scroll" :show-scrollbar="false">
<view class="tabs flex">
<view
v-for="item in categoryList"
:key="item.id"
class="tab-item"
:class="{ active: activeCategoryId === item.id }"
@click="changeCategory(item.id)"
>
{{ item.name }}
</view>
</view>
</scroll-view>
<view
v-if="filteredList.length === 0"
class="empty-state"
>
<image
:src="webUrl + '/orderIcon/nodata.png'"
class="empty-image"
mode="widthFix"
/>
<view class="empty-text">
暂无数据
</view>
</view>
<view
v-else
class="card-list"
>
<view
v-for="item in filteredList"
:key="item.id"
class="card"
@click="goExperienceStoreDetail(item)"
>
<image
:src="item.image"
class="card-image"
mode="aspectFill"
/>
<view class="card-body">
<view class="card-title">
{{ item.title }}
</view>
<view class="info-row flex jc-between ai-center">
<view class="card-subtitle more-t">
{{ item.subTitle }}
</view>
<view class="meta-distance" v-if="item.distance">
<u-icon name="map" color="#999" size="14" style="margin-right: 4rpx;" />
<text>距该地{{ item.distance }}</text>
</view>
</view>
<view class="card-meta">
<text class="meta-time">营业时间{{ item.businessTime }}</text>
</view>
<view class="card-footer flex jc-center ai-center">
<view
class="card-btn"
:class="{ selected: item.selected }"
@click.stop="toggleSelect(item)"
>
{{ item.selected ? '取消选择' : '选择' }}
<view v-if="item.selected" class="check-icon-wrapper">
<u-icon name="checkmark" color="#C52733" size="14" bold />
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="bottom-bar" v-if="selectedCount > 0">
<view
v-if="remainCount > 0"
class="bottom-group flex jc-between ai-center"
>
<view
class="btn-outline"
>
继续选择还可以选{{ remainCount }}
</view>
<view
class="btn-primary"
@click="handleGoExperience"
>
先去体验
</view>
</view>
<view
v-else
class="bottom-single"
>
<view
class="btn-primary"
@click="handleConfirm"
>
确认
</view>
</view>
</view>
</view>
</template>
<style scoped lang="less">
.experience-coupon-page {
min-height: 100vh;
padding-bottom: 140rpx;
background: #f5f5f5;
color: #333;
}
.header {
position: relative;
height: 500rpx;
overflow: hidden;
}
.header-bg {
width: 100%;
height: 100%;
}
.header-mask {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.6) 100%);
z-index: 1;
}
.header-blur-transition {
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 200rpx; /* 增加过渡高度让渐变更平缓 */
background: linear-gradient(to bottom, rgba(245, 245, 245, 0) 0%, rgba(245, 245, 245, 0.4) 40%, rgba(245, 245, 245, 0.8) 70%, #f5f5f5 100%);
pointer-events: none;
z-index: 2;
}
.header-content {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
padding: 32rpx;
padding-bottom: 120rpx; /* 为下方内容上移留出空间 */
box-sizing: border-box;
color: #fff;
display: flex;
flex-direction: column;
justify-content: space-between;
z-index: 3;
}
.header-tag-main {
align-self: flex-start;
padding: 12rpx 32rpx 12rpx 24rpx;
background: #fff;
font-weight: bold;
color: #333;
font-size: 28rpx;
border-radius: 40rpx;
flex-shrink: 0;
}
.header-tag-main.active {
background: #C52733;
color: #fff;
}
.header-main {
margin-bottom: 20rpx;
}
.coupon-tabs-scroll {
width: 100%;
white-space: nowrap;
margin-bottom: 20rpx;
}
.coupon-tabs {
display: flex;
gap: 16rpx;
padding-right: 24rpx;
flex-wrap: nowrap;
}
.coupon-tab-item {
padding: 8rpx 24rpx;
border-radius: 32rpx;
background: rgba(255, 255, 255, 0.2);
border: 1rpx solid rgba(255, 255, 255, 0.4);
font-size: 24rpx;
color: #fff;
&.active {
background: #fff;
color: #C52733;
border-color: #fff;
}
}
.line-info {
font-size: 26rpx;
margin-bottom: 16rpx;
justify-content: flex-end;
}
.num-badge {
background: #C52733;
color: #fff;
width: 40rpx;
height: 40rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
margin: 0 8rpx;
font-weight: bold;
}
.line-status {
justify-content: space-between;
gap: 16rpx;
margin-bottom: 24rpx;
flex-wrap: nowrap;
overflow-x: auto;
white-space: nowrap;
}
/* 隐藏滚动条 */
.line-status::-webkit-scrollbar {
display: none;
}
.status-pill {
background: #C52733;
padding: 6rpx 6rpx 6rpx 20rpx;
border-radius: 32rpx;
color: #fff;
font-size: 22rpx;
white-space: nowrap;
}
.status-text {
margin:0 12rpx;
}
.icon-check {
width: 24rpx;
height: 24rpx;
border-radius: 50%;
border: 2rpx solid #fff;
margin-right: 8rpx;
position: relative;
}
.icon-check::after {
content: '';
position: absolute;
left: 6rpx;
top: 4rpx;
width: 8rpx;
height: 4rpx;
border-left: 2rpx solid #fff;
border-bottom: 2rpx solid #fff;
transform: rotate(-45deg);
}
.count-badge {
background: #fff;
color: #333;
padding: 4rpx 16rpx;
border-radius: 24rpx;
font-size: 24rpx;
}
.date-info {
font-size: 26rpx;
color: #fff;
white-space: nowrap;
}
.date-badge {
background: #C52733;
padding: 6rpx 16rpx;
border-radius: 100rpx;
margin: 0 8rpx;
font-size: 32rpx;
font-weight: bold;
}
.line-library {
font-size: 28rpx;
font-weight: 500;
.icon-shop {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
}
.content {
padding: 0 24rpx;
margin-top: -120rpx; /* 将下方内容整体上移,覆盖在渐变区域上 */
position: relative;
z-index: 4;
}
.tabs-scroll {
width: 100%;
white-space: nowrap;
margin-bottom: 24rpx;
}
.tabs {
display: flex;
gap: 16rpx;
padding-right: 24rpx;
}
.tab-item {
padding: 12rpx 32rpx;
border-radius: 32rpx;
background: #fff;
color: #666;
font-size: 26rpx;
flex-shrink: 0;
font-style: italic;
font-weight: bold;
&.active {
background: #C52733;
color: #fff;
}
}
.card-list {
padding-bottom: 24rpx;
column-count: 2;
column-gap: 6rpx;
}
.card {
margin-bottom: 24rpx;
border-radius: 20rpx;
overflow: hidden;
background: #fff;
break-inside: avoid;
}
.card-image {
width: 100%;
height: 438rpx;
display: block;
}
.card-body {
padding: 16rpx;
}
.card-title {
font-size: 28rpx;
font-weight: bold;
color: #333;
margin-bottom: 8rpx;
}
.card-subtitle {
font-size: 22rpx;
color: #999;
flex: 1;
min-width: 0;
margin-right: 16rpx;
}
.info-row {
margin-bottom: 8rpx;
}
.card-meta {
font-size: 22rpx;
margin-bottom: 16rpx;
}
.meta-distance {
display: flex;
align-items: center;
color: #999;
flex-shrink: 0;
font-size: 22rpx;
}
.icon-location {
width: 20rpx;
height: 20rpx;
border: 2rpx solid #666;
border-radius: 50%;
margin-right: 4rpx;
position: relative;
}
.icon-location::after {
content: '';
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 6rpx;
height: 6rpx;
background: #666;
border-radius: 50%;
}
.meta-time {
display: block;
color: #333;
font-weight: 500;
}
.card-footer {
margin-top: 12rpx;
}
.card-btn {
width: 100%;
height: 64rpx;
border-radius: 32rpx;
font-size: 26rpx;
border: 1rpx solid #C52733;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
position: relative;
background: #C52733;
color: #fff;
}
.check-icon-wrapper {
position: absolute;
right: -8rpx;
top: -8rpx;
background: #fff;
border-radius: 50%;
width: 28rpx;
height: 28rpx;
display: flex;
align-items: center;
justify-content: center;
z-index: 1;
/* 缺口在图标的左下角方向 (225deg左右设为透明) */
background: linear-gradient(#fff, #fff) padding-box,
conic-gradient(from 225deg, transparent 0deg 90deg, #C52733 90deg 360deg) border-box;
border: 2rpx solid transparent;
box-shadow: 0 0 0 2rpx #fff; /* 外层白边 */
}
/* 移除之前的伪元素遮挡方案 */
.bottom-bar {
position: fixed;
left: 0;
right: 0;
bottom: 0;
padding: 24rpx 32rpx 48rpx;
background: #fff;
box-shadow: 0 -4rpx 16rpx rgba(0, 0, 0, 0.05);
z-index: 10;
}
.bottom-group {
gap: 24rpx;
}
.btn-outline {
flex: 1.2;
height: 88rpx;
border-radius: 44rpx;
border: 2rpx solid #333;
text-align: center;
font-size: 28rpx;
line-height: 84rpx;
color: #333;
background: #fff;
font-weight: bold;
font-style: italic;
}
.btn-primary {
flex: 1;
height: 88rpx;
border-radius: 44rpx;
text-align: center;
font-size: 30rpx;
line-height: 88rpx;
color: #fff;
background: #C52733;
font-weight: bold;
font-style: italic;
}
.bottom-single .btn-primary {
width: 100%;
}
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 60rpx 0;
}
.empty-image {
width: 320rpx;
height: 320rpx;
}
.empty-text {
font-size: 28rpx;
color: #999;
margin-top: 20rpx;
}
</style>
@@ -0,0 +1,649 @@
<template>
<view class="coupon-order-detail">
<view class="status-banner" :class="{ 'completed': isCompleted || isExpired }">
<view v-if="isCompleted">
<view class="status-text v12-dark-text">已完成</view>
<view class="status-subtext v12-dark-text">期待再次光临</view>
</view>
<view v-else-if="isExpired">
<view class="status-text v12-dark-text">已过期</view>
<view class="status-subtext v12-dark-text">很遗憾你的体验券已过期</view>
</view>
<text v-else class="status-text">{{ statusText }}</text>
</view>
<view class="qrcode-card" v-if="!isCompleted && !isExpired">
<view class="merchant-header" v-if="orderInfo.merchantName" @click="goStoreDetail">
<image :src="webUrl + '/orderIcon/shop.png'" class="shop-icon" />
<text class="merchant-name">{{ orderInfo.merchantName }}</text>
<image :src="webUrl + '/orderIcon/arrow.png'" class="arrow-icon" />
</view>
<view class="project-name v12-font-34">
{{ orderInfo.experienceItemInfo.themeName || '' }}
</view>
<view class="qrcode-wrap" v-if="orderInfo.code">
<image :src="orderInfo.code" class="qrcode-image" mode="aspectFit" />
</view>
<view class="verify-code">
<text class="label">核销码</text>
<text class="value">{{ orderInfo.verifyCode || '-' }}</text>
<image :src="webUrl + '/orderIcon/copy.png'" class="copy-icon" @click="copyVerifyCode" v-if="orderInfo.verifyCode" />
</view>
<view v-if="orderInfo.validityPeriod" class="valid-time">
有效期 {{ orderInfo.validityPeriod || '-' }}
</view>
</view>
<view class="merchant-card">
<view class="merchant-card-top">
<image :src="orderInfo.experienceItemInfo.themeImage " class="merchant-avatar" mode="aspectFill" />
<view class="merchant-info">
<view class="merchant-name-large">{{ orderInfo.merchantName }}</view>
<view class="merchant-time" v-if="formattedBusinessTime">营业时间{{ formattedBusinessTime }}</view>
<view class="merchant-actions">
<view class="action-btn" @click="openLocation">
<u-icon :name="webUrl + '/page/qianxian/icon-addr.png'" color="#fff" size="24"></u-icon>
</view>
<view class="action-btn" @click="callMerchant">
<u-icon :name="webUrl + '/page/qianxian/icon-phone.png'" color="#fff" size="24"></u-icon>
</view>
</view>
<view class="merchant-location-wrap one-t v12-mb-2">
<image :src="webUrl + '/orderIcon/map.png'" class="location-icon" />
<text class="distance-text" v-if="distanceText">距该地{{ distanceText }}km</text>
<text class="address-text">{{ orderInfo.address }}</text>
</view>
</view>
</view>
</view>
<view class="detail-section">
<view class="section-title">订单详情</view>
<view class="info-row" v-if="isCompleted || isExpired">
<text class="label"> </text>
<text class="value">{{ orderInfo.experienceItemInfo && orderInfo.experienceItemInfo.themeName ? orderInfo.experienceItemInfo.themeName : '' }}</text>
</view>
<view class="info-row">
<text class="label">订单号</text>
<view class="value with-copy">
<text>{{ orderInfo.orderId || '' }}</text>
<image :src="webUrl + '/orderIcon/copy.png'" class="copy-icon" @click="copyOrderId" v-if="orderInfo.orderId" />
</view>
</view>
<view class="info-row">
<text class="label">订单类型</text>
<text class="value">{{ orderInfo.orderTypeDesc || '免费体验券' }}</text>
</view>
<view class="info-row" v-if="isCompleted">
<text class="label">核销时间</text>
<text class="value">{{ formatTime(orderInfo.verifyTime) || '-' }}</text>
</view>
<view class="info-row" v-if="isCompleted">
<text class="label">订单状态</text>
<text class="value">核销完成</text>
</view>
<view class="info-row" v-if="isExpired && orderInfo.endTime">
<text class="label">到期时间</text>
<text class="value">{{ orderInfo.endTime || '-' }}</text>
</view>
<view class="info-row" v-if="isExpired">
<text class="label">订单状态</text>
<text class="value">已过期</text>
</view>
</view>
<view class="notice-section" v-if="!isCompleted && !isExpired">
<view class="section-title">使用须知</view>
<view class="rich-text-content">
<u-parse :content="orderInfo.experienceItemInfo && orderInfo.experienceItemInfo.useNotice ? orderInfo.experienceItemInfo.useNotice : ''"></u-parse>
</view>
</view>
<view class="bottom-bar" v-if="isCompleted || isExpired">
<view class="home-btn" @click="goHome">
<u-icon name="home" color="#C52733" size="38rpx" class="home-icon"></u-icon>
<text>返回主页</text>
</view>
</view>
</view>
</template>
<script>
import { getExperienceCouponOrderDetail } from '@/api/product'
export default {
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
orderId: '',
orderInfo: {},
userLatitude: null,
userLongitude: null,
distanceText: '',
pollTimer: null
}
},
computed: {
statusText() {
const status = this.orderInfo.experienceOrderStatus
if (status === 0) {
return '待使用'
}
if (status === 1) {
return '已完成'
}
if (status === 2) {
return '已过期'
}
return ''
},
isCompleted() {
return this.orderInfo.experienceOrderStatus === 1
},
isExpired() {
return this.orderInfo.experienceOrderStatus === 2
},
formattedBusinessTime() {
return (this.orderInfo.serviceTime || '00:00') + '~' + (this.orderInfo.serviceEndTime || '23:59')
}
},
onLoad(options) {
if (options && options.orderId) {
this.orderId = options.orderId
this.fetchDetail()
}
this.getUserLocation()
},
onUnload() {
uni.setStorageSync('needRefreshMyOrderList', 1)
this.stopOrderPoll()
},
onHide() {
this.stopOrderPoll()
},
methods: {
fetchDetail() {
if (!this.orderId) {
return
}
getExperienceCouponOrderDetail(this.orderId).then(({ data }) => {
this.orderInfo = data || {}
this.updateDistance()
if (!this.isCompleted && !this.isExpired) {
this.startOrderPoll()
} else {
this.stopOrderPoll()
}
}).catch(() => {})
},
startOrderPoll() {
if (this.pollTimer || !this.orderId) {
return
}
this.pollTimer = setInterval(() => {
if (this.isCompleted || this.isExpired) {
this.stopOrderPoll()
return
}
this.fetchDetail()
}, 5000)
},
stopOrderPoll() {
if (this.pollTimer) {
clearInterval(this.pollTimer)
this.pollTimer = null
}
},
getUserLocation() {
uni.getLocation({
type: 'gcj02',
success: res => {
this.userLatitude = res.latitude
this.userLongitude = res.longitude
this.updateDistance()
}
})
},
formatTimestamp(timestamp) {
if (!timestamp) return ''
const date = new Date(Number(timestamp))
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${year}-${month}-${day}`
},
formatTime(timestamp) {
if (!timestamp) return ''
const date = new Date(Number(timestamp))
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
return `${year}${month}${day}`
},
goHome() {
uni.switchTab({
url: '/pages/home/index'
})
},
updateDistance() {
if (
this.userLatitude == null ||
this.userLongitude == null ||
this.orderInfo.latitude == null ||
this.orderInfo.longitude == null
) {
return
}
const lat1 = Number(this.userLatitude)
const lon1 = Number(this.userLongitude)
const lat2 = Number(this.orderInfo.latitude)
const lon2 = Number(this.orderInfo.longitude)
const R = 6371
const dLat = (lat2 - lat1) * Math.PI / 180
const dLon = (lon2 - lon1) * Math.PI / 180
const a =
Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) *
Math.sin(dLon / 2) * Math.sin(dLon / 2)
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
const d = R * c
this.distanceText = d.toFixed(1)
},
callMerchant() {
const phone = this.orderInfo.merchantPhone || this.orderInfo.merPhone || (this.orderInfo.experienceItemInfo && this.orderInfo.experienceItemInfo.phone) || this.orderInfo.companyTel;
if (phone) {
uni.makePhoneCall({
phoneNumber: phone
})
} else {
uni.showToast({ title: '暂无商家电话', icon: 'none' })
}
},
openLocation() {
if (this.orderInfo.latitude && this.orderInfo.longitude) {
uni.openLocation({
latitude: Number(this.orderInfo.latitude),
longitude: Number(this.orderInfo.longitude),
name: this.orderInfo.merchantName,
address: this.orderInfo.address
})
} else {
uni.showToast({ title: '暂无位置信息', icon: 'none' })
}
},
goStoreDetail() {
const merchantId = this.orderInfo.merId || this.orderInfo.merchantId || this.orderInfo.hotelId
if (!merchantId) {
uni.showToast({ title: '未找到店铺信息', icon: 'none' })
return
}
uni.navigateTo({
url: '/pkg_product/views/experienceProjectDetail?experienceMerchantId=' + encodeURIComponent(merchantId)
})
},
copyVerifyCode() {
if (!this.orderInfo.verifyCode) {
return
}
uni.setClipboardData({
data: this.orderInfo.verifyCode,
success: () => {
uni.showToast({
title: '已复制核销码',
icon: 'none'
})
}
})
},
copyOrderId() {
if (!this.orderInfo.orderId) {
return
}
uni.setClipboardData({
data: this.orderInfo.orderId,
success: () => {
uni.showToast({
title: '已复制订单号',
icon: 'none'
})
}
})
}
}
}
</script>
<style scoped lang="less">
.coupon-order-detail {
min-height: 100vh;
padding: 24rpx;
box-sizing: border-box;
background: #f5f5f5;
padding-bottom: 120rpx;
}
.status-banner {
background: #C52733;
border-radius: 16rpx;
padding: 24rpx 32rpx;
margin-bottom: 24rpx;
}
.status-banner.completed {
background: #fff;
padding: 32rpx;
}
.status-text {
color: #fff;
font-size: 32rpx;
font-weight: bold;
}
.status-text.dark-text {
color: #333;
font-size: 36rpx;
margin-bottom: 8rpx;
}
.status-subtext {
font-size: 24rpx;
color: #666;
}
.qrcode-card {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.merchant-header {
width: 100%;
display: flex;
align-items: center;
margin-bottom: 24rpx;
align-self: flex-start;
}
.shop-icon {
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
}
.merchant-name {
font-size: 28rpx;
color: #333;
font-weight: 500;
}
.arrow-icon {
width: 24rpx;
height: 24rpx;
margin-left: 8rpx;
}
.project-name {
font-size: 36rpx;
color: #333;
font-weight: bold;
margin-bottom: 24rpx;
text-align: center;
}
.qrcode-wrap {
width: 336rpx;
height: 336rpx;
margin-bottom: 24rpx;
border-radius: 20px;
border: 1px solid #B8B8B8;
padding: 20rpx;
box-sizing: border-box;
}
.qrcode-image {
width: 100%;
height: 100%;
}
.verify-code {
display: flex;
align-items: center;
margin-bottom: 16rpx;
}
.verify-code .label {
font-size: 28rpx;
color: #666;
}
.verify-code .value {
font-size: 40rpx;
color: #333;
font-weight: bold;
margin: 0 16rpx;
}
.copy-icon {
width: 32rpx;
height: 32rpx;
}
.valid-time {
font-size: 24rpx;
color: #999;
}
.merchant-card {
background: #fff;
border-radius: 16rpx;
padding: 24rpx;
margin-bottom: 24rpx;
display: flex;
flex-direction: column;
}
.merchant-card-top {
display: flex;
position: relative;
margin-bottom: 24rpx;
}
.merchant-avatar {
width: 220rpx;
height: 220rpx;
border-radius: 12rpx;
margin-right: 24rpx;
flex-shrink: 0;
}
.merchant-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
overflow: hidden;
}
.merchant-name-large {
font-size: 32rpx;
color: #333;
font-weight: bold;
margin-bottom: 8rpx;
}
.merchant-card-bottom {
display: flex;
align-items: center;
justify-content: space-between;
}
.merchant-time {
font-size: 24rpx;
color: #666;
margin-bottom: 0;
line-height: 1.4;
word-break: break-all;
flex: 1;
padding-right: 24rpx;
}
.merchant-location-wrap {
display: flex;
align-items: center;
font-size: 24rpx;
color: #999;
}
.location-icon {
width: 24rpx;
height: 24rpx;
margin-right: 4rpx;
flex-shrink: 0;
}
.distance-text {
margin-right: 12rpx;
flex-shrink: 0;
}
.address-text {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.merchant-actions {
display: flex;
flex-direction: row;
align-items: center;
flex-shrink: 0;
justify-content: flex-end;
margin: 20rpx 0;
}
.action-btn {
width: 64rpx;
height: 64rpx;
border-radius: 50%;
background: #C52733;
display: flex;
align-items: center;
justify-content: center;
margin-left: 16rpx;
}
.detail-section {
background: #fff;
border-radius: 16rpx;
padding: 24rpx;
margin-bottom: 24rpx;
}
.section-title {
font-size: 32rpx;
color: #333;
font-weight: bold;
margin-bottom: 24rpx;
}
.info-row {
display: flex;
margin-bottom: 16rpx;
}
.info-row:last-child {
margin-bottom: 0;
}
.info-row .label {
font-size: 28rpx;
color: #666;
}
.info-row .value {
font-size: 28rpx;
color: #333;
flex: 1;
}
.info-row .value.with-copy {
display: flex;
align-items: center;
}
.info-row .value.with-copy .copy-icon {
margin-left: 16rpx;
}
.notice-section {
background: #fff;
border-radius: 16rpx;
padding: 24rpx;
}
.notice-item {
display: flex;
align-items: flex-start;
margin-bottom: 12rpx;
}
.notice-item:last-child {
margin-bottom: 0;
}
.notice-item .dot {
color: #666;
margin-right: 8rpx;
font-size: 24rpx;
}
.notice-item .text {
color: #666;
font-size: 26rpx;
line-height: 1.5;
}
.rich-text-content {
font-size: 26rpx;
color: #666;
line-height: 1.6;
}
.bottom-bar {
position: fixed;
bottom: 40rpx;
left: 0;
right: 0;
display: flex;
justify-content: center;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
.home-btn {
width: 686rpx;
height: 88rpx;
// background: #E8EBF0;
border: 2rpx solid #C52733;
border-radius: 44rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
color: #C52733;
font-weight: bold;
}
.home-icon {
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
}
</style>
@@ -0,0 +1,739 @@
<template>
<view class="experience-project-page">
<hx-navbar
:fixed="true"
:background-color="[0, [0, 0, 0, 0], [0, 0, 0, 0]]"
statusBarFontColor="#ffffff"
barPlaceholder="hidden"
transparent="auto"
color="#ffffff"
/>
<scroll-view scroll-y class="page-scroll">
<view class="hero-wrap">
<swiper v-if="bannerList.length > 0 || project.video" class="hero-img" circular :autoplay="swiperAutoplay" :interval="3000" @change="handleSwiperChange">
<swiper-item v-if="project.video">
<video :src="project.video" id="hero-video" class="hero-img" :autoplay="currentSwiperIndex === 0" object-fit="contain" :controls="false" :enable-progress-gesture="false" @play="onVideoPlay" @ended="onVideoEnd" @pause="onVideoEnd" @click="toggleVideo"></video>
</swiper-item>
<swiper-item v-for="(item, index) in bannerList" :key="index">
<image :src="item" class="hero-img" mode="heightFix|widthFix" />
</swiper-item>
</swiper>
<image
v-else-if="project.cover"
:src="project.cover"
class="hero-img"
mode="aspectFill"
/>
</view>
<view class="content">
<view class="store-card">
<view class="store-name">
{{ project.name }}
</view>
<view class="store-intro">
{{ project.intro }}
</view>
<view class="store-tags" style="display: flex; flex-wrap: wrap; align-items: center;">
<view style="display: flex; align-items: center; margin-right: 16rpx; border-radius: 44rpx;">
<view style="border-radius: 44rpx 0 0 44rpx;font-size: 24rpx; color: #fff; background-color: #C52733; height: 44rpx; display: flex; align-items: center; padding: 0 20rpx; position: relative; z-index: 1;">营业时间</view>
<view style="font-size: 24rpx; color: #333; background-color: #fff; border: 2rpx solid #C52733; border-radius: 44rpx; height: 44rpx; display: flex; align-items: center; padding: 0 20rpx 0 16rpx; box-sizing: border-box; margin-left: -20rpx; position: relative; z-index: 2;">
{{ project.serviceTime || '00:00' }}~{{ project.serviceEndTime || '23:59' }}
</view>
</view>
<view class="license-tag" @click="handleViewLicense">营业执照</view>
</view>
<view class="store-meta">
<view class="meta-left">
<!-- <u-icon
:name="webUrl + '/page/qianxian/icon-location.png'"
size="20"
color="#C52733"
/> -->
<view class="meta-info">
<text class="meta-text">
{{ project.cityName }}{{ project.address }}
</text>
</view>
<view v-if="distanceText" class="distance-row">
<u-icon :name="webUrl + '/orderIcon/map.png'" size="16"></u-icon>
<text class="distance-text">距该地{{ distanceText }}</text>
</view>
</view>
<view class="meta-actions">
<view class="action-item" @click="handleNavigate">
<view class="action-icon">
<u-icon :name="webUrl + '/page/qianxian/icon-addr.png'" color="#fff" size="24"></u-icon>
</view>
<text class="action-text">导航</text>
</view>
<view class="action-item" @click="handleContact">
<view class="action-icon">
<u-icon :name="webUrl + '/page/qianxian/icon-phone.png'" color="#fff" size="24"></u-icon>
</view>
<text class="action-text">客服</text>
</view>
</view>
</view>
</view>
<view class="experience-badge-wrap">
<view class="experience-badge">
<view class="badge-diamond">
<view class="badge-icon">
<u-icon :name="webUrl + '/icon/zuanshi.png'" color="#F9D24D" size="16"></u-icon>
</view>
</view>
<view class="badge-bg">
<text class="badge-text">超值体验</text>
</view>
</view>
</view>
<view class="section">
<!-- <view class="section-title">体验项目</view> -->
<swiper
v-if="projectList.length > 0"
class="experience-swiper"
:style="{ height: experienceSwiperHeight ? (experienceSwiperHeight + 'px') : '520rpx' }"
circular
:autoplay="true"
:interval="3000"
:indicator-dots="false"
indicator-color="rgba(255, 255, 255, .4)"
indicator-active-color="#ffffff"
@change="handleExperienceSwiperChange"
>
<swiper-item v-for="(item, index) in projectList" :key="index">
<view :id="'experience-card-' + index" class="experience-card">
<image
v-if="item.projectImage"
:src="item.projectImage"
class="experience-image"
mode="widthFix|heightFix"
@load="onExperienceImageLoad"
/>
<view class="experience-info">
<view class="experience-title-wrap">
<view class="experience-title">
{{ item.themeName || item.projectName }}
</view>
</view>
<view class="experience-subtitle">
{{ item.projectIntro || item.detail }}
</view>
</view>
</view>
</swiper-item>
</swiper>
</view>
<view class="section" v-if="project.detailText || project.remark">
<view class="section-title" v-if="project.detailText">详情</view>
<view class="detail-list">
<view class="v12-font-26" style="color:#666">
<u-parse :content="project.detailText"></u-parse>
</view>
</view>
<template v-if="project.remark">
<view class="section-title" style="margin-top: 24rpx;">备注</view>
<view class="section-text with-dot">
<text class="dot"></text>
<text>{{ project.remark }}</text>
</view>
</template>
</view>
<view class="section" v-if="usageNotice">
<view class="section-title">使用须知</view>
<view class="section-content">
<u-parse :content="usageNotice"></u-parse>
</view>
</view>
<view class="bottom-space" />
</view>
</scroll-view>
</view>
</template>
<script>
import { getExperienceStoreDetail } from '@/api/qianxian'
export default {
data() {
const webUrl = this.$VUE_APP_RESOURCES_URL
return {
webUrl,
project: {
id: '',
name: '',
cover: '',
intro: '',
serviceTime: '',
serviceEndTime: '',
cityName: '',
address: '',
latitude: '',
longitude: '',
phone: '',
wechat: '',
video: '',
banner: '',
experienceTitle: '',
experienceSubTitle: '',
detailText: '',
remark: '',
qualification: ''
},
detailList: [],
experienceMerchantId: '',
totalPrice: 0,
validFrom: '',
validTo: '',
usageNotice: '',
currentSwiperIndex: 0,
videoContext: null,
swiperAutoplay: true,
isVideoPlaying: false,
projectList: [],
userLatitude: null,
userLongitude: null,
distanceText: '',
currentExperienceIndex: 0,
experienceSwiperHeight: 0
}
},
computed: {
bannerList() {
if (!this.project.banner) return []
return this.project.banner.split(',').filter(item => item)
}
},
onLoad(query) {
const decode = v => decodeURIComponent(v || '')
const id = query.experienceMerchantId || query.id || ''
this.experienceMerchantId = id
this.project.id = id
this.project.name = decode(query.name)
this.project.cover = decode(query.cover)
this.project.video = decode(query.video)
this.project.banner = decode(query.banner)
this.project.intro = decode(query.intro)
this.project.serviceTime = query.serviceTime || ''
this.project.serviceEndTime = query.serviceEndTime || ''
this.project.cityName = decode(query.cityName)
this.project.address = decode(query.address)
this.project.latitude = query.latitude || ''
this.project.longitude = query.longitude || ''
this.project.experienceTitle = decode(query.experienceTitle || '')
this.project.experienceSubTitle = decode(query.experienceSubTitle || '')
this.project.detailText = decode(query.detailText || '')
this.project.remark = decode(query.remark || '')
this.validFrom = query.validFrom || ''
this.validTo = query.validTo || ''
this.usageNotice = decode(query.usageNotice || '')
this.getUserLocation()
if (query.detailList) {
try {
const list = JSON.parse(decode(query.detailList))
if (Array.isArray(list)) {
this.detailList = list.map(item => ({
name: item.name || '',
count: item.count || ''
}))
}
} catch (e) {}
}
this.fetchProjectDetail()
},
onReady() {
this.videoContext = uni.createVideoContext('hero-video', this)
},
methods: {
handleSwiperChange(e) {
this.currentSwiperIndex = e.detail.current
if (this.project.video && this.videoContext) {
if (this.currentSwiperIndex === 0) {
this.videoContext.play()
} else {
this.videoContext.pause()
}
}
},
onVideoPlay() {
this.swiperAutoplay = false
this.isVideoPlaying = true
},
onVideoEnd() {
this.swiperAutoplay = true
this.isVideoPlaying = false
},
toggleVideo() {
if (!this.videoContext) return
if (this.isVideoPlaying) {
this.videoContext.pause()
this.swiperAutoplay = true
} else {
this.videoContext.play()
}
},
handleExperienceSwiperChange(e) {
this.currentExperienceIndex = e.detail.current || 0
this.updateExperienceSwiperHeight(this.currentExperienceIndex)
},
onExperienceImageLoad() {
this.updateExperienceSwiperHeight(this.currentExperienceIndex)
},
updateExperienceSwiperHeight(index) {
const targetIndex = Number.isInteger(index) ? index : this.currentExperienceIndex
this.$nextTick(() => {
const query = uni.createSelectorQuery().in(this)
query.select('#experience-card-' + targetIndex).boundingClientRect(rect => {
if (rect && rect.height) {
this.experienceSwiperHeight = rect.height
}
}).exec()
})
},
fetchProjectDetail() {
if (!this.experienceMerchantId) {
return
}
uni.showLoading({
title: '加载中',
mask: true
})
getExperienceStoreDetail(this.experienceMerchantId).then(res => {
if (res && res.status === 200) {
const data = res.data || {}
this.project.name = data.name || this.project.name
this.project.cover = data.cover || this.project.cover
this.project.video = data.video || this.project.video
this.project.banner = data.banner || this.project.banner
this.project.intro = data.intro || this.project.intro
this.project.serviceTime = data.serviceTime || this.project.serviceTime
this.project.serviceEndTime = data.serviceEndTime || this.project.serviceEndTime
this.project.cityName = data.cityName || this.project.cityName
this.project.address = data.address || this.project.address
this.project.latitude = data.latitude || this.project.latitude
this.project.longitude = data.longitude || this.project.longitude
this.updateDistance()
this.project.phone = data.phone || this.project.phone
this.project.wechat = data.wechat || this.project.wechat
this.project.qualification = data.qualification || this.project.qualification
const project = data.project || {}
this.project.experienceTitle = project.themeName || this.project.experienceTitle || this.project.name
if (project.themeImage) {
this.project.cover = project.themeImage
}
this.project.detailText = project.detail || this.project.detailText
this.project.remark = project.remark || this.project.remark
this.usageNotice = project.useNotice || this.usageNotice
console.log('this.usageNotice', this.usageNotice)
if (project.totalPrice != null) {
this.totalPrice = project.totalPrice
}
if (data.totalPrice != null && this.totalPrice === 0) {
this.totalPrice = data.totalPrice
}
if (project.validityStartTime) {
this.validFrom = project.validityStartTime
}
if (project.validityEndTime) {
this.validTo = project.validityEndTime
}
if (project.projectList && project.projectList.length) {
this.projectList = project.projectList
this.currentExperienceIndex = 0
this.detailList = project.projectList.map(item => ({
name: item.projectName || '',
count: item.projectIntro || ''
}))
this.updateExperienceSwiperHeight(0)
setTimeout(() => {
this.updateExperienceSwiperHeight(0)
}, 200)
}
}
}).finally(() => {
uni.hideLoading()
})
},
getUserLocation() {
uni.getLocation({
type: 'gcj02',
success: res => {
this.userLatitude = Number(res.latitude)
this.userLongitude = Number(res.longitude)
this.updateDistance()
}
})
},
calculateDistance(lat1, lon1, lat2, lon2) {
if (!lat1 || !lon1 || !lat2 || !lon2) {
return ''
}
const R = 6371
const dLat = (lat2 - lat1) * Math.PI / 180
const dLon = (lon2 - lon1) * Math.PI / 180
const a =
Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) *
Math.sin(dLon / 2) * Math.sin(dLon / 2)
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
const d = R * c
return d.toFixed(1) + 'km'
},
updateDistance() {
const storeLatitude = Number(this.project.latitude)
const storeLongitude = Number(this.project.longitude)
if (
this.userLatitude == null ||
this.userLongitude == null ||
!storeLatitude ||
!storeLongitude
) {
this.distanceText = ''
return
}
this.distanceText = this.calculateDistance(
this.userLatitude,
this.userLongitude,
storeLatitude,
storeLongitude
)
},
handleNavigate() {
if (!this.project.latitude || !this.project.longitude) {
uni.showToast({
title: '暂无位置信息',
icon: 'none'
})
return
}
uni.openLocation({
latitude: Number(this.project.latitude),
longitude: Number(this.project.longitude),
name: this.project.name,
address: this.project.address
})
},
handleContact() {
if (!this.project.phone) {
uni.showToast({
title: '暂无联系方式',
icon: 'none'
})
return
}
uni.makePhoneCall({
phoneNumber: this.project.phone
})
},
handleViewLicense() {
if (this.project.qualification) {
uni.navigateTo({
url: `/pkg_product/views/storeLicense?name=${encodeURIComponent(this.project.name)}&images=${encodeURIComponent(this.project.qualification)}`
})
} else {
uni.showToast({
title: '暂无营业执照',
icon: 'none'
})
}
}
}
}
</script>
<style scoped lang="less">
.section-content {
font-size: 26rpx;
color: #666;
line-height: 1.6;
}
.experience-project-page {
min-height: 100vh;
background: #f5f5f5;
}
.page-scroll {
// height: calc(100vh - 120rpx);
}
.hero-wrap {
position: relative;
width: 100%;
height: 700rpx;
overflow: hidden;
}
.hero-img {
width: 100%;
height: 100%;
}
.content {
margin-top: -100rpx;
padding: 0 24rpx 40rpx;
box-sizing: border-box;
position: relative;
z-index: 2;
}
.store-card {
padding: 32rpx 24rpx;
border-radius: 24rpx;
background: #ffffff;
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.06);
}
.store-name {
color: #333;
font-size: 36rpx;
font-weight: bold;
}
.store-intro {
margin-top: 16rpx;
color: #666;
font-size: 26rpx;
line-height: 1.5;
}
.store-tags {
display: flex;
align-items: center;
margin-top: 24rpx;
gap: 16rpx;
}
.time-tag {
display: flex;
align-items: center;
border: 1rpx solid #C52733;
border-radius: 24rpx;
overflow: hidden;
height: 40rpx;
}
.time-tag-label {
background: #C52733;
color: #ffffff;
font-size: 22rpx;
padding: 0 16rpx;
height: 100%;
line-height: 40rpx;
}
.time-tag-value {
color: #333;
font-size: 22rpx;
padding: 0 16rpx;
height: 100%;
line-height: 40rpx;
background: #ffffff;
}
.license-tag {
border: 1rpx solid #C52733;
color: #C52733;
font-size: 22rpx;
padding: 0 16rpx;
border-radius: 24rpx;
height: 40rpx;
line-height: 40rpx;
}
.store-meta {
margin-top: 32rpx;
padding-top: 32rpx;
// border-top: 1rpx solid #f0f0f0;
display: flex;
align-items: center;
justify-content: space-between;
}
.meta-left {
flex: 1;
// display: flex;
align-items: center;
padding-right: 32rpx;
}
.meta-info {
display: flex;
flex-direction: column;
row-gap: 8rpx;
}
.distance-row {
margin-left: 4rpx;
display: flex;
align-items: center;
column-gap: 8rpx;
}
.distance-text {
font-size: 22rpx;
color: #666;
margin-top: 8rpx;
}
.meta-text {
margin-left: 12rpx;
font-size: 26rpx;
color: #333;
font-weight: 500;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.meta-actions {
display: flex;
align-items: center;
gap: 32rpx;
flex-shrink: 0;
}
.action-item {
display: flex;
flex-direction: column;
align-items: center;
}
.action-icon {
width: 64rpx;
height: 64rpx;
border-radius: 50%;
background: #C52733;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 8rpx;
}
.action-text {
font-size: 22rpx;
color: #333;
}
.section-experience {
margin-top: 40rpx;
position: relative;
}
.experience-badge-wrap {
z-index: 10;
margin-top: 40rpx;
margin-left: 20rpx;
}
.experience-badge {
display: flex;
align-items: center;
position: relative;
height: 44rpx;
}
.badge-diamond {
width: 44rpx;
height: 44rpx;
background: #ffffff;
border: 4rpx solid #C52733;
transform: rotate(45deg);
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
box-sizing: border-box;
margin-left: -14rpx;
}
.badge-icon {
transform: rotate(-45deg);
display: flex;
align-items: center;
justify-content: center;
}
.badge-bg {
background: #C52733;
border-radius: 0 24rpx 24rpx 0;
height: 100%;
display: flex;
align-items: center;
padding: 0 20rpx 0 24rpx;
margin-left: -16rpx;
}
.badge-text {
color: #ffffff;
font-size: 24rpx;
font-weight: bold;
font-style: italic;
line-height: 1;
}
.experience-card {
border-radius: 24rpx;
background: #C52733;
overflow: hidden;
box-shadow: 0 8rpx 24rpx rgba(197, 39, 51, 0.15);
margin-bottom: 24rpx;
}
.experience-swiper {
margin-top: 16rpx;
width: 100%;
}
.experience-image {
width: 100%;
height: 360rpx;
border-radius: 24rpx;
display: block;
}
.experience-info {
padding: 24rpx;
}
.experience-title-wrap {
display: inline-block;
background: #ffffff;
border-radius: 40rpx;
padding: 8rpx 32rpx;
margin-bottom: 16rpx;
}
.experience-title {
color: #C52733;
font-size: 32rpx;
font-weight: bold;
}
.experience-subtitle {
color: #ffffff;
font-size: 26rpx;
opacity: 0.9;
}
.section {
margin-top: 24rpx;
padding: 32rpx 24rpx;
border-radius: 24rpx;
background: #ffffff;
}
.section-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-bottom: 24rpx;
}
.detail-list {
background: transparent;
}
.detail-item {
display: flex;
align-items: flex-start;
justify-content: space-between;
font-size: 26rpx;
color: #666;
margin-bottom: 16rpx;
}
.detail-name {
flex: 1;
display: flex;
align-items: flex-start;
line-height: 1.5;
}
.detail-count {
margin-left: 24rpx;
color: #999;
}
.dot {
display: inline-block;
width: 8rpx;
height: 8rpx;
border-radius: 50%;
background: #999;
margin-top: 14rpx;
margin-right: 16rpx;
flex-shrink: 0;
}
.section-text {
font-size: 26rpx;
color: #666;
line-height: 1.6;
}
.with-dot {
display: flex;
align-items: flex-start;
margin-bottom: 16rpx;
}
.bottom-space {
height: 40rpx;
}
</style>
+68
View File
@@ -207,6 +207,24 @@
:id="'video-item' + index"
:poster="item.video + '?vframe/jpg/offset/1'"></video>
</view>
<view
v-if="item.linkHotelId"
class="info-shop-entry"
@click.stop="handleInfoHotelClick(item)"
>
<view class="info-shop-logo">
<image :src="item.linkHotelLogo" mode="aspectFill" />
</view>
<view class="info-shop-main">
<view class="info-shop-name">
{{ item.linkHotelName || '' }}
</view>
<view class="info-shop-btn">
<text style="margin-right: 6rpx;">点击进入</text>
<u-icon name="arrow-rightward" size="14" color="#fff"></u-icon>
</view>
</view>
</view>
<view class="info-item-bottom">
<view class="time">
{{ item.createTime ? item.createTime.replace(/-/g, '.').substr(0, 10) : '' }}
@@ -1639,6 +1657,10 @@ export default {
}
})
},
handleInfoHotelClick(item) {
if (!item || !item.linkHotelId) return
this.villageItemClick({ id: item.linkHotelId })
},
guideItemClickHandle(item) {
// 如果没有开启专题页,则不进入
if (!item.isContentPage) return
@@ -2172,6 +2194,52 @@ export default {
}
}
}
.info-shop-entry {
margin: 0 20rpx 16rpx 20rpx;
padding: 16rpx 20rpx;
border-radius: 12rpx;
background-color: #fafafa;
display: flex;
align-items: center;
column-gap: 16rpx;
}
.info-shop-logo {
width: 88rpx;
height: 88rpx;
border-radius: 12rpx;
overflow: hidden;
flex-shrink: 0;
}
.info-shop-logo image {
width: 100%;
height: 100%;
}
.info-shop-main {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
column-gap: 16rpx;
}
.info-shop-name {
flex: 1;
font-size: 28rpx;
color: #333;
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.info-shop-btn {
padding: 8rpx 16rpx 8rpx 24rpx;
border-radius: 999rpx;
background-color: #C52733;
color: #fff;
font-size: 24rpx;
flex-shrink: 0;
display: flex;
align-items: center;
}
.info-item-bottom {
display: flex;
align-items: center;
+53 -1
View File
@@ -75,6 +75,7 @@
</view>
</view>
</view>
<!-- 套餐详情模拟 -->
<view class="v12-px-3 v12-mt-3" v-if="detail.packageDetails && detail.packageDetails.length > 0">
@@ -115,7 +116,30 @@
</view>
</view>
</view>
<view class="v12-mt-3 v12-px-3" v-if="detail.experienceCouponRule">
<view class="section v12-radius-60 v12-white v12-px-3 v12-pt-3 experience-card">
<view class="v12-mt-2 v12-pl-2 v12-font-bold v12-font-36 v12-align-center title-wrap">
<text class="v12-mr-1">{{ detail.experienceCouponRule.ruleTitle1 }}</text>
</view>
<view class="v12-mt-2">
<view class="grid-txt v12-justify-between v12-align-center">
<view class="v12-px-2 v12-py-1"><u-icon :name="webUrl + '/icon/gift.png'" size="18"></u-icon></view>
<text class="v12-px-2 v12-py-1 v12-white v12-radius-100">{{ detail.experienceCouponRule.ruleSubTitle1 }}</text>
</view>
</view>
<view class="v12-mt-3 image-grid">
<view class="image-item" v-for="(img, idx) in detail.experienceCouponRule.ruleImages" :key="idx">
<image :src="img" mode="aspectFill" @click="previewHero(detail.experienceCouponRule.ruleImages, img)" />
</view>
</view>
<view class="v12-mt-3 v12-pl-2 v12-font-bold v12-font-36 v12-align-center title-wrap">
<text class="v12-mr-1">{{ detail.experienceCouponRule.ruleTitle2 }}</text>
</view>
<view class="v12-mt-2 v12-font-26">
<rich-text :nodes="detail.experienceCouponRule.ruleContent"></rich-text>
</view>
</view>
</view>
<view class="v12-px-3 v12-mt-3">
<view class="section v12-radius-60 v12-white v12-px-3 v12-pt-3">
<view class="v12-mt-2 v12-pl-2 v12-font-bold v12-font-36 v12-align-center title-wrap">
@@ -566,6 +590,34 @@ export default {
height: 34rpx;
margin-right: 10rpx;
}
.experience-card .benefit-chip{
display: inline-flex;
align-items: center;
background: #FADE9F;
border: 1rpx solid #FADE9F;
color: #333;
border-radius: 100rpx;
padding: 8rpx 16rpx;
font-size: 24rpx;
}
.experience-card .image-grid{
display: flex;
gap: 16rpx;
overflow-x: auto;
padding-bottom: 8rpx;
}
.experience-card .image-item{
flex: 0 0 auto;
width: 200rpx;
height: 200rpx;
border-radius: 20rpx;
overflow: hidden;
background: #f5f5f5;
}
.experience-card .image-item image{
width: 100%;
height: 100%;
}
.page-scroll { height: calc(100vh - 120rpx); }
.hero-swiper {
width: 100%;
+85 -30
View File
@@ -93,35 +93,69 @@
<text>{{ tab.name }}</text>
</view>
</view>
<view class="v12-justify-between sanctup-items v12-mt-3">
<view v-for="(item, index) in items" :key="index" class="v12-pa-1" @click="toStore(item)">
<view class="img">
<video
class="img"
:src="item.cover"
:play-btn-position="'center'"
:show-fullscreen-btn="false"
:show-center-play-btn="false"
:show-play-btn="false"
:controls="false"
:poster="item.cover + '?vframe/jpg/offset/1'"
v-if="item.coverType === 2">
</video>
<image v-else class="img" :src="item.cover"></image>
<view class="v12-white-text address">
<image
class="map-icon v12-mr-1"
:src="webUrl + '/orderIcon/map_white.png'"
></image>
<text class="v12-font-28">{{ item.areaName }}</text>
<view class="waterfall-box v12-mt-3 v12-px-2">
<view class="waterfall-column">
<view v-for="(item, index) in leftItems" :key="index" class="v12-pa-1" @click="toStore(item)">
<view class="img">
<video
class="img"
:src="item.cover"
:play-btn-position="'center'"
:show-fullscreen-btn="false"
:show-center-play-btn="false"
:show-play-btn="false"
:controls="false"
:poster="item.cover + '?vframe/jpg/offset/1'"
v-if="item.coverType === 2">
</video>
<image v-else class="img" :src="item.cover" mode="aspectFill"></image>
<view class="v12-white-text address">
<image
class="map-icon v12-mr-1"
:src="webUrl + '/orderIcon/map_white.png'"
></image>
<text class="v12-font-28">{{ item.areaName }}</text>
</view>
</view>
<view v-if="item.intro" class="v12-font-bold v12-font-28 v12-mt-1 more-t desc-txt">{{ item.intro }}</view>
<view class="v12-justify-start v12-align-center v12-mb-1">
<view class="atr">
<image class="atr" :src="item.avatar"></image>
</view>
<view class="v12-font-26 v12-ml-2 v12-dark-text one-t">{{ item.name }}</view>
</view>
</view>
<view v-if="item.intro" class="v12-font-bold v12-font-28 v12-mt-1 more-t desc-txt">{{ item.intro }}</view>
<view class="v12-justify-start v12-align-center v12-my-1">
<view class="atr">
<image class="atr" :src="item.avatar"></image>
</view>
<view class="waterfall-column">
<view v-for="(item, index) in rightItems" :key="index" class="v12-pa-1" @click="toStore(item)">
<view class="img">
<video
class="img"
:src="item.cover"
:play-btn-position="'center'"
:show-fullscreen-btn="false"
:show-center-play-btn="false"
:show-play-btn="false"
:controls="false"
:poster="item.cover + '?vframe/jpg/offset/1'"
v-if="item.coverType === 2">
</video>
<image v-else class="img" :src="item.cover" mode="aspectFill"></image>
<view class="v12-white-text address">
<image
class="map-icon v12-mr-1"
:src="webUrl + '/orderIcon/map_white.png'"
></image>
<text class="v12-font-28">{{ item.areaName }}</text>
</view>
</view>
<view v-if="item.intro" class="v12-font-bold v12-font-28 v12-mt-1 more-t desc-txt">{{ item.intro }}</view>
<view class="v12-justify-start v12-align-center v12-mb-1">
<view class="atr">
<image class="atr" :src="item.avatar"></image>
</view>
<view class="v12-font-26 v12-ml-2 v12-dark-text one-t">{{ item.name }}</view>
</view>
<view class="v12-font-26 v12-ml-2 v12-dark-text one-t">{{ item.name }}</view>
</view>
</view>
</view>
@@ -158,6 +192,12 @@ export default {
wellnessButtonSrc() {
const config = this.topImageConfig || {}
return config.wellnessButtonImageFocus || config.wellnessButtonImage || ''
},
leftItems() {
return this.items.filter((item, index) => index % 2 === 0)
},
rightItems() {
return this.items.filter((item, index) => index % 2 !== 0)
}
},
onLoad(opts) {
@@ -331,8 +371,8 @@ export default {
position: relative;
}
.desc-txt {
height: 78rpx;
line-height: 40rpx;
max-height: 78rpx;
}
.address{
position: absolute;
@@ -346,17 +386,32 @@ export default {
display: grid;
grid-template-columns: 50% 50%;
}
.waterfall-box {
display: flex;
justify-content: space-between;
align-items: flex-start;
}
.waterfall-column {
width: 49.9%;
display: flex;
flex-direction: column;
.img{
height: 670rpx;
}
}
.atr{
width: 52rpx;
height: 52rpx;
border-radius: 50%;
}
.img{
width: 320rpx;
height: 320rpx;
// background: #707070;
width: 100%;
border-radius: 16rpx;
position: relative;
overflow: hidden;
max-height: 460rpx;
display: block;
min-height: 200rpx;
}
.sanctum-wrap{
min-height: 100vh;
+86 -32
View File
@@ -63,35 +63,69 @@
</view> -->
<text class=" v12-font-34 v12-dark-text v12-mr-5 v12-font-bold">大家都在看</text>
</view>
<view class="v12-justify-between sanctup-items v12-mt-3">
<view v-for="(item, index) in items" :key="index" class="v12-pa-1" @click="toStore(item)">
<view class="img">
<video
class="img"
:src="item.cover"
:play-btn-position="center"
:show-fullscreen-btn="false"
:show-center-play-btn="flase"
:show-play-btn="false"
:controls="false"
:poster="item.cover + '?vframe/jpg/offset/1'"
v-if="item.coverType === 2">
</video>
<image v-else class="img" :src="item.cover"></image>
<view class="v12-white-text address">
<image
class="map-icon v12-mr-1"
:src="webUrl + '/orderIcon/map_white.png'"
></image>
<text class="v12-font-28">{{ item.areaName }}</text>
<view class="waterfall-box v12-mt-3">
<view class="waterfall-column">
<view v-for="(item, index) in leftItems" :key="index" class="v12-pa-1" @click="toStore(item)">
<view class="img">
<video
class="img"
:src="item.cover"
:play-btn-position="center"
:show-fullscreen-btn="false"
:show-center-play-btn="flase"
:show-play-btn="false"
:controls="false"
:poster="item.cover + '?vframe/jpg/offset/1'"
v-if="item.coverType === 2">
</video>
<image v-else class="img" :src="item.cover" mode="aspectFill"></image>
<view class="v12-white-text address">
<image
class="map-icon v12-mr-1"
:src="webUrl + '/orderIcon/map_white.png'"
></image>
<text class="v12-font-28">{{ item.areaName }}</text>
</view>
</view>
<view v-if="item.intro" class="v12-font-bold v12-font-28 v12-mt-1 more-t desc-txt">{{ item.intro }}</view>
<view class="v12-justify-start v12-align-center v12-my-1">
<view class="atr">
<image class="atr" :src="item.avatar"></image>
</view>
<view class="v12-font-26 v12-ml-2 v12-dark-text one-t">{{ item.name }}</view>
</view>
</view>
<view v-if="item.intro" class="v12-font-bold v12-font-28 v12-mt-1 more-t desc-txt">{{ item.intro }}</view>
<view class="v12-justify-start v12-align-center v12-my-1">
<view class="atr">
<image class="atr" :src="item.avatar"></image>
</view>
<view class="waterfall-column">
<view v-for="(item, index) in rightItems" :key="index" class="v12-pa-1" @click="toStore(item)">
<view class="img">
<video
class="img"
:src="item.cover"
:play-btn-position="center"
:show-fullscreen-btn="false"
:show-center-play-btn="flase"
:show-play-btn="false"
:controls="false"
:poster="item.cover + '?vframe/jpg/offset/1'"
v-if="item.coverType === 2">
</video>
<image v-else class="img" :src="item.cover" mode="aspectFill"></image>
<view class="v12-white-text address">
<image
class="map-icon v12-mr-1"
:src="webUrl + '/orderIcon/map_white.png'"
></image>
<text class="v12-font-28">{{ item.areaName }}</text>
</view>
</view>
<view v-if="item.intro" class="v12-font-bold v12-font-28 v12-mt-1 more-t desc-txt">{{ item.intro }}</view>
<view class="v12-justify-start v12-align-center v12-my-1">
<view class="atr">
<image class="atr" :src="item.avatar"></image>
</view>
<view class="v12-font-26 v12-ml-2 v12-dark-text one-t">{{ item.name }}</view>
</view>
<view class="v12-font-26 v12-ml-2 v12-dark-text one-t">{{ item.name }}</view>
</view>
</view>
</view>
@@ -128,7 +162,12 @@ export default {
wellnessButtonSrc() {
const config = this.topImageConfig || {}
return config.wellnessButtonImage || config.wellnessButtonImageFocus || ''
keyword: ''
},
leftItems() {
return this.items.filter((item, index) => index % 2 === 0)
},
rightItems() {
return this.items.filter((item, index) => index % 2 !== 0)
}
},
onLoad(opts) {
@@ -293,8 +332,8 @@ export default {
position: relative;
}
.desc-txt {
height: 78rpx;
line-height: 40rpx;
max-height: 78rpx;
}
.address{
position: absolute;
@@ -308,22 +347,37 @@ export default {
display: grid;
grid-template-columns: 50% 50%;
}
.waterfall-box {
display: flex;
justify-content: space-between;
align-items: flex-start;
}
.waterfall-column {
width: 49.9%;
display: flex;
flex-direction: column;
.img{
height: 670rpx;
}
}
.atr{
width: 52rpx;
height: 52rpx;
border-radius: 50%;
}
.img{
width: 320rpx;
height: 320rpx;
// background: #707070;
width: 100%;
border-radius: 16rpx;
position: relative;
overflow: hidden;
max-height: 460rpx;
display: block;
min-height: 200rpx;
}
.sanctum-wrap{
min-height: 100vh;
background-color: #fff;
padding: 20rpx ;
padding: 10rpx ;
}
.tab{
position: relative;
+121 -3
View File
@@ -75,7 +75,6 @@
</view>
</view>
<!-- 商家电话弹窗 -->
<u-popup :show="showPhonePopup" mode="center" round="10" :safe-area-inset-bottom="false">
<view class="phone-popup">
<view class="phone-title">{{ title }}</view>
@@ -98,6 +97,21 @@
</view>
</u-popup>
<u-popup :show="showExperienceCouponPopup" bgColor="transparent" mode="center" round="10" :safe-area-inset-bottom="false">
<image class="" :src="webUrl + '/tiyan.png'" mode="widthFix" lazy-load="false">
</image>
<!-- <view class="experience-popup">
<view class="experience-title">体验券提醒</view>
<view class="experience-content">您有可领取的体验券可前往体验券页面领取</view>
</view> -->
<view class="experience-actions v12-align-center">
<view class="v12-font-28 v12-dark-border v12-radius-100 v12-px-2 close-btn" @click="showExperienceCouponPopup = !showExperienceCouponPopup">暂不领取</view>
<view class="v12-font-28 v12-primary-text v12-primary-border v12-radius-100 v12-px-2 go-btn" @click="goExperienceCoupon">去领取体验券</view>
</view>
</u-popup>
<!-- 联系人信息 -->
<view class="contact-section" v-if="orderInfo.realName && orderInfo.userPhone">
<view class="section-title v12-font-28 v12-font-bold">联系人信息</view>
@@ -204,6 +218,7 @@
<script>
import { fetchSojoumOrderDetail,sojoumOrderCheckInTime, sojoumOrderCalendar } from "@/api/sojoumOrder";
import { checkExperienceCoupon } from '@/api/product'
import DateRangePicker from '@/components/DateRangePicker/DateRangePicker.vue'
export default {
components: {
@@ -223,17 +238,23 @@ export default {
merchantPhone: '' // 添加商家电话字段
},
showPhonePopup: false, // 控制电话弹窗显示
isView: 0
isView: 0,
showExperienceCouponPopup: false,
experienceCouponId: null,
experienceCouponTimer: null
}
},
onLoad(otps) {
this.key = otps.id;
this.isView = otps.isView || 0;
this.getSojoumOrderDetail();
},
onShow() {
this.getSojoumOrderDetail();
},
onUnload() {
uni.setStorageSync('needRefreshMyOrderList', 1)
this.stopExperienceCouponPolling();
},
methods: {
handleDateRangeChange(dates) {
// if (dates && dates.length === 2) {
@@ -316,9 +337,52 @@ export default {
if (res.status === 200) {
this.orderInfo = res.data;
this.orderInfo.minBookingDays = this.getDaysCount();
this.startExperienceCouponPolling();
uni.hideLoading();
}
},
startExperienceCouponPolling() {
this.stopExperienceCouponPolling();
const statusType = this.orderInfo && this.orderInfo._status && this.orderInfo._status._type;
// if (![1, 2].includes(Number(statusType))) {
// return;
// }
this.checkExperienceCouponStatus();
this.experienceCouponTimer = setInterval(() => {
this.checkExperienceCouponStatus();
}, 5000);
},
stopExperienceCouponPolling() {
if (this.experienceCouponTimer) {
clearInterval(this.experienceCouponTimer);
this.experienceCouponTimer = null;
}
},
async checkExperienceCouponStatus() {
const orderId = this.orderInfo && this.orderInfo.orderId ? this.orderInfo.orderId : this.key;
if (!orderId) {
return;
}
try {
const res = await checkExperienceCoupon({ orderId });
if (!res || res.status !== 200) {
return;
}
const data = res.data || {};
const hasExperienceCoupon = Number(data.hasExperienceCoupon || 0);
const showPopup = Number(data.showPopup || 0);
if (!hasExperienceCoupon) {
return;
}
if (!showPopup) {
return;
}
this.stopExperienceCouponPolling();
this.experienceCouponId = data.couponId || null;
this.showExperienceCouponPopup = true;
} catch (e) {
}
},
/**
* 格式化日期
* @param {string} dateStr - 格式为 yyyy-MM-dd 的日期字符串
@@ -408,6 +472,17 @@ export default {
}
})
},
goExperienceCoupon() {
this.showExperienceCouponPopup = false;
const couponId = this.experienceCouponId;
let url = '/pkg_product/views/experienceCoupon';
if (couponId) {
url += `?couponId=${couponId}`;
}
uni.navigateTo({
url
})
},
// 显示电话弹窗
showPhoneDialog(type) {
if (!this.orderInfo.merPhone && type === 'phone') {
@@ -451,6 +526,18 @@ export default {
</script>
<style lang="scss" scoped>
.close-btn{
width: 274rpx;
margin-right: 30rpx;
height: 52rpx;
opacity: 0;
}
.go-btn{
height: 52rpx;
margin-right: 10rpx;
opacity: 0;
}
.status-section,.product-section,.verify-section {
border-radius: 20rpx;
}
@@ -549,6 +636,37 @@ export default {
}
}
.experience-popup {
padding: 40rpx 50rpx;
border-radius: 20rpx;
background-color: #fff;
width: 560rpx;
box-sizing: border-box;
}
.experience-title {
font-size: 32rpx;
font-weight: bold;
text-align: center;
margin-bottom: 20rpx;
color: #333;
}
.experience-content {
font-size: 28rpx;
color: #666;
text-align: center;
margin-bottom: 40rpx;
}
.experience-actions {
position: absolute;
bottom: 60rpx;
width: 100%;
justify-content: center;
display: flex;
}
.contact-section,
.order-section {
background-color: #fff;
+191 -25
View File
@@ -41,15 +41,11 @@
<view class="v12-align-center v12-font-22 v12-white-text v12-px-2" style=" white-space: nowrap;height: 100%;">营业时间</view>
<view class="v12-align-center v12-primary-border v12-font-22 v12-ml-1 v12-px-2 v12-radius-100 v12-white" style=" white-space: nowrap;height: 100%;">{{ store.serviceTime }} - {{ store.serviceEndTime }}</view>
</view>
</view>
</view>
<view class="v12-pa-3 " v-if="store.tags" style="display: flex;flex-wrap: wrap; align-items: center;">
<view v-for="value in store.tags.split(',')" :key="value" class="v12-px-2 v12-radius-100 v12-mr-2 v12-mb-2 v12-font-24" style="width: fit-content; border: 2rpx solid #888">{{ value }}</view>
<view v-for="value in store.tags.split(',')" :key="value" class="v12-px-2 v12-radius-100 v12-mr-2 v12-mb-2 v12-font-24" style="width: fit-content; border: 2rpx solid #999; color: #666;">{{ value }}</view>
</view>
<view class="inn-signature-wrap">
<view class="triangle"></view>
<!-- <view class="inn-signature">
{{ store.intro }}
</view> -->
<view class="inn-signature-wrap" style="margin-top: 0; padding-top: 0;">
<view class="share-btn" @click="changeShare">
<image :src="webUrl + '/page/hotel/share.png'" class="img" />
</view>
@@ -82,19 +78,22 @@
</view>
</view>
</view>
<view class="top-tab acea-row row-middle row-center">
<view
v-for="(item, index) in tabList"
:key="index"
:class="item.isShow ? '' : 'hide'"
class="tab"
@click="changeTab(item.value)"
>
<view :class="activeIndex === item.value ? 'active' : ''" class="tab-item">
{{ item.text }}
<view class="top-tab">
<scroll-view scroll-x class="tab-scroll" :show-scrollbar="false">
<view class="tab-list">
<view
v-for="(item, index) in tabList"
:key="index"
:class="item.isShow ? '' : 'hide'"
class="tab"
@click="changeTab(item.value)"
>
<view :class="activeIndex === item.value ? 'active' : ''" class="tab-item">
{{ item.text }}
</view>
</view>
</view>
<!-- <view v-show="activeIndex === index" class="btLine"></view> -->
</view>
</scroll-view>
</view>
<view>
<view
@@ -315,6 +314,35 @@
店主还没有上传内容哦~
</view>
</view>
<!-- 体验店 -->
<view v-if="activeIndex === 5" class="v12-pa-3" style="background: #F5F5F5;">
<view class="experience-list">
<view v-for="(item, index) in experienceStoreList" :key="index" class="experience-item" @click="goExperienceStoreDetail(item)">
<view class="img-box">
<image :src="item.cover" mode="aspectFill" class="cover-img"></image>
<view class="location-tag" v-if="item.cityName">
<u-icon :name="webUrl + '/home/icon-location.png'" size="18" color="#fff"></u-icon>
<text class="city-name">{{ item.cityName }}</text>
</view>
</view>
<view class="info-box">
<view class="v12-font-32 v12-font-bold t-one">{{ item.name }}</view>
<view class="v12-font-26 v12-dark1-text one-t" style="margin-top: 8rpx; margin-bottom: 16rpx; line-height: 1.4;">{{ item.intro }}</view>
<view class="bottom-row">
<view class="v12-font-20 v12-font-bold">
营业时间:{{ item.serviceTime || '00:00' }}~{{ item.serviceEndTime || '23:59' }}
</view>
<view class="btn-check">
查看
</view>
</view>
</view>
</view>
</view>
<view v-if="experienceStoreList.length === 0" class="tab-no-data">
店主还没有上传内容哦~
</view>
</view>
</view>
<!-- 分享 -->
<u-popup
@@ -353,7 +381,8 @@ import {
postTravelShare,
getJiaLouProductList,
getJiaLouStewardList,
getJiaLouNewsList
getJiaLouNewsList,
getExperienceStoreList
} from '@/api/qianxian'
import {getUrlParam} from '@/utils/common.js'
import imgBox from '@/components/imageTypeSet/imagebox.vue'
@@ -375,8 +404,9 @@ export default {
tabList: [
{ text: '团购', value: 3, isShow: true },
{ text: '管家', value: 4, isShow: true },
{ text: '体验店', value: 5, isShow: true },
{ text: '资讯', value: 0, isShow: true },
{ text: '文化', value: 1, isShow: true },
// { text: '文化', value: 1, isShow: true },
{ text: '资质', value: 2, isShow: true }
],
activeIndex: 3,
@@ -392,7 +422,9 @@ export default {
jiaLouProductArr: [],
// 管家列表
jiaLouStewardArr: [
]
],
// 体验店列表
experienceStoreList: []
}
},
onPageScroll(e) {
@@ -423,6 +455,9 @@ export default {
if (newVal === 4) {
this.getJiaLouStewardList()
}
if (newVal === 5) {
this.getExperienceStoreList()
}
}
}
},
@@ -443,7 +478,14 @@ export default {
videoEnd() {
this.swiperAutoplay = true;
},
// 跳转管家详情
goExperienceStoreDetail(item) {
const query = []
const id = item.merId || item.id || ''
query.push('experienceMerchantId=' + encodeURIComponent(id))
uni.navigateTo({
url: '/pkg_product/views/experienceProjectDetail?' + query.join('&')
})
},
goHousekeeperDetail(item) {
uni.navigateTo({
url: '/pkg_product/views/housekeeperDetail?id=' + item.id
@@ -467,6 +509,25 @@ export default {
uni.hideLoading()
})
},
getExperienceStoreList() {
uni.showLoading({
title: '加载中',
mask: true
})
const params = {
travelMerchantId: this.store.id,
page: 1,
limit: 99999,
// experienceStoreCategoryId: null // Optional if category filtering is needed
}
getExperienceStoreList(params).then(res => {
if (res.status === 200) {
this.experienceStoreList = res.data.records || []
}
}).finally(() => {
uni.hideLoading()
})
},
getJiaLouProductList() {
uni.showLoading({
title: '加载中',
@@ -855,7 +916,8 @@ export default {
align-items: center;
padding: 20rpx;
border-top: 1px solid #f1f1f1;
font-size: 16px;
font-size: 22rpxl;
font-weight: bold;
.time {
flex: 1;
color: #333;
@@ -1018,24 +1080,128 @@ export default {
color:#A6AAB3;
font-size:28rpx;
}
.experience-list {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.experience-item {
width: 343rpx;
background: #fff;
border-radius: 16rpx;
overflow: hidden;
margin-bottom: 20rpx;
box-shadow: 0 2rpx 10rpx rgba(0,0,0,0.05);
.img-box {
position: relative;
width: 100%;
height: 335rpx;
.cover-img {
width: 100%;
height: 100%;
}
.location-tag {
position: absolute;
bottom: 10rpx;
left: 10rpx;
display: flex;
align-items: center;
// background: rgba(0,0,0,0.5);
// padding: 4rpx 10rpx;
// border-radius: 20rpx;
.city-name {
color: #fff;
font-size: 20rpx;
margin-left: 4rpx;
}
}
}
.info-box {
padding: 16rpx;
.name {
font-size: 28rpx;
font-weight: bold;
color: #333;
margin-bottom: 8rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.intro {
font-size: 22rpx;
color: #999;
margin-bottom: 16rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.bottom-row {
display: flex;
justify-content: space-between;
align-items: center;
.time {
font-size: 20rpx;
color: #666;
}
.btn-check {
background: #C52733;
color: #fff;
font-size: 24rpx;
padding: 4rpx 16rpx;
border-radius: 20rpx;
}
}
}
}
}
.top-tab {
padding-bottom: 30rpx;
padding-top: 30rpx;
background: #fff;
.tab-scroll {
width: 100%;
white-space: nowrap;
.tab-list {
display: inline-flex;
padding: 0 30rpx;
}
}
.tab {
display: inline-block;
width: fit-content;
margin-right: 20rpx;
&:last-child {
margin-right: 0;
}
.tab-item {
height: 52rpx;
padding: 0 30rpx;
border-radius: 26rpx 0 0 26rpx;
border-radius: 26rpx;
font-size: 32rpx;
line-height: 52rpx;
font-weight: bold;
&.active {
color: #fff;
background: linear-gradient(90deg, #C52733 0%, rgba(211,92,101,0.91) 54%, rgba(255,255,255,0.62) 100%);
}
}
&.hide {
display: none;
}
+111
View File
@@ -0,0 +1,111 @@
<template>
<view class="license-page">
<hx-navbar
:fixed="true"
title="营业执照"
:background-color="[1, '#ffffff']"
color="#333333"
/>
<view class="content-wrap">
<view class="store-info">
<text class="label">商家名称</text>
<text class="value">{{ storeName }}</text>
</view>
<view class="license-img-wrap" v-if="licenseImages.length">
<image
v-for="(img, index) in licenseImages"
:key="index"
:src="img"
class="license-img"
mode="widthFix"
@click="previewImage(index)"
/>
</view>
<view class="empty-tips" v-else>
暂无营业执照信息
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
storeName: '',
licenseImages: []
}
},
onLoad(options) {
if (options.name) {
this.storeName = decodeURIComponent(options.name)
}
if (options.images) {
const imagesStr = decodeURIComponent(options.images)
// 处理可能是逗号分隔的多张图片,如果是单张也兼容
this.licenseImages = imagesStr.split(',').filter(item => item.trim())
}
},
methods: {
previewImage(index) {
uni.previewImage({
current: index,
urls: this.licenseImages
})
}
}
}
</script>
<style scoped lang="less">
.license-page {
min-height: 100vh;
background-color: #fff;
}
.content-wrap {
padding: 24rpx 0;
}
.store-info {
background-color: #ffffff;
padding: 0rpx 24rpx;
border-radius: 0;
display: flex;
align-items: flex-start;
margin-bottom: 24rpx;
.label {
font-size: 28rpx;
color: #666;
flex-shrink: 0;
}
.value {
font-size: 28rpx;
color: #333;
font-weight: bold;
flex: 1;
}
}
.license-img-wrap {
background-color: #ffffff;
padding: 24rpx 0;
border-radius: 0;
.license-img {
width: 100%;
display: block;
margin-bottom: 24rpx;
border-radius: 8rpx;
&:last-child {
margin-bottom: 0;
}
}
}
.empty-tips {
text-align: center;
padding: 100rpx 0;
color: #999;
font-size: 28rpx;
}
</style>
+9 -1
View File
@@ -71,6 +71,12 @@
<u-switch v-model="isBlind" activeColor="#c52733"></u-switch>
</view>
</view>
<view class="swich-btn" v-if="!isPayOk && !isGroupBuy">
<view class="v12-font-28 v12-dark-text">一人领取所有礼品</view>
<view>
<u-switch v-model="isOneRecipient" activeColor="#c52733"></u-switch>
</view>
</view>
</view>
<view class="price-wrap" v-if="!(isGroupBuy && isPayOk)">
<view class="v12-font-28 v12-dark-text v12-font-bold">价格明细</view>
@@ -208,6 +214,7 @@ export default {
webUrl: this.$VUE_APP_RESOURCES_URL,
loading: true,
isBlind: false,
isOneRecipient: false,
canTransfer: false,
message: '',
cartId: '',
@@ -525,6 +532,7 @@ export default {
cover: this.selectedCover,
canTransfer: this.canTransfer ? 1 : 0,
isBlind: this.isBlind ? 1 : 0,
isOneRecipient: this.isOneRecipient ? 1 : 0,
payType: this.payType,
seckillId: this.orderGroupInfo.seckill_id,
combinationId: this.orderGroupInfo.combination_id,
@@ -706,7 +714,7 @@ export default {
}
.tip-wrap{
position: absolute;
bottom: 100rpx;
bottom: 50rpx;
left: 0;
margin: auto;
right: 0;