k.zhang 4 years ago
parent
commit
89dfd8ad8d

+ 7 - 2
app.json

@@ -2,7 +2,8 @@
   "pages": [
     "pages/shouye/shouye",
     "pages/index/index",
-    "pages/logs/logs"
+    "pages/logs/logs",
+    "pages/details/details"
    
   ],
   "window": {
@@ -27,7 +28,11 @@
       }
     ]
   },
-
+  
+  "usingComponents": {
+    "l-button": "/dist/button/index"
+   
+  },
 
 
   "style": "v2",

File diff suppressed because it is too large
+ 1 - 0
dist/loading/index.js


+ 1 - 0
dist/loading/index.json

@@ -0,0 +1 @@
+{"component":true,"usingComponents":{}}

+ 75 - 0
dist/loading/index.wxml

@@ -0,0 +1,75 @@
+<view class="container-loading l-container-class {{fullScreen ? 'content': ''}}" wx:if="{{show && fullScreen}}" style="background:{{bgColor}};opacity:{{opacity}};z-index:{{zIndex}}" catchtouchmove="doNothingMove">
+  <view wx:if="{{show}}" class="l-class {{type + '-spinner'}} {{type==='change'||custom?'':'spinner-' + type + '-' + size}}" style="margin-bottom:{{distance}}px">
+    <block wx:if="{{custom}}">
+      <slot/>
+    </block>
+    <block wx:else>
+      <view wx:if="{{type==='flash' || type==='change' || type==='flip'}}" style="{{color?'background-color:'+color:''}}" class="{{type+'-bounce1'}} {{'spinner-'+ type + '-' + size}}"></view>
+      <view wx:if="{{type==='flash' || type==='change'}}" style="{{color?'background-color:'+color:''}}" class="{{type+'-bounce2'}} {{'spinner-'+ type + '-' + size}}"></view>
+      <view wx:if="{{type==='change'}}" style="{{color?'background-color:'+color:''}}" class="{{type+'-bounce3'}} {{'spinner-'+ type + '-' + size}}"></view>
+      <view class="spinner-circle {{'spinner-circle-' + size}}" wx:if="{{ type === 'circle'}}">
+        <view class="spinner-container container1">
+          <view class="circle1 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+          <view class="circle2 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+          <view class="circle3 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+          <view class="circle4 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+        </view>
+        <view class="spinner-container container2">
+          <view class="circle1 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+          <view class="circle2 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+          <view class="circle3 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+          <view class="circle4 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+        </view>
+        <view class="spinner-container container3">
+          <view class="circle1 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+          <view class="circle2 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+          <view class="circle3 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+          <view class="circle4 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+        </view>
+      </view>
+      <view wx:if="{{ type === 'rotate'}}">
+        <view class="rotate rotate-{{size}}" style="border-color: {{color}};"></view>
+      </view>
+    </block>
+  </view>
+</view>
+<view wx:if="{{!fullScreen}}" class="l-container-class" style="position: relative">
+    <slot name="content"/>
+    <view wx:if="{{show}}" class="inner-loading-container" style="background:{{bgColor}};opacity:{{opacity}};z-index:{{zIndex}}"></view>
+    <view wx:if="{{show}}" class="l-class loading-icon-container" style="z-index:{{zIndex + 1}}">
+        <view class="{{type + '-spinner'}} {{type==='change'||custom?'':'spinner-' + type + '-' + size}}">
+            <block wx:if="{{custom}}">
+                <slot/>
+            </block>
+            <block wx:else>
+                <view wx:if="{{type==='flash' || type==='change' || type==='flip'}}" style="{{color?'background-color:'+color:''}}" class="{{type+'-bounce1'}} {{'spinner-'+ type + '-' + size}}"></view>
+                <view wx:if="{{type==='flash' || type==='change'}}" style="{{color?'background-color:'+color:''}}" class="{{type+'-bounce2'}} {{'spinner-'+ type + '-' + size}}"></view>
+                <view wx:if="{{type==='change'}}" style="{{color?'background-color:'+color:''}}" class="{{type+'-bounce3'}} {{'spinner-'+ type + '-' + size}}"></view>
+                <view wx:if="{{ type === 'circle'}}" class="spinner-circle {{'spinner-circle-' + size}}">
+                    <view class="spinner-container container1">
+                        <view class="circle1 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+                        <view class="circle2 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+                        <view class="circle3 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+                        <view class="circle4 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+                    </view>
+                    <view class="spinner-container container2">
+                        <view class="circle1 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+                        <view class="circle2 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+                        <view class="circle3 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+                        <view class="circle4 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+                    </view>
+                    <view class="spinner-container container3">
+                        <view class="circle1 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+                        <view class="circle2 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+                        <view class="circle3 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+                        <view class="circle4 container-view {{type + '-' + size}}" style="background: {{color}}"></view>
+                    </view>
+                </view>
+                <view wx:if="{{ type === 'rotate'}}">
+                    <view class="rotate rotate-{{size}}" style="border-color: {{color}};"></view>
+                </view>
+            </block>
+        </view>
+    </view>
+</view>
+

