From 93eb06506cc784b0c206239156dca53300f93e2b Mon Sep 17 00:00:00 2001
From: zhaojs <349234519@qq.com>
Date: 星期一, 17 七月 2023 09:28:31 +0800
Subject: [PATCH] no message

---
 public/html/compareprice.html |  245 +++++++++++++++++++++++++++++++++++-------------
 1 files changed, 179 insertions(+), 66 deletions(-)

diff --git a/public/html/compareprice.html b/public/html/compareprice.html
index 9ab5b04..c03076a 100644
--- a/public/html/compareprice.html
+++ b/public/html/compareprice.html
@@ -28,7 +28,6 @@
         {
             width: 95%;
             margin: 0 auto;
-            min-height: 23rem;
             margin-top: 5.3rem;
             position:relative;
         }
@@ -104,7 +103,7 @@
             width: 100%;
             text-align: center;
             margin: 0 auto;
-            line-height: 6.2rem;
+            line-height: 1.2rem;
             color: #a69b9b;
             font-size: 14px;
         }
@@ -120,15 +119,15 @@
         }
         .detail___3ZQFW {
         background-color: #fff;
-        height: 2.2rem;
+        height: 2.6rem;
         border-radius: .16rem;
         padding: .1rem;
         position: relative;
         box-sizing: border-box;
     }
     .picture___r4a1j {
-        height: 2rem;
-        width: 2rem;
+        height: 2.4rem;
+        width: 2.4rem;
         border-radius: .1rem;
         position: absolute;
         left: .1rem;
@@ -138,8 +137,8 @@
         -webkit-justify-content: space-between;
         -ms-flex-pack: justify;
         justify-content: space-between;
-        padding-left: 2.2rem;
-        height: 2rem;
+        padding-left: 2.5rem;
+        
         width: 100%;
         overflow: hidden;
         -webkit-align-items: flex-start;
@@ -162,7 +161,7 @@
         justify-content: flex-start;
         padding: 0;
         margin: 0;
-        height: .4rem;
+        height: .85rem;
         font-size: .28rem;
         font-family: PingFangSC-Regular, PingFang SC;
         font-weight: 400;
@@ -204,7 +203,7 @@
     }
 
     .coupon___2SVZi {
-        margin-top: 6px;
+        margin-top: 3px;
         height: .28rem;
         background: linear-gradient(
                 90deg, #ff8873, #ff4f4f);
@@ -269,19 +268,18 @@
         line-height: .32rem;
     }
     .detail___3ZQFW .choiceInfo___3ZuEa .price___dfbCD {
-        margin-bottom: .16rem;
+      
         -webkit-justify-content: flex-start;
         -ms-flex-pack: start;
         justify-content: flex-start;
         -webkit-align-items: baseline;
         -ms-flex-align: baseline;
         align-items: baseline;
-        height: .24rem;
         font-size: .24rem;
         font-family: PingFangSC-Medium, PingFang SC;
         font-weight: 500;
         color: #fe3738;
-        line-height: .24rem;
+        line-height: .54rem;
     }
 
     .detail___3ZQFW .choiceInfo___3ZuEa .operation___3KazI {
@@ -296,32 +294,58 @@
     * {
         box-sizing: border-box;
     }
-
+    .loading{
+        display: flex;
+        position: fixed;
+        width: 100vw;
+        height: 100vh;
+        background: rgb(0 0 0 / 67%);
+        top: 0;
+        left: 0;
+        z-index: 10;
+        justify-content: center;
+        align-items: center;
+        font-size: .35rem;
+        color: #fff;
+        }
+        .showshop
+        {
+            font-size: .26rem;
+            color: #787070;
+        }
+        .goodtitle
+        {
+            overflow: hidden;
+            text-overflow: ellipsis;
+            display: -webkit-box;
+            -webkit-line-clamp: 2;
+            -webkit-box-orient: vertical;
+        }
     </style>
 </head>
 
 <body style="background: #f5f5f9;">
     <div id="comprice">
+        <div v-if="loading" class="loading">鍔犺浇涓�...</div>
         <image class="top-content" src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/compareprice_topimg.png"></image>
         <div class="main-content">
-          
             <div class="mid-content">
                 <div class="mid-content-con">
                     <div class="content-tip" v-on:click="clear()">
                         娓呯┖
                     </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">
-                        <div class="mid-button-content-img">
+                        <div class="mid-button-content-img" v-on:click="search()">
                             <image style="width: 100%;" src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/compareprice_search.png"></image>
                         </div>
                     </div>
                 </div>
                 <div class="cont-title">
-                    鏌ヨ鎺掕
+                    {{showTxt}}
                 </div>
                     <div v-if="goodsItem.length==0" class="mid-content-none">
                         鏆傛棤鏁版嵁~
@@ -329,22 +353,27 @@
                     <div v-else class="ulist">
                         <a v-for="g in goodsItem" :key="g.id" v-on:click="handleCdetailFavorite(g)">
                             <div class="detail___3ZQFW">
-                                <img :src="g.pic"
+                                <img :src="g.mainPic"
                                     class="fadeIn picture___r4a1j">
                                 <div class="choiceInfo___3ZuEa">
                                     <div class="other___2Mv8Q">
                                         <h2>
-                                            <div class="shoplabel___1_Nv0"><img
-                                                    src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAaCAYAAADIUm6MAAAE60lEQVRYw9WYbVBUVRjHz+gH/OCHdCY/WE1OGTNWU40ibIqSE6IGZpoGgrGUyAjrYkrI2yqIKGjN+FLONOk4aI6azZqZmu+ama9oElmOGApqvrK6KjBp8uvDc5a7d3eBJZsp78xv9p7/eZ7/8+y95yxnUEopRZ4tFIfdicPuxjGFoCnQODqKXdOhHDcOu5M8W6hqaTonw0VOBo8ILvJsoYqsdCfTJ/NIkZXuVNjT3NgnEZg0H9qLm/Qv01r9NLdi8kRMzMyFBw/+OWfPGF6VJ6GpEepqwbkebGnmWtVnAKCsxKzv3in6mi/w60+jmPgeJvJyeKjrbLXhVVVlnvthv+hfroWfK+HuXdGrq2Xs4fp10S9elHHpXHz7VCRbwZpsJiUlMA6HGNbVtR5jTYHkZMFqhdRUKJsPDY3Q3AxTbHDgQMcexpIlkGz1IhlF4gRaGN8OM/LEqLaONvMSA3DqlOQWzobsXJhXBnUXRCtfJWMPRytE37ZdxpMz/HwV4xIJmiy9jM7XBp8TPwFWrITGRsktKjHmDh6CK1fhw1xzzrqvRF+8tFVfxVsJ+BOv8dGnZkvxc7UEzvMhv0i+pPflKG7dv736Xihix2HiSAVU/WrmF03171K8qSnwvIdl5eK1co3EX7gEly7LfV4RrHNCzbngKSiG2He8GIci5m1MuG/z0Nem78QrNgE+WQax8VBxUuayC2Hnvo75FX+Eb5+KIaMxYcuBzHxhqsYz3uFVsHSRofuSlG72HJ4A1TWSN20mbN8r95+VQ4pdOHRMtKUrDO3Icb2h5+PbpyJyFEExaBTUeK3Xz1d7zb/pg5deUAqXrxp59nzYtkdv1I+NWM9DmbXA0HbtF62gzFxn0CgUEXFgaYUIjSUO8krFpEH/OtTfhOh4HTvSB52zeoPRcHOzfKbnwtbdcj9zgeG/Tb+F/DIjf4duPHeeX1+Kfm/QLjFJcL1eP6WFcPiE3G/Z03ZeUibccEHxIjiq13jqDNi8S+5dt+CPq0JjU+ta9lw/b8VLw2mTV8dA1WkxOHgcXh4Bce/DnQbRPl3Zdn7YSPk8Vinx1izYtKtjm3P6HD9fRZ+h0CdGM9TM4Hij6TPnYMBYWuJthXD/L73e18LzAfI9vBIHt/Sv1ZBE2KgPUcVLICoBosbDTn0MKFyktQTYfVC0zNk+njEoer9OQJKy4Io+7FSfB8tY/5hpc+HefYnZexgiAsQ8Fw3rt0pMRZVoX++Q8QclRtw3+i1kFhvaZr2JbUV+voqnh2DixTgo3yBHVIDvj0Lf0fjFeUiYJusS4MZNmFoCvfTcC7HwrS5+pwFGpIq+aqNoC8sNH89byJgt42ejoVK/7Xez/eoqeg6GnlEGx/Vh6N59mL8cnnzNPN8zCsnxou8Y2HfM68/6Yolbu0XGN90wxg5PRAmj7fJgmpvly15zQdOfEuu+A9fq4bY+8l68Ar2H+dVX9IikhccjIXUW/PgTRE6QcSC841u0QWCbA7/VQO8RMm8ZDwdOQP94THV6RMKUEqi/1famrDwNUdaA9RXdBrjpNgAzA/HXvHhME2iu+0D/uNbiuw+EXsPgmeH+PBXdVg9uRVeLk64WhAiN5T8i6PpORUh4KF3CXYT0xyDch/7tEGxcsP5tzHcJdxESrv+3EhIeSucwJ53C3HTqx/+TMDedw5yepv8GV1+TBUuIRhcAAAAASUVORK5CYII=">
-                                            </div>
-                                            <span>{{g.title}}</span></h2>
-                                        <div class="coupon___2SVZi" style="float: left; margin-right:10px"><span>鍒�</span>{{g.quanJine}}鍏�</div>
+                                            <!-- <div class="shoplabel___1_Nv0"><img
+                                                    :src="g.labelImg">
+                                            </div> -->
+                                            <div class="goodtitle">
+                                                <img class="shoplabel___1_Nv0" :src="g.labelImg">
+                                                {{g.title}}</div></h2>
+                                        <div v-if="g.couponPrice" class="coupon___2SVZi" style="float: left; margin-right:10px"><span>鍒�</span>{{g.couponPrice}}鍏�</div>
                                         <div class="coupon___2SVZi" style="background: #A429F3;"><span style="color: #A429F3;">杩�</span>{{g.fanli}}鍏�</div>
+                                       
                                     </div>
-                                    <div class="price___dfbCD">楼<span>{{g.jiage}}</span><u style="text-decoration:line-through">鑱氬垝绠椾环 楼{{g.yuanjia}}</u></div>
-                                    <div class="operation___3KazI">
-                                        <button>椹笂鎶�</button>
-                                    </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="operation___3KazI">
+                                        <button>绔嬪嵆璐拱</button>
+                                    </div> -->
+                                    <div class="showshop">鏈堥攢{{g.monthSales}}</div>
+                                    <div class="showshop">{{g.shopName}}</div>
                                 </div>
                             </div>
                         </a>
@@ -367,50 +396,148 @@
         size=size<=0?400:size;
         document.documentElement.style.fontSize = (size > 750 ? 750 : size) / 7.5 + 'px';
     })();
