From c6da9962ff03d8f2a44c003f9725ca6bfbb4c433 Mon Sep 17 00:00:00 2001
From: zhaojs <349234519@qq.com>
Date: 星期四, 20 七月 2023 11:43:29 +0800
Subject: [PATCH] no message

---
 public/html/compareprice.html |  149 +++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 136 insertions(+), 13 deletions(-)

diff --git a/public/html/compareprice.html b/public/html/compareprice.html
index cf61973..bc90400 100644
--- a/public/html/compareprice.html
+++ b/public/html/compareprice.html
@@ -170,6 +170,7 @@
         display: flex;
         flex-direction: row;
         flex-wrap: nowrap;
+        width: 100%;
     }
 
     .shoplabel___1_Nv0 img {
@@ -203,7 +204,7 @@
     }
 
     .coupon___2SVZi {
-        margin-top: 6px;
+        margin-top: 3px;
         height: .28rem;
         background: linear-gradient(
                 90deg, #ff8873, #ff4f4f);
@@ -321,6 +322,49 @@
             -webkit-line-clamp: 2;
             -webkit-box-orient: vertical;
         }
+        .price_font
+        {
+            font-size: .26rem;
+            color: #787070;
+        }
+        .plat-div
+        {
+            font-size: 0.28rem;
+            padding: 0.2rem;
+            background: #fff;
+            margin-bottom: 0.2rem;
+            display: flex;
+            border-radius: .16rem;
+            align-items: center;
+        }
+        .plat-ite
+        {
+            width: 20%;
+            text-align: center;
+            margin-right: 0.1rem;
+            border-radius: 0.1rem;
+            color: #fff;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            background: #F79633;
+            padding: 0.1rem;
+        }
+        .plat-unite
+        {
+            background: #fff;
+            border:1px solid #F79633;
+            color:#F79633;
+
+            width: 20%;
+            text-align: center;
+            margin-right: 0.1rem;
+            border-radius: 0.1rem;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            padding: 0.1rem;
+        }
     </style>
 </head>
 
@@ -335,7 +379,7 @@
                         娓呯┖
                     </div>
                     <div class="content-txtarea">
-                        <textarea class="txtarea" v-model="txtareatxt" :placeholder='txtplaceholder'></textarea>
+                        <textarea enterkeyhint="search" onkeydown="onTextareaKeyDown()" class="txtarea" v-model="txtareatxt" :placeholder='txtplaceholder'></textarea>
                         <span class="copytxt" v-on:click="fromcopy()">绮樿创</span>
                     </div>
                     <div class="mid-button-content">
@@ -351,6 +395,18 @@
                         鏆傛棤鏁版嵁~
                     </div>
                     <div v-else class="ulist">
+                        <div class="plat-div" v-if="issearch">
+                            <span>骞冲彴锛�</span>
+                            <div v-on:click="changeplat(item)" :class="item.choose?'plat-ite':'plat-unite'" v-for="item in plat">
+                                <span class="plat-span" v-if="item.choose">
+                                    鈭歿{item.platname}}
+                                </span>
+                                <span class="plat-span" v-else>
+                                    {{item.platname}}
+                                </span>
+                            </div>
+                           
+                        </div>
                         <a v-for="g in goodsItem" :key="g.id" v-on:click="handleCdetailFavorite(g)">
                             <div class="detail___3ZQFW">
                                 <img :src="g.mainPic"
@@ -368,7 +424,7 @@
                                         <div class="coupon___2SVZi" style="background: #A429F3;"><span style="color: #A429F3;">杩�</span>{{g.fanli}}鍏�</div>
                                        
                                     </div>
-                                    <div class="price___dfbCD">楼<span>{{g.actualPrice}}</span><u v-if="g.sourceType=='tb'||g.sourceType=='tm'" style="text-decoration:line-through">楼{{g.originalPrice}}</u></div>
+                                    <div class="price___dfbCD"><span class="price_font" style="font-size: .26rem; font-weight: 500;">鍒版墜浠�</span><span style="padding: 0;">楼</span><span style="padding: 0 .08rem 0 0;">{{(g.actualPrice-g.fanli).toFixed(2)}}</span><u v-if="g.sourceType=='tb'||g.sourceType=='tm'" style="text-decoration:line-through">楼{{g.originalPrice}}</u></div>
                                    <!--  <div class="operation___3KazI">
                                         <button>绔嬪嵆璐拱</button>
                                     </div> -->
@@ -386,7 +442,7 @@
 </body>
 
 </html>
-<script type="text/javascript" src="https://cdn.staticfile.org/vue/2.6.11/vue.min.js"></script>
+<script type="text/javascript" src="./js/vue.js"></script>
 <script>
 
 (function () {
@@ -404,6 +460,16 @@
     {
         app.likeDataGet(data);
     }
+
+    function onTextareaKeyDown()
+    {
+        if (event.keyCode == 13)
+        {
+            app.search();
+            document.activeElement.blur();
+        }
+       
+    }
     Vue.use(VueLazyload, {
         preLoad: 1.3,//
         error: 'https://sr.ffquan.cn/cms_pic/20200622/bro7s7f6vrkd3jat4ujg0.png',
@@ -414,15 +480,45 @@
         el: '#comprice',
         data:{
           //posturl:'http://dfg.shop.com',
-          posturl:'https://appapitest.ushopvip.com',
+         // posturl:'http://appapitest.ushopvip.com',
           //posturl:'http://dfgapp.ushopvip.com',
           goodsItem:[],
           loading:false,
+          plat:[
+            {
+                'platname':'娣樺疂',
+                'plat':'tb',
+                'choose':true
+            },
+            {
+                'platname':'浜笢',
+                'plat':'jd',
+                'choose':true
+            },
+            {
+                'platname':'鎶栭煶',
+                'plat':'dy',
+                'choose':true
+            },
+            {
+                'platname':'鎷煎澶�',
+                'plat':'pdd',
+                'choose':true
+            },
+          ],
           txtareatxt:'',
+          issearch:false,
           showTxt:'鐚滀綘鍠滄',
           txtplaceholder:'1銆佹敮鎸佹窐瀹濄�佸ぉ鐚�佷含涓溿�佹姈闊炽�佹嫾澶氬绛夊钩鍙癨r\n2銆佽绮樿创鎮ㄩ渶瑕佽浆鎹㈢殑鍒嗕韩鏂囨/閾炬帴鍜屽彛浠�/鍟嗗搧閾炬帴;涓嶆敮鎸佸埜閾炬帴'
         },
         methods:{
+            changeplat:function(item)
+            {
+                var index=this.plat.findIndex(i=>i.plat==item.plat);
+                item.choose=!item.choose;
+                this.plat[index]=item;
+                this.search();
+            },
             //鏌ヨ
             search:function()
             {
@@ -434,18 +530,43 @@
                 this.goodsItem=[];
                 var that = this;
                 this.loading = true
+                var postData={
+                        content:that.txtareatxt
+                    };
+                //鏌ョ湅涓嶇湅鐨勫钩鍙�
+                var cancelPlat=this.plat.filter(i=>!i.choose);
+                if(cancelPlat&&cancelPlat.length>0)
+                {
+                    for(var i=0;i<cancelPlat.length;i++)
+                    {
+                        switch(cancelPlat[i].plat)
+                        {
+                            case "tb":
+                                postData.exclude_tb=1;
+                                break;
+                            case "jd":
+                                postData.exclude_jd=1;
+                                break;
+                            case "pdd":
+                                postData.exclude_pdd=1;
+                                break;
+                            case "dy":
+                                postData.exclude_dy=1;
+                                break;
+                        }
+                    }
+                }
                 $.ajax({
                     headers:{
                         "token":this.getUrlPar("token")
                     },
-                    url:this.posturl+'/api/taoke/compare_good',
+                    url:'/api/taoke/compare_good',
                     type:"post",
                     dataType:"json",
-                    data:{
-                        content:that.txtareatxt
-                    }
+                    data:postData
                 }).done(function(res){
                     that.loading = false;
+                    that.issearch=true;
                     if(res.code == 0){
                         that.goodsItem=res.data.list;
                     }                       
@@ -466,7 +587,7 @@
                     case "tb":
                     case "tm":
                         uni.navigateTo({
-                            url: '/pages/goods/goodsDetail?id=' + item.goodsId+'&frompage=freebuy'
+                            url: '/pages/goods/goodsDetail?id=' + item.goodsId+'&frompage=compareprice'
                         });
                         break;
                     default:
@@ -484,7 +605,7 @@
                     headers:{
                         "token":this.getUrlPar("token")
                     },
-                    url:_this.posturl+'/api/taoke/get_goods_things',
+                    url:'/api/taoke/get_goods_things',
                     type:"post",
                     dataType:"json",
                     async: false,
@@ -536,11 +657,13 @@
             },
         },
         mounted:function(){
-           /*  var postData={
+        /*       var postData={
                 postData:'OAID',
                 deviceValue:''
             };
-            this.likeDataGet(postData); */
+            this.likeDataGet(postData);  */
+ 
+
             var that=this;
             document.addEventListener('UniAppJSBridgeReady', function() {
                 that.getLikeGoods();

--
Gitblit v1.9.3