File diff suppressed because it is too large
+ 1 - 0
dist/loading/index.wxss


File diff suppressed because it is too large
+ 1 - 0
dist/loadmore/index.js


+ 1 - 0
dist/loadmore/index.json

@@ -0,0 +1 @@
+{"component":true,"usingComponents":{"l-loading":"../loading/index"}}

+ 17 - 0
dist/loadmore/index.wxml

@@ -0,0 +1,17 @@
+
+<slot name="content"/>
+<view mut-bind:tap="onLoadmore" wx:if="{{show}}">
+  <view wx:if="{{custom && type==='end'}}">
+    <slot name="end"/>
+  </view>
+  <view wx:elif="{{custom && type==='loading'}}">
+    <slot name="loading"/>
+  </view>
+  <view class="loading l-class" wx:else>
+    <view class="line loading-view" style="{{'background-color:'+color}}" wx:if="{{line}}"></view>
+    <view class="rotate loading-view" style="border-color: {{color}};width:{{size}}rpx;height:{{size}}rpx" wx:if="{{type=='loading'}}"></view>
+    <view class="loading-text l-loading-class loading-view" style="color:{{color}};font-size:{{size}}rpx" wx:if="{{type=='loading'}}">{{loadingText}}</view>
+    <view class="loading-text l-end-class loading-view" style="{{'color:'+color}};font-size:{{size}}rpx" wx:if="{{type=='end'}}">{{endText}}</view>
+    <view class="line l-line-class loading-view" style="{{'background-color:'+color}}" wx:if="{{line}}"></view>
+  </view>
+</view>

File diff suppressed because it is too large
+ 1 - 0
dist/loadmore/index.wxss


+ 148 - 0
pages/details/details.js

