修改测试环境

parent bdd970d7
...@@ -15,3 +15,10 @@ export function getCollect(data) { ...@@ -15,3 +15,10 @@ export function getCollect(data) {
method: 'GET', method: 'GET',
}); });
} }
// 商家商品优惠券
export function getCouponShopList(prodId, shopId) {
return request({
url: `/sgyrdd/coupon/couponGoodsShopList/${shopId}/${prodId}`,
method: 'GET',
});
}
<template> <template>
<view class="package-details"> <view class="package-details">
<wd-popup
v-model="showpopup"
position="bottom"
custom-style="height: 50%;"
@close="handleClose"
:safe-area-inset-bottom="true"
custom-class="popup"
></wd-popup>
<!-- 轮播 --> <!-- 轮播 -->
<view class="swiper"> <view class="swiper">
<wd-swiper <wd-swiper
...@@ -17,6 +25,13 @@ ...@@ -17,6 +25,13 @@
<!-- 轮播-end --> <!-- 轮播-end -->
<!-- card --> <!-- card -->
<view class="package-details-card"> <view class="package-details-card">
<wd-overlay :show="show" @click="show = false">
<view class="wrapper">
<view class="block">
{{ productCoupons[0].activityNotes }}
</view>
</view>
</wd-overlay>
<view class="package-details-num"> <view class="package-details-num">
<view class="num"> <view class="num">
<text class="icon"></text> <text class="icon"></text>
...@@ -31,10 +46,10 @@ ...@@ -31,10 +46,10 @@
<text class="yh-name">优惠:</text> <text class="yh-name">优惠:</text>
<view class="bt-icon"> <view class="bt-icon">
<image src="@/static/shop/bt-icon.png"></image> <image src="@/static/shop/bt-icon.png"></image>
<text class="yh-name lj">立减10元</text> <text class="yh-name lj">{{ productCoupons[0].activityName }}</text>
</view> </view>
<view class="ylq-icon"> <view class="ylq-icon" @click="showpopup = true">
已领取 {{ productCoupons[0].numState === 0 ? '未领取' : '已领取' }}
<wd-icon name="arrow-right" size="16px"></wd-icon> <wd-icon name="arrow-right" size="16px"></wd-icon>
</view> </view>
</view> </view>
...@@ -52,7 +67,7 @@ ...@@ -52,7 +67,7 @@
<i class="iconfont icon icon-jinggao" /> <i class="iconfont icon icon-jinggao" />
随时用 随时用
</view> </view>
<i class="iconfont jg icon-jinggao" /> <i @click="alert" class="iconfont jg icon-jinggao" />
</view> </view>
<view class="xz"> <view class="xz">
<text class="yh-name">限制:</text> <text class="yh-name">限制:</text>
...@@ -148,8 +163,10 @@ ...@@ -148,8 +163,10 @@
</template> </template>
<script setup> <script setup>
import { getProdDetail, getCollect } from '@/api/packageDetail'; import { getProdDetail, getCollect, getCouponShopList } from '@/api/packageDetail';
import { getStoreInformation } from '@/api/shop'; import { getStoreInformation } from '@/api/shop';
import { useMessage } from '../../../node_modules/wot-design-uni';
const message = useMessage();
const prodInfo = ref({}); const prodInfo = ref({});
const prodRlue = ref({}); const prodRlue = ref({});
const myProdId = ref(''); const myProdId = ref('');
...@@ -157,19 +174,34 @@ const current = ref(0); ...@@ -157,19 +174,34 @@ const current = ref(0);
const showRlue = ref(true); const showRlue = ref(true);
const imgUrl = import.meta.env.VITE_APP_IMG_URL; const imgUrl = import.meta.env.VITE_APP_IMG_URL;
const shopInfo = ref({}); const shopInfo = ref({});
const show = ref(false);
const currentLatitudeAndLongitude = ref({}); const currentLatitudeAndLongitude = ref({});
const shopId = ref(''); const shopId = ref('');
const showpopup = ref(false);
// 商品优惠券
const productCoupons = ref([]);
onLoad((options) => { onLoad((options) => {
const { prodId } = options; const { prodId } = options;
myProdId.value = prodId; myProdId.value = prodId;
getProdDetailFn(prodId).then((shopId) => { getProdDetailFn(prodId).then((shopId) => {
getStoreInformationFn(shopId); getStoreInformationFn(shopId);
getCouponShopListFn(prodId, shopId);
}); });
}); });
onShow(() => { onShow(() => {
// 获取位置 // 获取位置
getLocationFn(); getLocationFn();
}); });
function alert() {
show.value = true;
}
/**
* 关闭弹窗
*/
function handleClose() {
showpopup.value = false;
}
/** /**
* 获取套餐详情 * 获取套餐详情
* @param {String} prodId * @param {String} prodId
...@@ -198,6 +230,16 @@ function getProdDetailFn(prodId) { ...@@ -198,6 +230,16 @@ function getProdDetailFn(prodId) {
}); });
}); });
} }
/**
* 获取商品优惠券列表
*/
function getCouponShopListFn(prodId, shopId) {
getCouponShopList(prodId, shopId).then((res) => {
if (res.code === 0) {
productCoupons.value = res.data;
}
});
}
/** /**
* 获取收藏 * 获取收藏
*/ */
...@@ -298,6 +340,20 @@ page { ...@@ -298,6 +340,20 @@ page {
flex-direction: column; flex-direction: column;
position: relative; position: relative;
margin-top: -40rpx; margin-top: -40rpx;
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.block {
padding: 20rpx;
box-sizing: border-box;
background-color: #fff;
font-size: 24rpx;
color: #767676;
}
.package-details-num { .package-details-num {
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
......
...@@ -66,13 +66,12 @@ ...@@ -66,13 +66,12 @@
<text class="shop-address-detail">{{ shopInfo.shopAddress }}</text> <text class="shop-address-detail">{{ shopInfo.shopAddress }}</text>
</view> </view>
<view class="shop-map-phone"> <view class="shop-map-phone">
<image mode="aspectFill" class="img1" src="@/static/shop/map.png"></image>
<image <image
mode="aspectFill"
@tap="callShopPhone(shopInfo.phone)" @tap="callShopPhone(shopInfo.phone)"
class="img1" mode="aspectFill"
src="@/static/shop/map.png" src="@/static/shop/phone.png"
></image> ></image>
<image mode="aspectFill" src="@/static/shop/phone.png"></image>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -41,7 +41,7 @@ export default defineConfig({ ...@@ -41,7 +41,7 @@ export default defineConfig({
// 代理配置 // 代理配置
proxy: { proxy: {
'/api': { '/api': {
target: 'http://192.168.0.147:9999', target: 'http://test2.rhhzkj.com:8080',
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''), rewrite: (path) => path.replace(/^\/api/, ''),
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment