Selaa lähdekoodia

feat: 添加商品图片水印效果并优化开发环境配置

- 更新开发环境API地址配置
- 在首页、购物车、分类、商品项等组件中添加水印图片覆盖层
- 为大健康福利页面添加提交加载状态和防重复提交功能
- 优化搜索页面支持回车键确认搜索
zhangtao 2 päivää sitten
vanhempi
commit
c2ab0d2472

+ 2 - 2
src/config/index.ts

@@ -11,9 +11,9 @@ const mapEnvVersion = {
   // develop: 'http://192.168.1.89:8080', // 田
   // develop: 'http://192.168.0.11:8080', // 王S
   // develop: 'http://74949mkfh190.vicp.fun', // 付
-  // develop: 'http://47.109.84.152:8081',
+  develop: 'http://47.109.84.152:8081',
   // develop: 'https://5ed0f7cc.r9.vip.cpolar.cn',
-  develop: 'https://smqjh.api.zswlgz.com',
+  // develop: 'https://smqjh.api.zswlgz.com',
   /**
    * 体验版
    */

+ 4 - 0
src/pages/index/index.vue

@@ -230,6 +230,10 @@ function handleChangeSwiper(e: UniHelper.SwiperOnChangeEvent) {
                   <view @click="router.push({ name: 'xsb-goods', params: { id: item.prodId } })">
                     <view class="relative h-344rpx">
                       <image :src="item.pic" class="h-344rpx w-344rpx" />
+                      <image
+                        :src="`${StaticUrl}/xsb-shui-index.png`"
+                        class="absolute left-0 top-0 h-344rpx w-344rpx"
+                      />
                       <view class="absolute bottom-0 left-0 flex items-center text-22rpx">
                         <view class="rounded-tl-8rpx bg-[#02ECFD] pl-4rpx">
                           星闪豹

+ 5 - 1
src/subPack-djk/welfare/index.vue

@@ -13,6 +13,7 @@ onLoad((options: any) => {
 const mapUser = ['全部用户', '仅限新用户', '特定用户标签', '指定用户']
 const phone = ref(useUserStore().userInfo.mobile)
 const selectGoods = ref<Api.PmsDjkGoods>()
+const subLoding = ref(false)
 async function getWelfare(id: number) {
   const res = await Apis.djk.welfareInfo({ data: { id } })
   welfare.value = res.data
@@ -23,6 +24,7 @@ async function handleSelect(item: Api.PmsDjkGoods) {
 }
 async function handelSubmit() {
   uni.showLoading({ mask: true })
+  subLoding.value = true
   try {
     await Apis.djk.welfareClaimInfo({
       data: {
@@ -41,10 +43,12 @@ async function handelSubmit() {
         name: 'djk-orderDetaile',
         params: { id: data.data },
       })
+      subLoding.value = false
     }, 1500)
   }
   catch {
     uni.hideLoading()
+    subLoding.value = false
     show.value = false
     console.log('领取失败')
   }
@@ -151,7 +155,7 @@ async function handelSubmit() {
             </wd-button>
           </view>
           <view class="w48%">
-            <wd-button block @click="handelSubmit">
+            <wd-button block :loading="subLoding" @click="handelSubmit">
               确认领取
             </wd-button>
           </view>

+ 11 - 5
src/subPack-xsb/commonTab/components/cart.vue

@@ -50,11 +50,17 @@ onMounted(async () => {
                   <wd-checkbox :model-value="item.id" />
                 </view>
                 <view class="flex flex-1">
-                  <image
-                    :src="item.pic"
-                    class="h206rpx w200rpx flex-shrink-0"
-                    @click.stop="router.push({ name: 'xsb-goods', params: { id: String(item.prodId) } })"
-                  />
+                  <view class="relative">
+                    <image
+                      :src="item.pic"
+                      class="h206rpx w200rpx flex-shrink-0"
+                      @click.stop="router.push({ name: 'xsb-goods', params: { id: String(item.prodId) } })"
+                    />
+                    <image
+                      :src="`${StaticUrl}/xbs-shui-cart.png`"
+                      class="absolute left-0 top-0 h206rpx w200rpx flex-shrink-0"
+                    />
+                  </view>
                   <view class="ml20rpx flex-1">
                     <view class="text-left text-28rpx font-semibold">
                       <!-- <view v-for="i in 2" :key="i" class="mr5px inline-block">

+ 5 - 1
src/subPack-xsb/commonTab/components/classfiy.vue

@@ -471,8 +471,12 @@ function handlePay() {
             <view v-if="productList.length" class="p20rpx">
               <view v-for="item in productList" :id="`class${item.prodId}`" :key="item.id" class="relative">
                 <view class="flex" @click="handleGo(item)">
-                  <view class="mr20rpx h172rpx w172rpx flex-shrink-0 overflow-hidden rounded-16rpx bg-#F6F6F6">
+                  <view class="relative mr20rpx h172rpx w172rpx flex-shrink-0 overflow-hidden rounded-16rpx bg-#F6F6F6">
                     <image :src="item.pic" lazy-load class="h-full w-full" />
+                    <image
+                      :src="`${StaticUrl}/xsb-shui-class.png`"
+                      class="absolute left-0 top-0 h-full w-full"
+                    />
                   </view>
                   <view class="flex-1">
                     <view class="text-left text-28rpx font-semibold">

+ 4 - 0
src/subPack-xsb/components/goodsItem/index.vue

@@ -13,6 +13,10 @@ defineProps<{ itemGoods: Api.xsbCategoryProductList }>()
           :src="itemGoods.pic"
           class="h344rpx w344rpx"
         />
+        <image
+          :src="`${StaticUrl}/xsb-shui-index.png`"
+          class="absolute left-0 top-0 h344rpx w344rpx"
+        />
       </view>
       <view class="mt20rpx px20rpx">
         <view class="line-clamp-2 text-left text-28rpx font-semibold">

+ 12 - 5
src/subPack-xsb/search/index.vue

@@ -1,4 +1,5 @@
 <script setup lang="ts">
+import { StaticUrl } from '@/config'
 import router from '@/router'
 
 definePage({
@@ -104,7 +105,7 @@ function handleSearchText(text: string) {
         <view class="flex flex-1 items-center">
           <wd-icon name="search" size="20px" color="#aaa" />
           <view class="ml20rpx flex-1">
-            <input v-model.trim="searchText" type="text" placeholder="请输入搜索内容">
+            <input v-model.trim="searchText" type="text" placeholder="请输入搜索内容" @confirm="handleSearch">
           </view>
         </view>
         <view class="w-90rpx flex items-center">
@@ -152,10 +153,16 @@ function handleSearchText(text: string) {
     <view v-if="isSearch" class="px24rpx pt20rpx">
       <view v-for="item in data" :key="item.id" class="relative mb20rpx rounded-16rpx bg-white p24rpx">
         <view class="box-border flex items-center justify-between" @click="router.push({ name: 'xsb-goods', params: { id: String(item.prodId) } })">
-          <image
-            :src="item.pic"
-            class="h200rpx w200rpx flex-shrink-0 rounded-16rpx"
-          />
+          <view class="relative">
+            <image
+              :src="item.pic"
+              class="h200rpx w200rpx flex-shrink-0 rounded-16rpx"
+            />
+            <image
+              :src="`${StaticUrl}/xsb-shui-search.png`"
+              class="absolute left-0 top-0 h200rpx w200rpx flex-shrink-0 rounded-16rpx"
+            />
+          </view>
           <view class="ml20rpx flex-1">
             <view class="text-32rpx font-semibold">
               {{ item.prodName }}