@@ -0,0 +1,148 @@
+// pages/details/details.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    p_id:"",
+    search_id:"",
+    goods_sign:"",
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    var that=this
+    const goodsSign=options.goodsSign
+    const searchId=options.searchId
+    const pid = "9112489_209622235"
+
+    that.p_id = pid
+    that.goods_sign = goodsSign
+    that.search_id = searchId
+    wx.request({
+    url: 'http://49.234.19.130:8081/v1/pdd/ddk/detail', 
+    data: { goods_sign: goodsSign, search_id: searchId,pid: pid }, 
+    header: { 
+      "Content-Type": "application/json"
+     }, 
+     method: "POST",
+   
+    success (res) {
+      console.log(res)
+      that.setData({
+      goodsDetails: res.data.data.goods_detail_response.goods_details,
+      searchId:searchId
+     })
+    
+    }
+  })
+  },
+  counponBtn:function(e){
+    var that = this
+  console.log("pdd")
+  
+  wx.request({
+    url: 'http://49.234.19.130:8081/v1/pdd/url/generate', 
+    data: { goods_sign_list: [that.goods_sign], search_id: that.search_id,p_id: that.p_id,generate_we_app:"true" }, 
+    header: { 
+      "Content-Type": "application/json"
+     }, 
+     method: "POST",
+   
+    success (res) {
+      console.log(res)
+    //   that.setData({
+    //   goodsDetails: res.data.data.goods_detail_response.goods_details,
+    //   searchId:searchId
+    //  })
+    console.log(res.data.data.goods_promotion_url_generate_response.goods_promotion_url_list[0].we_app_info.page_path)
+   let path = res.data.data.goods_promotion_url_generate_response.goods_promotion_url_list[0].we_app_info.page_path
+   //let path = res.data.data.goods_promotion_url_generate_response.goods_promotion_url_list[0].we_app_web_view_short_url
+    wx.navigateToMiniProgram({
+    appId: 'wx32540bd863b27570',
+    path: path,
+        success(res) {
+    }
+    })
+    }
+  })
+
+
+ 
+ 
+ },
+  bindscroll(e) {
+    //计算页面 轮播图、详情、评价(砍价)view 高度
+    this.getTopHeightFunction()
+    var tabsHeight = this.data.tabsHeight //顶部距离(tabs高度)
+    if (this.data.tabs[0].topHeight-tabsHeight<=0 && 0 < this.data.tabs[1].topHeight-tabsHeight) { //临界值,根据自己的需求来调整
+      this.setData({
+        active: this.data.tabs[0].tabs_name //设置当前标签栏
+      })
+    } else if (this.data.tabs.length == 2) {
+      this.setData({
+        active: this.data.tabs[1].tabs_name
+      })
+    } else if (this.data.tabs[1].topHeight-tabsHeight<=0 && 0 < this.data.tabs[2].topHeight-tabsHeight) {
+      this.setData({
+        active: this.data.tabs[1].tabs_name
+      })
+    } else if (this.data.tabs[2].topHeight-tabsHeight<=0) {
+      this.setData({
+        active: this.data.tabs[2].tabs_name
+      })
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 6 - 0
pages/details/details.json

@@ -0,0 +1,6 @@
+{
+  "navigationBarTitleText": "商品详情",
+  "usingComponents": {
+   
+  }
+}

+ 56 - 0
pages/details/details.wxml

@@ -0,0 +1,56 @@
+<!--pages/details/details.wxml-->
+<scroll-view class="scroll-container" wx:for="{{goodsDetails}}" wx:key="msg" scroll-into-view="{{toView}}" scroll-y="true" scroll-with-animation="true" bindscroll="bindscroll">
+    <view class="swiper-container" id="swiper-container">
+     
+      <swiper class="swiper_box" indicator-dots="true" indicator-active-color="#fff"  circular="true">
+        <swiper-item  wx:for="{{item.goods_gallery_urls}}" wx:key="imgs" >
+          <image src=" {{item}}" class="slide-image" mode="aspectFill" lazy-load="false" />
+        </swiper-item>
+      </swiper>
+    </view>
+
+
+  <view class="goods-info">
+    <view class="goodsTitle">
+      <l-avatar size="35" shape="square" src="/images/jd.png" />
+      <text class="goodsName">{{item.goods_name}}</text>
+    </view>
+    <view class="goodsPrice">
+      <text class="jprice">劵后价¥{{(item.min_group_price-item.coupon_discount)/100}}元</text>  
+      <l-button plain="{{true}}" type="error"  width="50" height="40" class="fanli"  >返利{{item.promotion_rate/100}}元</l-button>
+    </view>
+    <view class="goodsbtm">
+      <text class="yprice">原价¥{{item.min_group_price/100}} </text>
+      <text class="xiaoliang"> 销量:{{item.sales_tip}}</text>
+    </view>
+    <view class="goodsbtm">
+    <!--  <l-popup show="{{true}}" content-align="center"  locked="{{true}}">
+     <view class='pupop-content'>
+      <view class='pupop-close' bindtap='onHidePupopTap'>关闭弹出层</view>
+    </view>
+</l-popup> -->
+
+    <l-button bg-color="#FF6A6A"  size="large" bind:lintap="counponBtn" data-searchId="{{searchId}}" data-goodsSignList="{{item.goods_sign}}">
+      <text >领取{{item.coupon_discount/100}}元优惠劵</text>
+     
+    </l-button>
+    </view>
+    <view class="goodsbtm">
+      <text class="dianpu">店铺:{{item.mall_name}}</text>
+    </view>
+  </view>
+
+  <view class="label-title"> 
+        <view class="goodsDetail">商品详情</view>
+        <view class="goodsDesc">{{item.goods_desc}}</view>
+        <image src="{{item.goods_image_url}}" class="slide-image" mode="aspectFill" lazy-load="false" />
+  </view>
+   <!-- <view class="goodsDetail">商品推荐</view> -->
+
+  </scroll-view> 
+
+  <l-tab-bar list="{{list}}" />
+
+
+
+

+ 87 - 0
pages/details/details.wxss

@@ -0,0 +1,87 @@
+/* pages/details/details.wxss */
+.container {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  margin-top: 30rpx;
+  box-shadow: 2px  2px  3px #e3e3e3e3;
+  position: relative;
+  width: 240rpx;
+  height: 360rpx;
+}
+.container image{
+  width: 100%;
+  height: 100%;
+  border-radius: 2px;
+}
+.description {
+ width: 100%;
+ position:absolute; 
+ z-index:2;
+ left:0;
+ bottom:0;
+ background-color: white;
+}
+.goods-info{
+  margin: 10px;
+}
+/* .goodsTitle{
+  margin: 10px;
+  
+} */
+.goodsName{
+  font-size: 35rpx;
+}
+.goodsPrice{
+  margin-top: 10px;
+  margin-bottom: 10px;
+}
+.goodsbtm{
+  margin-bottom: 10px;
+}
+.jprice{
+  font-size: 40rpx;
+  color: red;
+  /* left: 10px; */
+}
+.fanli{
+  position: absolute;
+    right: 10px;
+    /* width: 50px; */
+    /* padding-right:10px; */
+    font-size: 40rpx;
+  /* position: absolute;
+  padding-right: 10px;
+  font-size: 40rpx; */
+}
+.yprice{
+  color: rgb(153, 151, 151);
+  font-size: 30rpx;
+  text-decoration:line-through;
+}
+.xiaoliang{
+  position: absolute;
+  color: rgb(223, 219, 219);
+  font-size: 30rpx;
+  right: 10px;
+}
+.dianpu{
+  color: rgb(153, 151, 151);
+  font-size: 30rpx;
+}
+.goodsDetail{
+  margin: 10px;
+  font-size: 35rpx;
+  color: rgb(121, 120, 120);
+}
+.goodsDesc{
+  margin: 10px;
+  font-size: 30rpx;
+  color: rgb(121, 120, 120);
+}
+
+
+.slide-image{
+  display: flex;
+justify-content: center;
+}

+ 120 - 1
pages/shouye/shouye.js

@@ -1,4 +1,5 @@
 // pages/shouye/shouye.js
+const util = require('../../utils/util.js')
 Page({
 
   /**
@@ -60,7 +61,16 @@ Page({
         defaultImage: '/pages/components/nav/images/tab-icon/bathroom.png',
       }
     }
-    ]
+    ],
+    goodsList:[],
+    listId:"",
+  page:1,
+  pageSize:10,
+  currentPage:0,
+  totalCount:0,
+  listId:"",
+  show:true,
+  lType:"loading"
   },
 
   _asyncData() {
@@ -97,6 +107,38 @@ Page({
   onLoad: function (options) {
     // this._asyncData
     setTimeout(this._asyncData, 0);
+    //获取数据
+   var  that = this; 
+   that.page = 1
+   that.pageSize = 18
+  wx.request( { 
+   url: "http://49.234.19.130:8081/v1/pdd/ddk/search", 
+   //url: "http://127.0.0.1:8081/v1/pdd/ddk/search", 
+   header: { 
+    "Content-Type": "application/json"
+   }, 
+   method: "POST",
+   //data: { cityname: "上海", key: "1430ec127e097e1113259c5e1be1ba70" }, 
+   data:  { page: that.page.toString(), page_size: that.pageSize.toString() }, 
+   complete: function( res ) { 
+    wx.hideLoading();
+    console.log(res)
+    that.totalCount = res.data.data.goods_search_response.total_count
+    for (var i = 0; i < res.data.data.goods_search_response.goods_list.length; i++) {
+      that.data.goodsList.push( res.data.data.goods_search_response.goods_list[i]);
+    }
+    
+   that.setData({
+    goodsList: that.data.goodsList,
+  })
+
+    console.log(res.data.data.goods_search_response)
+    if( res == null || res.data == null ) { 
+     console.error( '网络请求失败' ); 
+     return; 
+    } 
+   } 
+  }) 
   },
 
   search(){
@@ -105,6 +147,36 @@ Page({
     })
   },
 
+  goodsCollection: function(e){
+    var that=this
+    var currentPage=that.data.page+1;
+    wx.request({
+      url: 'http://49.234.19.130:8081/v1/pdd/ddk/search', 
+      data: {
+        listId:that.data.listId,
+        pageSize:10,
+        page: that.data.page+1,
+      },
+      method:'GET',
+      header:{
+        'Accept': 'application/json'
+      },
+     
+      success (res) {
+        wx.hideLoading();
+        for (var i = 0; i < res.data.goodsSearchInfo.goodsSearchResponse.goodsList.length; i++) {
+          that.data.goodsList.push( res.data.goodsSearchInfo.goodsSearchResponse.goodsList[i]);
+        }
+       that.setData({
+        goodsList: that.data.goodsList,//res.data.goodsSearchInfo.goodsSearchResponse.goodsList,
+        listId:res.data.goodsSearchInfo.goodsSearchResponse.listId,
+        currentPage:currentPage
+        })
+       
+      }
+    })
+  },
+
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
@@ -144,7 +216,54 @@ Page({
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function () {
+         //获取数据
+   var  that = this; 
+   if ((that.totalCount+that.pageSize-1)/that.pageSize <= that.page){  //提示页码到了
+    that.setData({
+      lType:"end"
+    })
+    return
+   }
+
+   that.page +=1
+  wx.request( { 
+   url: "http://49.234.19.130:8081/v1/pdd/ddk/search", 
+  //  url: "http://127.0.0.1:8081/v1/pdd/ddk/search", 
+   header: { 
+    "Content-Type": "application/json"
+   }, 
+   method: "POST",
+   //data: { cityname: "上海", key: "1430ec127e097e1113259c5e1be1ba70" }, 
+   data:  { page: that.page.toString(), page_size: that.pageSize.toString() }, 
+   complete: function( res ) { 
+    wx.hideLoading();
+    console.log(res)
+    that.totalCount = res.data.data.goods_search_response.total_count
+    for (var i = 0; i < res.data.data.goods_search_response.goods_list.length; i++) {
+      that.data.goodsList.push( res.data.data.goods_search_response.goods_list[i]);
+    }
+    
+   that.setData({
+    goodsList: that.data.goodsList,
+  })
+
+    console.log(res.data.data.goods_search_response)
+    if( res == null || res.data == null ) { 
+     console.error( '网络请求失败' ); 
+     return; 
+    } 
+   } 
+  }) 
+  },
 
+  goodsDetail:function(e){
+    const goodsSign=e.currentTarget.dataset.sign;
+    const searchId=e.currentTarget.dataset.searchid;
+      
+      wx.navigateTo({
+       url: `/pages/details/details?goodsSign=${goodsSign}&searchId=${searchId}`,
+      // url: `/pages/goods-detail/index`,
+      })
   },
 
   /**

+ 2 - 1
pages/shouye/shouye.json

@@ -13,7 +13,8 @@
     "l-card":"/dist/card/index",
     "l-tag":"/dist/tag/index",
     "l-price":"/dist/price/index",
-    "l-notice":"/dist/notice-bar/index"
+    "l-notice":"/dist/notice-bar/index",
+    "l-loadmore": "/dist/loadmore/index"
   },
   "navigationBarTitleText": "首页"
 }

+ 14 - 8
pages/shouye/shouye.wxml

@@ -7,27 +7,33 @@
   </l-tabpanel>
 </l-tabs>
 <view wx:for="{{goodsList}}" wx:key="msg">
-  <l-card  type="primary" l-img-class="right-card" position="left" image="https://img.pddpic.com/mms-material-img/2021-02-23/7ba1ee16-fb91-4785-98ab-bda3afd6002f.png.a.jpeg"
-  bindtap="goodsDetail"  full="true">
+  <l-card  type="primary" l-img-class="right-card" position="left" image="{{item.goods_image_url}}"
+  bindtap="goodsDetail"  data-sign="{{item.goods_sign}}" data-searchId="{{item.search_id}}"   full="true" >
 
     <view class="super-long-test">
       <image class="empty-icon" src="/pages/image/dd.png" ></image>
-      【五件套】不锈钢盆圆形加厚加深盆子家用厨房装汤和面洗菜沥水盆
+      {{item.goods_name}}
     </view>
     <view class="containertag">
-      <l-tag plain="{{true}}" font-color="#d81e06" shape="circle" size="medium"  l-class="tag" class="describe" >20元券</l-tag>
-      <l-tag plain="{{true}}" font-color="#d81e06" shape="circle" size="medium"  l-class="tag"  class="fanli">返利0.01</l-tag>
+      <l-tag plain="{{true}}" font-color="#d81e06" shape="circle" size="medium"  l-class="tag" class="describe" >{{item.coupon_discount/100}}元券</l-tag>
+      <l-tag plain="{{true}}" font-color="#d81e06" shape="circle" size="medium"  l-class="tag"  class="fanli">返利{{item.promotion_rate/100}}</l-tag>
      
     </view>
     <view class="price-v">
-     <text class="price">劵后¥{{(2000)/100}}</text> <text class="yprice">原价{{10000/100}}</text>  
+     <text class="price">劵后¥{{(item.min_group_price-item.coupon_discount)/100}}</text> <text class="yprice">原价{{item.min_group_price/100}}</text>  
     </view>
     <text class="contentcard">
-    销量:10万+
+    销量:{{item.sales_tip}}
    </text>
-      <text class="contentcard">店铺:旗舰店</text>
+      <text class="contentcard">店铺:{{item.mall_name}}</text>
   </l-card>
 </view>
 
+<l-loadmore show="{{true}}" end-text="我是有底线的~" type="{{lType}}">
+  <!-- <view slot="content">
+    我是有底线的~
+  </view> -->
+</l-loadmore>
+
   
      

+ 2 - 2
project.config.json

@@ -4,7 +4,7 @@
     "ignore": []
   },
   "setting": {
-    "urlCheck": true,
+    "urlCheck": false,
     "es6": true,
     "enhance": true,
     "postcss": true,
@@ -39,7 +39,7 @@
   },
   "compileType": "miniprogram",
   "libVersion": "2.17.0",
-  "appid": "wx7085318f98d654d7",
+  "appid": "wx202109e32b5cbd37",
   "projectname": "ddk",
   "debugOptions": {
     "hidedInDevtools": []

+ 15 - 1
utils/util.js

@@ -14,6 +14,20 @@ const formatNumber = n => {
   return n[1] ? n : `0${n}`
 }
 
+function json2Form(json) { 
+  var str = []; 
+  for(var p in json){ 
+    str.push(encodeURIComponent(p) + "=" + encodeURIComponent(json[p])); 
+  } 
+  return str.join("&"); 
+} 
+
 module.exports = {
-  formatTime
+  formatTime,
+  json2Form:json2Form,
 }
+
+
+// module.exports = { 
+//  json2Form:json2Form, 
+// }