+    function scanCode(str)
+    {
+        app.copytxt(str);
+    }
+    function likeDataGet(data)
+    {
+        app.likeDataGet(data);
+    }
+
+    function onTextareaKeyDown()
+    {
+        if (event.keyCode == 13)
+        {
+            app.onTextareaKeyDown();
+        }
+       
+    }
     Vue.use(VueLazyload, {
         preLoad: 1.3,//
         error: 'https://sr.ffquan.cn/cms_pic/20200622/bro7s7f6vrkd3jat4ujg0.png',
         loading: 'https://sr.ffquan.cn/cms_pic/20200612/brhjkf76vrkcrfpi79eg0.png',
         attempt: 1
     })
-    new Vue({
+  var app=  new Vue({
         el: '#comprice',
         data:{
           //posturl:'http://dfg.shop.com',
           posturl:'https://appapitest.ushopvip.com',
           //posturl:'http://dfgapp.ushopvip.com',
           goodsItem:[],
+          loading:false,
           txtareatxt:'',
-          txtplaceholder:'1銆佹敮鎸佹窐瀹濄�佸ぉ鐚�佷含涓溿�佹姈闊炽�佹嫾澶氬绛夊瀹剁數鍟� \r\n 2銆佽绮樿创鎮ㄩ渶瑕佽浆鎹㈢殑鍒嗕韩鏂囨/閾炬帴鍜屽彛浠�/鍟嗗搧閾炬帴;涓嶆敮鎸佸埜閾炬帴'
+          showTxt:'鐚滀綘鍠滄',
+          txtplaceholder:'1銆佹敮鎸佹窐瀹濄�佸ぉ鐚�佷含涓溿�佹姈闊炽�佹嫾澶氬绛夊钩鍙癨r\n2銆佽绮樿创鎮ㄩ渶瑕佽浆鎹㈢殑鍒嗕韩鏂囨/閾炬帴鍜屽彛浠�/鍟嗗搧閾炬帴;涓嶆敮鎸佸埜閾炬帴'
         },
         methods:{
-            clear:function()
+            onTextareaKeyDown:function(event)
             {
-                this.txtareatxt='';
+                alert('浣犵偣鍑讳簡鍥炶溅閿�')
             },
-            fromcopy:function()
+            //鏌ヨ
+            search:function()
             {
-                navigator.clipboard.readText().then(function(clipText){
-                alert(clipText);
-               })
-            },
-            getCmsUrl:function(){
-                var _this = this;
-                _this.loading=true;
+                if(this.txtareatxt=='')
+                {
+                    return;
+                }
+                this.showTxt="鏌ヨ缁撴灉";
+                this.goodsItem=[];
+                var that = this;
+                this.loading = true
                 $.ajax({
                     headers:{
                         "token":this.getUrlPar("token")
                     },
-                  
-                    url:_this.posturl+'/api/activity/cmsGet',
+                    url:this.posturl+'/api/taoke/compare_good',
+                    type:"post",
+                    dataType:"json",
+                    data:{
+                        content:that.txtareatxt
+                    }
+                }).done(function(res){
+                    that.loading = false;
+                    if(res.code == 0){
+                        that.goodsItem=res.data.list;
+                    }                       
+                })
+
+            },
+            Infoformat: function(info){
+                info = info.replace(/\%/g,"%25")
+            info = info.replace(/\#/g,"%23")
+            info = info.replace(/\&/g,"%26")
+            info = info.replace(/\?/g,"%3F")
+            return info;
+            },
+            handleCdetailFavorite:function(item)
+            {
+                switch(item.sourceType)
+                {
+                    case "tb":
+                    case "tm":
+                        uni.navigateTo({
+                            url: '/pages/goods/goodsDetail?id=' + item.goodsId+'&frompage=compareprice'
+                        });
+                        break;
+                    default:
+                        var itemsStr=this.Infoformat(JSON.stringify(item));
+                        uni.navigateTo({
+                            url: '/pages/goods/goodsDetail?sourcefrom=compareprice&info=' + itemsStr+'&frompage=compareprice'
+                        });
+                        break;
+                }
+            },
+            likeDataGet:function(postData)
+            {
+                var _this=this;
+                $.ajax({
+                    headers:{
+                        "token":this.getUrlPar("token")
+                    },
+                    url:_this.posturl+'/api/taoke/get_goods_things',
                     type:"post",
                     dataType:"json",
                     async: false,
                     data:{
-                       
+                        deviceType:postData.postData,
+                        deviceValue:postData.deviceValue,
+                        pageId:1,
+                        pageSize:10,
+                        type:1
                     }
                 }).done(function(res){
-                                               
+                    _this.goodsItem=res.data.list;
+                    console.log(res);                   
+                })
+            },
+            getLikeGoods:function()
+            {
+                uni.postMessage({
+                    data: {
+                        action: 'getlike'
+                    }
+                })
+            },
+            clear:function()
+            {
+                this.txtareatxt='';
+            },
+            copytxt(str)
+            {
+                if(str&&str.data&&str.data.length>0)
+                {
+                    this.txtareatxt=str.data;
+                }
+            },
+            fromcopy:function()
+            {
+                uni.postMessage({
+                    data: {
+                        action: 'copy'
+                    }
                 })
             },
             getUrlPar:function(name)
@@ -420,31 +547,17 @@
                 if(r !=null)return unescape(r[2]);
                  return null;
             },
-            
-            getGoodsList: function () {
-                var that = this;
-                this.loading = true
-                $.ajax({
-                    headers:{
-                        "token":this.getUrlPar("token")
-                    },
-                    url:this.posturl+'/api/Activity/zsz_goods_list',
-                    type:"post",
-                    dataType:"json",
-                    data:{
-                        cid:0,
-                        app_key: 'zsccir',
-                    }
-                }).done(function(res){
-                    if(res.code == 0){
-                    that.goodsItem = res.data.data.data.list;
-                   
-                    }                       
-                })
-            },
         },
         mounted:function(){
-            this.getGoodsList();
+           /*  var postData={
+                postData:'OAID',
+                deviceValue:''
+            };
+            this.likeDataGet(postData); */
+            var that=this;
+            document.addEventListener('UniAppJSBridgeReady', function() {
+                that.getLikeGoods();
+            });
         }
     })
 </script>
\ No newline at end of file

--
Gitblit v1.9.3