wenningning před 2 roky
rodič
revize
a3a66ee3e5

+ 16 - 0
api/goods.js

@@ -27,6 +27,7 @@ export function aboveGoods(params) {
     url: 'seller/goods',
     method: 'post',
     needToken:true,
+    loading: true,
     data:params,
     headers: { 'Content-Type': 'application/json' }
   })
@@ -77,10 +78,24 @@ export function underGoods(ids, params) {
     url: `seller/goods/${ids}/under`,
     method: 'put',
     needToken:true,
+    loading: true,
     data:params
   })
 }
 
+/**
+ * 商家上架商品
+ * @param ids
+ */
+export function unpGoods(ids) {
+  return request({
+    url: `seller/goods/${ids}/up`,
+    method: 'put',
+    loading: true,
+    needToken:true
+  })
+}
+
 
 /**
  * 查询库存商品数据  查询商品sku(规格)信息
@@ -109,6 +124,7 @@ export function reserveStockGoods(goods_id, params) {
     url: `seller/goods/${goods_id}/quantity`,
     method: 'put',
     needToken:true,
+    loading: true,
     data:params,
     headers: { 'Content-Type': 'application/json' }
   })

+ 6 - 6
api/passport.js

@@ -11,13 +11,13 @@ export function login(params) {
     baseUrl: app.globalData.api_domain.api_seller,
     url: `passport/mini-program/seller-login`,
     method: 'get',
-    loading: false,
+    loading: true,
     params
   })
 }
 
 /**
- * 手机验证码登
+ * 手机验证码登
  * @param params
  */
 export function smslogin(params) {
@@ -81,14 +81,14 @@ export function registerBind(uuid,params) {
 }
 
 /**
- * 小程序自动登
+ * 小程序自动登
  */
 export function autoLogin(params) {
   return request({
     baseUrl: app.globalData.api_domain.api_seller,
     url: `passport/mini-program/auto-login`,
     method: 'get',
-    loading: false,
+    loading: true,
     params
   })
 }
@@ -152,7 +152,7 @@ export function refreshToken(params) {
 }
 
 /**
- * 发送会员登验证码
+ * 发送会员登验证码
  * @param mobile
  * @param captcha
  */
@@ -175,4 +175,4 @@ export function decryptWxUser(param) {
     loading:false,
     params:param
   })
-}
+}

+ 5 - 5
api/shop.js

@@ -135,7 +135,7 @@ export function getO2OShops(param) {
   return request({
     url: 'seller/shops/getSellerO2OShops',
     method: 'get',
-    loading: false,
+    loading: true,
     needToken: true,
     params: param
   })
@@ -143,7 +143,7 @@ export function getO2OShops(param) {
 
 
 /**
- * 用户切换登机构
+ * 用户切换登机构
  * @param shopid
  */
 export function changeLoginShop(shopid) {
@@ -151,7 +151,7 @@ export function changeLoginShop(shopid) {
     url: `seller/login/changeLoginShop/${shopid}`,
     method: 'get',
     needToken:true,
-    loading: false
+    loading: true
   })
 }
 
@@ -194,8 +194,8 @@ export function saveShopSettings(params) {
   return request({
     url: 'seller/shops',
     method: 'put',
-    loading: false,
+    loading: true,
     needToken:true,
     data:params
   })
-}
+}

+ 16 - 16
app.js

@@ -23,12 +23,12 @@ App({
       })
 
     })
-    
+
     //加载本地存储数据
    this.globalData.authorInfo = wx.getStorageSync('authorInfo')
    this.globalData.sellerUser = wx.getStorageSync('sellerUser')
    this.globalData.sellerShop = wx.getStorageSync('sellerShop')
-   
+
 
     // 检查uuid参数,生成一个并写入本地存储
     var uuid = wx.getStorageSync('uuid')
@@ -40,15 +40,15 @@ App({
     else{
       this.globalData.uuid=uuid
     }
-   
+
   },
   onShow(){
     //加载本地存储数据
 	  this.globalData.authorInfo = wx.getStorageSync('authorInfo')
 	  this.globalData.sellerUser = wx.getStorageSync('sellerUser')
     this.globalData.sellerShop = wx.getStorageSync('sellerShop')
-    
-  
+
+
 	  // 检查uuid参数,生成一个并写入本地存储
 	  var uuid = wx.getStorageSync('uuid')
 	  if (!uuid) {
@@ -59,14 +59,14 @@ App({
 	  else{
 	    this.globalData.uuid=uuid
 	  }
-	  
+
   },
   globalData: {
     /** 小程序类型 */
     miniProgramType:'miniprogramo2oseller',
     /** 用户uuid */
     uuid: null,
-	/**  登授权信息 */
+	/**  登授权信息 */
     authorInfo:null,
     /** 卖家用户 */
     sellerUser: null,
@@ -79,21 +79,21 @@ App({
     /** 今日订单金额 */
     todayOrderTotal:0,
     /** api 模式 */
-    api_mode: 'dev',
+    api_mode: 'prod',
     /** api域名 */
 	api_domain:{
-		api_base: 'http://127.0.0.1:7000/',//''https://dev.base.wdklian.com/',//,
-		api_buyer: 'http://127.0.0.1:7002/',//'https://api.buyer.wdklian.com/',//
-		api_seller: 'http://127.0.0.1:7003/',//'https://api.seller.wdklian.com/',//
-		api_admin: 'http://127.0.0.1:7004/',//'https://api.admin.wdklian.com/', //
+		api_base: 'http://192.168.1.199:7000/',//''https://dev.base.wdklian.com/',//,
+		api_buyer: 'http://192.168.1.199:7002/',//'https://api.buyer.wdklian.com/',//
+		api_seller: 'http://192.168.1.199:7003/',//'https://api.seller.wdklian.com/',//
+		api_admin: 'http://192.168.1.199:7004/',//'https://api.admin.wdklian.com/', //
   }
   // api_domain:{
   //   api_base: 'https://api.base.wdklian.com/',//,'https://api.base.wdklian.com/',//''https://dev.base.wdklian.com/',//,
-	// 	api_buyer: 'https://api.buyer.wdklian.com/',//'http://127.0.0.1:7002/',//'https://api.buyer.wdklian.com/',///'https://api.buyer.wdklian.com/',//
-	// 	api_seller: 'https://api.seller.wdklian.com/',//'http://127.0.0.1:7003/',//'https://api.seller.wdklian.com/',//
-	// 	api_admin: 'https://api.admin.wdklian.com/', //'http://127.0.0.1:7004/',//'https://api.admin.wdklian.com/', //
+	// 	api_buyer: 'https://api.buyer.wdklian.com/',//'http://192.168.1.199:7002/',//'https://api.buyer.wdklian.com/',///'https://api.buyer.wdklian.com/',//
+	// 	api_seller: 'https://api.seller.wdklian.com/',//'http://192.168.1.199:7003/',//'https://api.seller.wdklian.com/',//
+	// 	api_admin: 'https://api.admin.wdklian.com/', //'http://192.168.1.199:7004/',//'https://api.admin.wdklian.com/', //
   // }
-    
+
   }
 
 })

+ 2 - 2
custom-tab-bar/index.wxml

@@ -1,4 +1,4 @@
-<van-tabbar active="{{ active }}" 
+<van-tabbar active="{{ active }}"
    bind:change="onChange">
   <van-tabbar-item wx:for="{{ list }}" wx:key="index" icon="{{ item.icon }}" info="{{item.info}}">{{
     item.text
@@ -10,4 +10,4 @@
                 <wux-icon wux-class="icon" type="{{item.icon}}" size="22" slot="icon-on" />
                 <wux-icon wux-class="icon" type="{{item.icon}}" size="22" slot="icon-off" />
             </wux-tabbar-item>
- </wux-tabbar> -->
+ </wux-tabbar> -->

+ 23 - 16
pages/aftersale/index.wxml

@@ -1,25 +1,25 @@
 <wxs module="dateUtil" src="../../utils/dateTime.wxs"></wxs>
 
 <view class="order-panel" wx:if="{{orderList.length>0}}">
-<view class="wux-light--bg wux-hairline--top wux-mt--15 wux-mb--15" wx:for="{{orderList}}" wx:key="{{index}}">
+<view class="wux-light--bg wux-hairline--top wux-mt--15 wux-mb--15" wx:for="{{orderList}}" wx:key="index">
 <wux-wing-blank  >
 <view class="wux-hairline--bottom">
  <wux-row>
-            <wux-col span="6">
+            <wux-col span="10">
                 <view>售后单号:{{item.refund.sn}}</view>
             </wux-col>
-            <wux-col span="6" class="wux-text--right">
-                <view >售后类型:{{item.refund.refuse_type_text}}</view>
+            <wux-col span="2" class="wux-text--right">
+                <view >{{item.refund.refuse_type_text}}</view>
             </wux-col>
         </wux-row>
 </view>
 <view class="wux-hairline--bottom">
         <wux-row >
-            <wux-col span="6">
+            <wux-col span="7">
                 <view>退款人:{{item.refund.member_name}}</view>
             </wux-col>
-            <wux-col span="6" class="wux-text--right">
-                <view >申请时间:{{dateUtil.dateFormat(item.refund.create_time,'yyyy-MM-dd hh:mm')}}</view>
+            <wux-col span="5" class="wux-text--right">
+                <view >{{dateUtil.dateFormat(item.refund.create_time,'yyyy-MM-dd hh:mm')}}</view>
             </wux-col>
         </wux-row>
       </view>
@@ -27,21 +27,29 @@
       <view class="wux-hairline--bottom">
         <wux-row >
             <wux-col span="6" >
-                <view >关联订单:{{item.refund.order_sn}}</view>
+                <view >关联订单:</view>
             </wux-col>
             <wux-col span="6" class="wux-text--right">
-                <view class="wux-assertive">申请退款金额:¥{{item.refund.refund_price}}</view>
+                <view>{{item.refund.order_sn}}</view>
             </wux-col>
         </wux-row>
       </view>
 
-      <view >
+    <view >
         <wux-row >
             <wux-col span="6" >
-                <view >退款原因:{{item.refund.refund_reason}}</view>
+                <view class="wux-assertive">退款状态:{{item.refund.refund_status_text}}</view>
             </wux-col>
             <wux-col span="6" class="wux-text--right">
-                <view class="wux-assertive">退款状态:{{item.refund.refund_status_text}}</view>
+                <view class="wux-assertive">申请退款金额:¥{{item.refund.refund_price}}</view>
+            </wux-col>
+        </wux-row>
+    </view>
+
+      <view >
+        <wux-row >
+            <wux-col span="12" >
+                <view >退款原因:{{item.refund.refund_reason}}</view>
             </wux-col>
         </wux-row>
       </view>
@@ -51,8 +59,7 @@
     <van-card
   price="{{goods.price}}"
   wx:for="{{item.refund_goods}}"
-  wx:key="{{idx}}"
-  wx:for-index="idx" wx:for-item="goods"
+  wx:for-index="idx" wx:for-item="goods" wx:key="index"
   title="{{goods.goods_name}}"
   thumb="{{goods.goods_image}}"
 >
@@ -66,7 +73,7 @@
 <view class="btns">
 <van-button type="primary" wx:if="{{item.refund.after_sale_operate_allowable.allow_seller_approval}}" data-sn="{{item.refund.sn}}" data-agree="1" data-price="{{item.refund.refund_price}}" size="small" bindtap="handleRefundAuth">同意</van-button>
 <van-button type="danger" wx:if="{{item.refund.after_sale_operate_allowable.allow_seller_approval}}" data-sn="{{item.sn}}" data-agree="0" size="small" class="wux-ml--15" bindtap="handleRefundAuth">拒绝</van-button>
-</view> 
+</view>
 </view>
 </view>
 <view wx:else>
@@ -81,4 +88,4 @@
 <wux-toptips id="wux-toptips" />
 <wux-toast id="wux-toast" />
 <wux-loading id="wux-loading" />
-<wux-dialog id="wux-dialog" />
+<wux-dialog id="wux-dialog" />

+ 2 - 2
pages/fund/addWithdrawApply.js

@@ -144,7 +144,7 @@ Page({
       ['submitForm.apply_remark']:e.detail
     })
   },
-  /** 获取当前登用户信息 */
+  /** 获取当前登用户信息 */
   getMemberDetail(id){
     let that=this
     API_Member.getCareMember(id,{}).then(res=>{
@@ -154,4 +154,4 @@ Page({
       })
     })
   }
-})
+})

+ 2 - 2
pages/fund/withdrawAccountEdit.js

@@ -205,7 +205,7 @@ Page({
     ['editForm.bank_account']:final.openid
   })
   },
-  // 同步获取登code
+  // 同步获取登code
  wxlogin(){
   return new Promise((resolve,reject)=>{
      wx.login({
@@ -225,4 +225,4 @@ Page({
      })
    })
  }
-})
+})

+ 45 - 25
pages/goods/edit.js

@@ -40,13 +40,13 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function(options) {
-    let shop = app.globalData.sellerShop    
+    let shop = app.globalData.sellerShop
     if(shop.shop_type==='2'){
       this.getCategorys(0)
     }else{
       this.getCategory(-1)
-    }    
-    
+    }
+
     var that = this
     /** 获取商品id参数 */
 
@@ -133,7 +133,7 @@ Page({
   onShareAppMessage: function() {
 
   },
-  /** 
+  /**
    * 打开分类选择器
    */
   showCategoryPicker() {
@@ -285,13 +285,33 @@ Page({
   },
   navToResize(e){
     console.log(e);
-    if (e.currentTarget.dataset.action == "edit"){
-      let fileList = this.data.fileList;
+    const that = this
+    if (e.currentTarget.dataset.action === "edit"){
       let index = e.currentTarget.dataset.index;
+      let fileList = this.data.fileList;
       let imgFile = fileList[index];
-      wx.navigateTo({
-        url: '/pages/image/resize?imgSrc=' + imgFile.url + '&idx=' + index,
+      console.log('imgFile.uid===', imgFile.uid)
+      wx.showModal({
+        title: '操作提示',
+        content: '请选择您的操作?',
+        confirmText: '修改图片',
+        confirmColor: '#576B95',
+        cancelText: '删除图片',
+        cancelColor: '#d02a2a',
+        success: function (res) {
+          if (res.confirm) {
+            console.log('imgFile===', imgFile)
+            wx.navigateTo({
+              url: '/pages/image/resize?imgSrc=' + imgFile.url + '&idx=' + index,
+            })
+          } else {
+            that.setData({
+              fileList: fileList.filter((n) => n.uid !== imgFile.uid),
+            })
+          }
+        }
       })
+
     } else {
       wx.navigateTo({
         url: '/pages/image/resize',
@@ -381,7 +401,7 @@ Page({
     if (!flag) {
       return false
     }
-    
+
 
     /**  产品上架参数  */
     const goodsParam = {
@@ -562,7 +582,7 @@ Page({
      _this.uploadPic().then(res=>{
     let resData = JSON.parse(res.data)
     let imgs=_this.data.pics
-    imgs.push(resData.url)   
+    imgs.push(resData.url)
     _this.setData({
       pics:imgs
     })
@@ -574,7 +594,7 @@ Page({
       text: "图片上传失败",
       duration: 2000,
       success: () => {
-        
+
       }
     })
    })
@@ -584,12 +604,12 @@ Page({
     const {id}=e.currentTarget.dataset
     let _this = this
     _this.uploadPic().then(res=>{
-     let resData = JSON.parse(res.data);		
+     let resData = JSON.parse(res.data);
      console.log(res, resData);
      let imgs=_this.data.pics
-     
+
     imgs[id]=resData.url
-    
+
      _this.setData({
        pics:imgs
      })
@@ -601,7 +621,7 @@ Page({
        text: "图片上传失败",
        duration: 2000,
        success: () => {
-         
+
        }
      })
     })
@@ -627,10 +647,10 @@ Page({
           console.log(res);
           let { tempFilePaths } = res;
           let tempFilePath = tempFilePaths[0];
-          
+
           wx.getImageInfo({
             src: tempFilePath,
-            success: function (image) {              
+            success: function (image) {
               wx.uploadFile({
                 url: _this.data.uploadUrl,
                 filePath: tempFilePath,
@@ -640,7 +660,7 @@ Page({
                 },
                 success: function(res) {
                   console.log('success',res)
-                  resolve(res)                  
+                  resolve(res)
                 },
                 fail: function(res) {
                  reject(res)
@@ -654,13 +674,13 @@ Page({
     })
   },
   imgToHtml(imgs){
-    let html=''   
+    let html=''
     if(imgs instanceof Array) {
       imgs.forEach(item=>{
         html+='<p><img src="'+item+'" width="100%"></img></p>'
        })
-    }      
-    return html;    
+    }
+    return html;
   },
   // 提取图片地址
   getImgSrc(html){
@@ -668,7 +688,7 @@ Page({
       var srcReg = /\bsrc\b\s*=\s*[\'\"]?([^\'\"]*)[\'\"]?/i
       var arr = []
       let imgArr=html.match(imgReg)
-      
+
       if(imgArr&&imgArr.length>0){
         imgArr.forEach(item=>{
           console.log(item)
@@ -680,8 +700,8 @@ Page({
           }
         })
       }
-      
-      
+
+
       return arr;
   }
-})
+})

+ 21 - 16
pages/goods/edit.wxml

@@ -12,22 +12,27 @@
   </wux-cell>
   <wux-cell title="商品图片" hover-class="none">
     <view style="margin-top:20rpx">
-      <!-- <wux-upload listType="picture-card" controlled fileList="{{fileList}}" showUploadList max="4" url="{{uploadUrl}}" bind:change="onFileChange" bind:success="onFileUploadSuccess" bind:fail="onFail" bind:complete="onFileComplete" bind:preview="onPreview"
-        bind:remove="onFileRemove">
-      </wux-upload> -->
+<!--      <wux-upload listType="picture-card" controlled fileList="{{fileList}}" showUploadList max="4" url="{{uploadUrl}}" bind:change="onFileChange" bind:success="onFileUploadSuccess" bind:fail="onFail" bind:complete="onFileComplete" bind:preview="onPreview"-->
+<!--        bind:remove="onFileRemove">-->
+<!--      </wux-upload>-->
+
+
         <view wx:if="{{fileList.length>0}}" >
-          <block class="image_upload" wx:for="{{fileList}}"  >
-            <image data-action="edit" data-index="{{index}}" bindtap="navToResize" mode="aspectFit" src="{{item.url}}"></image>
-            <van-icon class="image_close" name="close" size="20px"/>
+          <block class="image_upload"  wx:for="{{fileList}}" wx:key="index" >
+              <view class="my_image">
+                  <image style="width: 130rpx;height: 130rpx;" data-action="edit" data-index="{{index}}" bindtap="navToResize" mode="aspectFit" src="{{item.url}}"></image>
+<!--                  <van-icon class="image_close" name="close" size="20px"/>-->
+              </view>
+
           </block>
-          <view data-action="add" class="image_upload" bindtap="navToResize">
+          <view style="margin: 7rpx;" data-action="add" class="image_upload" bindtap="navToResize">
             <van-icon name="plus" size="20px" />
           </view>
-        </view>        
+        </view>
         <view wx:else data-action="add" class="image_upload" bindtap="navToResize">
           <van-icon name="plus" size="20px" />
         </view>
-        
+
     </view>
   </wux-cell>
 
@@ -46,7 +51,7 @@
 <view class="cu-card">
 
 <view>
-			<view wx:for="{{pics}}" wx:key="{{index}}"  class="margin bg-white text-center padding shadow margin-top-sm" >
+			<view wx:for="{{pics}}" wx:key="index"  class="margin bg-white text-center padding shadow margin-top-sm" >
 				<view class="cu-bar bg-white">
 					<view class="action"></view>
 					<view class="action">
@@ -57,7 +62,7 @@
 				<image mode="aspectFit" src="{{item}}" ></image>
 			</view>
 		</view>
-		
+
 		<view class="margin bg-white text-center padding shadow margin-top-sm">
 			<view bindtap="sendImage" style="height:200rpx" class="flex justify-center align-center text-xsl text-green">
 				<view class="cuIcon-roundadd"></view>
@@ -70,13 +75,13 @@
 <view class="operBtn">
   <van-row>
     <van-col span="12" wx:if="{{goods_id}}">
-    
-     <button class="van-button van-button van-button--primary van-button--primary van-button--large van-button--large van-button--square van-button--square" bindtap="offProduct" form-type="submit">下架</button>
+
+     <button class="van-button van-button van-button--danger van-button--danger van-button--large van-button--large van-button--square van-button--square" bindtap="offProduct" form-type="submit">下架</button>
     </van-col>
     <van-col span="{{goods_id?12:24}}">
-    
+
     <!-- <wux-button block  type="calm" bindtap="aboveProduct" formType="submit">calm</wux-button> -->
-    <button class="van-button van-button van-button--danger van-button--danger van-button--large van-button--large van-button--square van-button--square" bindtap="aboveProduct" form-type="submit">上架</button>
+    <button class="van-button van-button van-button--primary van-button--primary van-button--large van-button--large van-button--square van-button--square" bindtap="aboveProduct" form-type="submit">上架</button>
     </van-col>
   </van-row>
 </view>
@@ -85,4 +90,4 @@
 <wux-toptips id="wux-toptips" />
 <wux-toast id="wux-toast" />
 <wux-loading id="wux-loading" />
-<wux-dialog id="wux-dialog" />
+<wux-dialog id="wux-dialog" />

+ 21 - 5
pages/goods/edit.wxss

@@ -14,11 +14,27 @@
   height: 150rpx;
   display: flex;
   justify-content: center;
-  border: 1rpx solid #333;
   position: relative;
+  border: 1rpx solid #908787;
+}
+.my_image {
+    margin: 7rpx;
+    border: 1rpx solid #908787;
+    float: left;
 }
 .image_close{
-  position:absolute;
-  top: 5rpx;
-  left: 5rpx;
-}
+  /*position:relative;*/
+  /*top: 5rpx;*/
+  /*left: 5rpx;*/
+  /*  z-index:9999;*/
+  /*  width: 30 rpx;*/
+  /*  height: 30 rpx;*/
+    position: relative;
+  /*  right: -25 rpx;*/
+    top: 5 rpx;
+    margin-right: 20rpx;
+    /*text-align: right;*/
+    /*vertical-align: top;*/
+    z-index: 2;
+    /*background-size: 30 rpx auto;*/
+}

+ 42 - 4
pages/goods/goods-list.js

@@ -7,6 +7,7 @@ import {
   $wuxLoading,
   $wuxDialog
 } from '../../wux/index.js'
+import {unpGoods} from "../../api/goods.js";
 Page({
 
   /**
@@ -124,7 +125,7 @@ Page({
     delete this.data.pageParam.keyword
     this.getGoodsList()
   },
-  
+
   /** 编辑产品 */
   editGoods(e) {
 
@@ -173,7 +174,7 @@ Page({
         reject(err)
       })
     })
-    
+
   },
   /** 下架产品 */
   offProduct(e) {
@@ -222,6 +223,43 @@ Page({
       },
     })
   },
+
+  /** 下架产品 */
+  onProduct(e) {
+    const that = this
+    const goods_id = e.currentTarget.dataset.id
+    API_Goods.unpGoods(goods_id).then(res => {
+      if (res === '') {
+        that.data.goods.forEach((item, index) => {
+          if (item.goods_id === parseInt(goods_id)) {
+            that.setData({
+              ['goods[' + index + '].market_enable']: 1
+            })
+          }
+        })
+        $wuxToptips().success({
+          hidden: false,
+          text: '产品已上架',
+          duration: 2000,
+          success: () => {}
+        })
+      } else {
+        $wuxToptips().error({
+          icon: 'cancel',
+          hidden: false,
+          text: res.message,
+          duration: 2000
+        })
+      }
+    }).catch(error => {
+      $wuxToptips().error({
+        icon: 'cancel',
+        hidden: false,
+        text: error.message,
+        duration: 2000
+      })
+    })
+  },
   /** 此次修改库存 只考虑默认SKU,没有考虑多种规格的情况 */
   stockPopShow(e) {
     const that = this
@@ -331,8 +369,8 @@ Page({
   formSubmit(e) {
     console.log(e)
     API_Passport.saveFormId({ form_id: e.detail.formId }).then(res => {
-     
+
     })
   }
 
-})
+})

+ 6 - 5
pages/goods/goods-list.wxml

@@ -21,12 +21,12 @@
 </view>
 
 <view style="position:fixed;right:20rpx;bottom:120rpx; z-index:100">
-        
+
 <button style="width:80rpx;height:80rpx;"  class="cu-btn shadow icon bg-green text-xxl"  bindtap="publishGoods" ><text class="cuIcon-add"></text></button>
 
       </view>
 
-<van-collapse value="{{ activeNames }}" bind:change="onCollapseChange" accordion>
+<van-collapse value="{{ activeNames }}" bind:change="onCollapseChange" accordion >
   <van-collapse-item name="{{index}}" wx:for="{{goods}}" wx:key="index" is-link="{{false}}">
     <view slot="right-icon" class="right-icon">
       <van-icon name="question-o" color="#1989fa" size="20px" />
@@ -51,13 +51,14 @@
       </view>
 
     </view>
-    <view class="btns">
+    <view style="margin-bottom: 60rpx" class="btns">
       <van-row>
         <van-col span="8">
           <van-button type="primary" data-id="{{item.goods_id}}" bind:click="editGoods" size="small">编辑</van-button>
         </van-col>
         <van-col span="8">
-          <van-button type="danger" data-id="{{item.goods_id}}" bindtap="offProduct" size="small">下架</van-button>
+          <van-button wx:if="{{item.market_enable === 1}}" type="danger" data-id="{{item.goods_id}}" bindtap="offProduct" size="small">下架</van-button>
+          <van-button wx:else type="warning" data-id="{{item.goods_id}}" bindtap="onProduct" size="small">上架</van-button>
         </van-col>
         <van-col span="8">
           <van-button type="info" bindtap="stockPopShow" data-id="{{item.goods_id}}" size="small">库存</van-button>
@@ -86,4 +87,4 @@
       <wux-button block type="balanced" bindtap="updateQuantity">确定</wux-button>
     </wux-cell>
   </wux-cell-group>
-</wux-popup>
+</wux-popup>

+ 5 - 5
pages/image/resize.wxml

@@ -17,10 +17,10 @@
     <switch checked='{{disable_rotate?true:false}}' bindchange="switchChangeDisableRotate" />
     <text style='color:white;margin-right:5rpx;'>限制移动</text>
     <switch checked='{{limit_move?true:false}}' bindchange="switchChangeLimitMove" /> -->
-    <button class="button" catchtouchstart='top' catchtouchend='end' data-type="top">上</button>
-    <button class="button" catchtouchstart='bottom' catchtouchend='end' data-type="bottom">下</button>
-    <button class="button" catchtouchstart='left' catchtouchend='end' data-type="left">左</button>
-    <button class="button" catchtouchstart='right' catchtouchend='end' data-type="right">右</button>
+<!--    <button class="button" catchtouchstart='top' catchtouchend='end' data-type="top">上</button>-->
+<!--    <button class="button" catchtouchstart='bottom' catchtouchend='end' data-type="bottom">下</button>-->
+<!--    <button class="button" catchtouchstart='left' catchtouchend='end' data-type="left">左</button>-->
+<!--    <button class="button" catchtouchstart='right' catchtouchend='end' data-type="right">右</button>-->
     <button class="button" catchtouchstart='enlarge' catchtouchend='end' data-type="enlarge">放大</button>
     <button class="button" catchtouchstart='narrow' catchtouchend='end' data-type="narrow">缩小</button>
     <button class="button" catchtouchstart='rotate' catchtouchend='end' data-type="rotate">旋转</button>
@@ -28,5 +28,5 @@
   <view>
     <wux-button block type="light" bindtap='submit'>确定</wux-button>
   </view>
-    
+
 </view>

+ 83 - 82
pages/index/index.js

@@ -28,7 +28,7 @@ Page({
     ship_out_sn:''
   },
 
-  onLoad: function() {      
+  onLoad: function() {
     const bool_o2o=app.globalData.authorInfo.boolO2o
 	if(bool_o2o===0){
 		wx.redirectTo({
@@ -66,9 +66,9 @@ Page({
   },
   /** 显示底部导航 */
   onShow() {
-    //下拉刷新时,可能用户未登,再返回此页时顶部会一直显示加载状态,这里首先隐藏加载状态
+    //下拉刷新时,可能用户未登,再返回此页时顶部会一直显示加载状态,这里首先隐藏加载状态
     wx.hideNavigationBarLoading()
-  
+
       this.setData({
         ['pageParam.page_no']: 1,
         finished: false
@@ -76,8 +76,8 @@ Page({
         this.getOrderData()
         Common.getCurrentShopData().then(res => {
           this.getTabBar().init()
-        })     
-    
+        })
+
   },
   onChange(event) {
     this.setData({
@@ -86,7 +86,7 @@ Page({
   },
   getOrderData() {
     return new Promise((resolve, reject) => {
-      let that = this 
+      let that = this
 	  const authorInfo=app.globalData.authorInfo
 	  if(authorInfo===null||authorInfo===''){ //授权信息不存,不发起请求
 	  	return
@@ -137,91 +137,92 @@ Page({
       sn
     } = e.currentTarget.dataset
     const that = this
-    const order=that.data.orderList.find(p=>p.sn===sn)
-
+    // const order=that.data.orderList.find(p=>p.sn===sn)
     that.setData({
       shippingShow:true,
       ship_out_sn:sn
     })
-    
-    return
-    $wuxDialog().confirm({
-      resetOnClose: true,
-      closable: true,
-      title: '操作提示',
-      content: '该订单需线下配送,确认发货?',
-      onConfirm(e) {
-        API_Order.deliveryGoods(sn, {
-          'ship_no': '线下配送',
-          'logi_id': 0,
-          'logi_name': '线下配送'
-        }).then(res => {
-          if (res === '') {
-            $wuxToptips().success({
-              hidden: false,
-              text: '发货成功',
-              duration: 3000,
-              success: () => {
-                that.setData({
-                  ['pageParam.page_no']: 1,
-                  finished: false,
-                  orderList: []
-                })
-                that.getOrderData()
-                Common.getCurrentShopData().then(response => {
-                  that.getTabBar().init()
-                })
-
-              }
-            })
-
-
-          } else {
-            $wuxToptips().error({
-              icon: 'cancel',
-              hidden: false,
-              text: res.message,
-              duration: 3000
-            })
-          }
-        }).catch(error => {
-          $wuxToptips().error({
-            icon: 'cancel',
-            hidden: false,
-            text: error.message,
-            duration: 3000
-          })
-        })
-      },
-      onCancel(e) {
-
-      },
-    })
+    // $wuxDialog().confirm({
+    //   resetOnClose: true,
+    //   closable: true,
+    //   title: '操作提示',
+    //   content: '该订单需线下配送,确认发货?',
+    //   onConfirm(e) {
+    //     API_Order.deliveryGoods(sn, {
+    //       'ship_no': '线下配送',
+    //       'logi_id': 0,
+    //       'logi_name': '线下配送'
+    //     }).then(res => {
+    //       if (res === '') {
+    //         $wuxToptips().success({
+    //           hidden: false,
+    //           text: '发货成功',
+    //           duration: 3000,
+    //           success: () => {
+    //             that.setData({
+    //               ['pageParam.page_no']: 1,
+    //               finished: false,
+    //               orderList: []
+    //             })
+    //             that.getOrderData()
+    //             Common.getCurrentShopData().then(response => {
+    //               that.getTabBar().init()
+    //             })
+    //
+    //           }
+    //         })
+    //
+    //
+    //       } else {
+    //         $wuxToptips().error({
+    //           icon: 'cancel',
+    //           hidden: false,
+    //           text: res.message,
+    //           duration: 3000
+    //         })
+    //       }
+    //     }).catch(error => {
+    //       $wuxToptips().error({
+    //         icon: 'cancel',
+    //         hidden: false,
+    //         text: error.message,
+    //         duration: 3000
+    //       })
+    //     })
+    //   },
+    //   onCancel(e) {
+    //
+    //   },
+    // })
 
 
 
   },
   shipout(){
-    let that = this 
-    if(!that.data.ship_no.trim()){
+    let that = this
+    if(!that.data.selectLogi){
       $wuxToptips().error({
         icon: 'cancel',
         hidden: false,
-        text: '请填写快递单号',
+        text: '请选择快递公司',
         duration: 3000
       })
       return
     }
-   if(!that.data.selectLogi){
-    $wuxToptips().error({
-      icon: 'cancel',
-      hidden: false,
-      text: '请选择快递公司',
-      duration: 3000
-    })
-    return
-   }
-   const logi =that.data.logistics.find(p=>p.logi_id===that.data.selectLogi)
+    const logi =that.data.logistics.find(p=>p.logi_id===that.data.selectLogi)
+    if (logi.name === '无需物流') {
+      that.data.ship_no = logi.name
+    } else {
+      if(!that.data.ship_no.trim()){
+        $wuxToptips().error({
+          icon: 'cancel',
+          hidden: false,
+          text: '请填写快递单号',
+          duration: 3000
+        })
+        return
+      }
+    }
 
    API_Order.deliveryGoods(that.data.ship_out_sn, {
     'ship_no': that.data.ship_no,
@@ -295,7 +296,7 @@ Page({
   },
 
   /** 物流公司信息开启 /关闭 */
-  
+
   switchLogisState(e){
     const {logi_id}=e.currentTarget.dataset
     let row=this.data.logistics.find(p=>p.logi_id===logi_id)
@@ -308,7 +309,7 @@ Page({
         if (res.confirm) {
 
           if(row.shop_id){
-            that.closeLogistics(row.logi_id) 
+            that.closeLogistics(row.logi_id)
           }else{
             that.openLogistics(row.logi_id)
           }
@@ -317,10 +318,10 @@ Page({
         }
       }
     })
-    
+
 
   },
-  
+
 
   /** 执行关闭  */
   closeLogistics(logi_id) {
@@ -340,7 +341,7 @@ Page({
       wx.showToast({
         title: '开启成功',
       })
-      that.getLogisticCompany()      
+      that.getLogisticCompany()
     })
   },
   radioClick(event){
@@ -352,7 +353,7 @@ Page({
   shipNoChange(e){
    this.setData({
      ship_no:e.detail
-   }) 
+   })
   },
   scanShipNo(){
     let that =this
@@ -364,4 +365,4 @@ Page({
       }
     })
   }
-})
+})

+ 10 - 10
pages/index/index.wxml

@@ -2,7 +2,7 @@
 <view wx:if="{{!loading}}">
 <wxs module="dateUtil" src="../../utils/dateTime.wxs"></wxs>
 <view class="order-panel cu-card article" wx:if="{{orderList.length>0}}">
-  <view class="order-item cu-item shadow" wx:for="{{orderList}}" wx:key="{{index}}">
+  <view class="order-item cu-item shadow" wx:for="{{orderList}}" wx:key="index">
     <view class="order-header van-hairline--bottom">
       <van-row>
         <van-col span="4">
@@ -25,7 +25,7 @@
     </view>
     <!--地址-->
     <view class="flex solid-bottom">
-<text class="text-green text-xl add-list-icon cuIcon-location"></text> 
+<text class="text-green text-xl add-list-icon cuIcon-location"></text>
 <view class="flex-sub">
 <view>{{item.ship_address}}</view>
 <view>{{item.ship_name}}<text class="margin-left-sm">{{item.ship_mobile}}</text></view>
@@ -38,20 +38,20 @@
     </view> -->
 <!--产品-->
 <view class="solid-bottom">
-<view class="content" wx:for="{{item.sku_list}}" wx:for-index="idx" wx:for-item="sku">
+<view class="content" wx:for="{{item.sku_list}}" wx:for-index="idx" wx:for-item="sku" wx:key="idx">
   <image src="{{sku.goods_image }}" ></image>
   <view class="desc">
    <view class="text-content text-ABC">{{sku.name}}</view>
    <view class="price-action">
 		         <text class="text-red text-sm margin-top-sm">¥{{sku.original_price}}</text>
 		 					  <view class="purchase-action">
-		 						 <text class="text-gray" >x{{sku.num}}</text> 
+		 						 <text class="text-gray" >x{{sku.num}}</text>
 		 					  </view>
   </view>
   </view>
 </view>
 
-         
+
         </view>
 
 <!-- <wux-cell-group>
@@ -70,14 +70,14 @@
             <view slot="footer" class="van-card_price">¥{{item.order_amount}}</view>
           </wux-cell>
         </wux-cell-group>
-<van-cell-group> 
+<van-cell-group>
 <van-cell title="订单号" value="{{item.sn}}">
   </van-cell>
 </van-cell-group>
 <view class="btns">
 <van-button type="primary" wx:if="{{item.order_operate_allowable_vo.allow_ship}}" data-sn="{{item.sn}}" size="small" bindtap="delivery">发货</van-button>
 <navigator wx:if="{{item.service_status=='APPLY'}}" url="/pages/aftersale/index" class="wux-assertive">订单已申请售后,点击查看售后订单</navigator>
-</view> 
+</view>
   </view>
 </view>
 
@@ -128,7 +128,7 @@
 
 
  <!--弹窗快递设置-->
- <van-popup 
+ <van-popup
  show="{{ shippingModeShow }}"
   position="bottom"
   closeable
@@ -139,7 +139,7 @@
 <view class="content">物流公司设置</view>
 </view>
  <van-cell-group >
- <van-cell title="{{item.name}}" wx:for="{{logistics}}" wx:ke="index">
+ <van-cell title="{{item.name}}" wx:for="{{logistics}}" wx:key="index">
  <view >
   <van-switch
     checked="{{ item.shop_id!==undefined && item.shop_id!==null }}"
@@ -158,4 +158,4 @@
 <wux-toptips id="wux-toptips" />
 <wux-toast id="wux-toast" />
 <wux-loading id="wux-loading" />
-<wux-dialog id="wux-dialog" />
+<wux-dialog id="wux-dialog" />

+ 14 - 14
pages/login/index.js

@@ -40,7 +40,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function(options) {
-    //注册之前删除自动登陆记录,注册成功之后需要进行自动登陆,因为注册时绑定了微信unionId,可以自动登陆成功.如果不删除自动登陆记录,自动登陆不会进行
+    //注册之前删除自动登录记录,注册成功之后需要进行自动登录,因为注册时绑定了微信unionId,可以自动登录成功.如果不删除自动登录记录,自动登录不会进行
     wx.removeStorageSync('login_result')
 
     wx.getSetting({
@@ -56,9 +56,9 @@ Page({
           wx.getUserInfo({
             complete: (res) => {
               console.log(res)
-              this.setData({               
+              this.setData({
                 'userInfo': res.userInfo
-              }) 
+              })
             },
           })
         }
@@ -77,7 +77,7 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function() {
-    
+
   },
 
   /**
@@ -251,7 +251,7 @@ Page({
   /** 注册新用户 */
   register(e) {
     const that=this
-    
+
     let param = {
       regmobile: null,
       regpassword: null,
@@ -302,14 +302,14 @@ Page({
       if (response.result === 'bind_success') {
         let now = Math.round(new Date() / 1000)
         if (response.access_token) {
-          //保存登信息
+          //保存登信息
           const {refresh_token_timeout,access_token_timeout}=response
-          
-          app.globalData.authorInfo={...response,'refresh_token_timeout':now+refresh_token_timeout-1000,'access_token_timeout':now+access_token_timeout-1000}	
-          //登信息写入本地存储
+
+          app.globalData.authorInfo={...response,'refresh_token_timeout':now+refresh_token_timeout-1000,'access_token_timeout':now+access_token_timeout-1000}
+          //登信息写入本地存储
           wx.setStorageSync('authorInfo', app.globalData.authorInfo)
         }
-        
+
         $wuxToptips().success({
           hidden: false,
           text: '注册成功!',
@@ -318,12 +318,12 @@ Page({
             that.setData({
               buttonClicked:false
             })
-            //注册成功自动登,在该函数中统一实现跳转逻辑
+            //注册成功自动登,在该函数中统一实现跳转逻辑
             Common.toAutoLogin()
           }
         })
 
-        
+
       }
     }).catch(error=>{
       $wuxToptips().error({
@@ -336,9 +336,9 @@ Page({
           })
         }
       })
-      
+
     })
 
   }
 
-})
+})

+ 30 - 27
pages/login/login.js

@@ -37,9 +37,9 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function(options) {
-    //如果没有自动登陆记录,首先进行自动登陆尝试,如果有登陆信息,通过toAutologin实现跳转逻辑
+    //如果没有自动登录记录,首先进行自动登录尝试,如果有登录信息,通过toAutologin实现跳转逻辑
     if(wx.getStorageSync('login_result')==='' || wx.getStorageSync('authorInfo')!==''){
-      Common.toAutoLogin()
+      // Common.toAutoLogin()
     }
   },
 
@@ -98,7 +98,7 @@ Page({
 	  const that = this
 	  let dataKey = event.currentTarget.dataset.name
     // event.detail 为当前输入的值
-   
+
     this.setData({
       [dataKey]: event.detail
     })
@@ -118,11 +118,11 @@ Page({
 	  			['smscode_error']: false,
 	  			['smscode_error_message']: '',
 				['smscode']:value
-	  		})	
+	  		})
 	  	}
-	     
+
 	  } catch (e) {
-	  	  
+
 	  }
   },
   login() {
@@ -147,7 +147,7 @@ Page({
             }
           }
         )
-        
+
         if(that.data['username_error']||that.data['password_error']){
 			return false
 		}
@@ -157,7 +157,7 @@ Page({
         let params = {
           username: that.data.username,
           password: that.data.password,
-          uuid: app.globalData.uuid,
+          uuid: wx.getStorageSync('uuid'),
           code: res.code,
           mini_program_type: app.globalData.miniProgramType
         }
@@ -169,11 +169,11 @@ Page({
               buttonClicked:false
             })
             if (response.access_token) {
-		      //保存登信息
+		      //保存登信息
 			  const {refresh_token_timeout,access_token_timeout}=response
-			  
-        app.globalData.authorInfo={...response,'refresh_token_timeout':now+refresh_token_timeout-1000,'access_token_timeout':now+access_token_timeout-1000}	
-			  //登信息写入本地存储
+
+        app.globalData.authorInfo={...response,'refresh_token_timeout':now+refresh_token_timeout-1000,'access_token_timeout':now+access_token_timeout-1000}
+			  //登信息写入本地存储
               wx.setStorageSync('authorInfo', app.globalData.authorInfo)
               if(app.globalData.authorInfo.bool_o2o===0){
                 wx.redirectTo({
@@ -191,7 +191,7 @@ Page({
           if(response.result==='existed'){
             wx.showModal({
               title: '提示',
-              content: '当前微信已经绑定了一个用户,请点击确定按钮登陆已绑定账号,如需更换账号,登陆账户后退出登陆完成解绑',
+              content: '当前微信已经绑定了一个用户,请点击确定按钮登录已绑定账号,如需更换账号,登录账户后退出登录完成解绑',
               showCancel:false,
               success (res) {
                 if (res.confirm) {
@@ -202,7 +202,7 @@ Page({
                 }
               }
             })
-            
+
           }
 
           }).catch(err=>{
@@ -283,19 +283,19 @@ Page({
 	      }
 	    }
 	  )
-	
+
 	  let flag = true
 	  if (that.data['mobile_error']) {
 	    return false
 	  }
-	  
+
 	  const countDown = this.selectComponent('.control-count-down')
 	  countDown.start()
 	  API_Passport.sendLoginSms(that.data.mobile).then(res=>{
 		 that.setData({
 		 		  send_btn_disable:true,
 		 		  sending:true
-		 }) 
+		 })
 	  }).catch(err=>{
 		  $wuxToptips().error({
 		    icon: 'cancel',
@@ -305,7 +305,7 @@ Page({
 		  })
 		  return
 	  })
-	  
+
   },
   /** 倒计时结束 */
   finished(e){
@@ -317,7 +317,7 @@ Page({
 	  const countDown = this.selectComponent('.control-count-down')
 	  countDown.reset()
   },
-  /** 短信验证码登提交*/
+  /** 短信验证码登提交*/
   loginsmscode(e){
 	 let that = this
 	 wx.login({
@@ -359,12 +359,12 @@ Page({
             buttonClicked:false
           })
             if (response.access_token) {
-		      //保存登信息
+		      //保存登信息
 			  const {refresh_token_timeout,access_token_timeout}=response
-			  
-        app.globalData.authorInfo={...response,'refresh_token_timeout':now+refresh_token_timeout-1000,'access_token_timeout':now+access_token_timeout-1000}	
+
+        app.globalData.authorInfo={...response,'refresh_token_timeout':now+refresh_token_timeout-1000,'access_token_timeout':now+access_token_timeout-1000}
         console.log(app.globalData.authorInfo)
-			  //登信息写入本地存储
+			  //登信息写入本地存储
               wx.setStorageSync('authorInfo', app.globalData.authorInfo)
               if(app.globalData.authorInfo.bool_o2o===0){
                 wx.redirectTo({
@@ -377,7 +377,7 @@ Page({
               }
             }
 	       }).catch(err=>{
-	         
+
 	         $wuxToptips().error({
 	           icon: 'cancel',
 	           hidden: false,
@@ -392,12 +392,15 @@ Page({
 	         return
 	       })
 	   }
-	 
+
 	 })
-	  
+
   },
    tabChange(event) {
       // event.detail 的值为当前选中项的索引
       this.setData({ active: event.detail });
+    },
+    wechatLogin() {
+        Common.toAutoLogin()
     }
-})
+})

+ 3 - 3
pages/login/login.json

@@ -1,6 +1,6 @@
 {
-  "navigationBarTitleText": "用户登",
+  "navigationBarTitleText": "用户登",
   "usingComponents": {
     "wux-switch": "/wux/switch/index"
-  }  
-}
+  }
+}

+ 19 - 15
pages/login/login.wxml

@@ -1,27 +1,27 @@
 <!--pages/login/login.wxml-->
 <van-tabs active="{{ active }}" bind:change="tabChange">
-  <van-tab title="账号密码登" class="margin-top-sm block">
-	  
+  <van-tab title="账号密码登" class="margin-top-sm block">
+
 	  <wux-cell-group>
 	    <van-field value="{{username}}" data-name="username" placeholder="请输入用户名/手机号" left-icon="contact" label="{{username_label}}" data-label="{{username_label}}" border="{{ true }}" bind:blur="onBlur" bind:change="onChange" data-rules="required" error="{{username_error}}"
 	      error-message="{{username_error_message}}" />
 	    <van-field value="{{ password }}" data-name="password" placeholder="请输入密码" left-icon="closed-eye" label="{{password_label}}" data-label="{{password_label}}" border="{{ true }}" type="password" bind:blur="onBlur" bind:change="onChange" data-rules="required"
 	      error="{{password_error}}" error-message="{{password_error_message}}" />
-	    
+
 	  </wux-cell-group>
 	  <view class="btn_area">
-	    
-	      <button type="primary" class="van-button van-button van-button--primary van-button--primary van-button--large van-button--large" bindtap="login" disabled="{{buttonClicked}}">登</button>
-	    
+
+	      <button type="primary" class="van-button van-button van-button--primary van-button--primary van-button--large van-button--large" bindtap="login" disabled="{{buttonClicked}}">登</button>
+
 	    <navigator class="wux-text--left" open-type="redirect" url="/pages/login/index"  style="margin-top:20px" >没有账号?立即注册</navigator>
 	  </view>
   </van-tab>
-  
-  <van-tab title="手机验证码登" class="margin-top-sm block">
+
+  <van-tab title="手机验证码登" class="margin-top-sm block">
 	  <wux-cell-group>
 	    <van-field value="{{mobile}}" data-name="mobile" placeholder="请输手机号码" left-icon="graphic" label="{{mobile_label}}" data-label="{{mobile_label}}" border="{{ true }}" bind:blur="onBlur" bind:change="onChange" data-rules="required,mobile" error="{{mobile_error}}"
 	      error-message="{{mobile_error_message}}" />
-	    <van-field value="{{ smscode }}" data-name="smscode" placeholder="短信验证码" left-icon="envelop-o" label="{{smscode_label}}" data-label="{{smscode_label}}" border="{{ true }}" type="number" bind:blur="onBlur" bind:change="onSmscodeChange" 
+	    <van-field value="{{ smscode }}" data-name="smscode" placeholder="短信验证码" left-icon="envelop-o" label="{{smscode_label}}" data-label="{{smscode_label}}" border="{{ true }}" type="number" bind:blur="onBlur" bind:change="onSmscodeChange"
 	      error="{{smscode_error}}" error-message="{{smscode_error_message}}" >
 		  <van-button type="primary" slot="button" size="small" bind:click="sendsmscode" disabled="{{send_btn_disable}}">
 			  <view hidden="{{!sending}}">
@@ -36,15 +36,19 @@
 <text hidden="{{sending}}">{{btn_tip}}</text>
 
 </van-button>
-		  </van-field>	    
+		  </van-field>
 	  </wux-cell-group>
 	  <view class="btn_area">
-	   
-	      <button type="primary" class="van-button van-button van-button--primary van-button--primary van-button--large van-button--large" bindtap="loginsmscode" disabled="{{buttonClicked}}">登</button>
-	    
+
+	      <button type="primary" class="van-button van-button van-button--primary van-button--primary van-button--large van-button--large" bindtap="loginsmscode" disabled="{{buttonClicked}}">登</button>
+
 	    <navigator class="wux-text--left" open-type="redirect" url="/pages/login/index"  style="margin-top:20px" >没有账号?立即注册</navigator>
 	  </view></van-tab>
- 
+
+	<view class="btn_area">
+		<wux-button block type="danger" class="van-button van-button van-button--danger van-button--danger van-button--large van-button--large" bind:click="wechatLogin">微信一键登录</wux-button>
+	</view>
+
 </van-tabs>
 
 
@@ -53,4 +57,4 @@
 <wux-toptips id="wux-toptips" />
 <wux-toast id="wux-toast" />
 <wux-loading id="wux-loading" />
-<wux-dialog id="wux-dialog" />
+<wux-dialog id="wux-dialog" />

+ 19 - 16
pages/member/index.js

@@ -22,7 +22,7 @@ Page({
   onLoad: function (options) {
     const that = this
     that.getTabBar().init()
-   
+
   },
 
   /**
@@ -78,18 +78,21 @@ Page({
 
   },
   logout(e){
-	  
+
 	  API_Passport.logout({'uid':app.globalData.authorInfo.uid}).then(res=>{
 		  wx.removeStorageSync('authorInfo')
 		  wx.removeStorageSync('sellerUser')
-      wx.removeStorageSync('sellerShop')	
-      wx.removeStorageSync('login_result')	  
+      wx.removeStorageSync('sellerShop')
+      wx.removeStorageSync('login_result')
 		  app.globalData.authorInfo = {}
 		  app.globalData.sellerUser = {}
 		  app.globalData.sellerShop = {}
-      //退出登陆 会清除redis授权缓存,自动登陆一下,把redis授权重新写入,以防用户又直接登陆
-      Common.toAutoLogin()
-	  }) 
+      //退出登录 会清除redis授权缓存,自动登录一下,把redis授权重新写入,以防用户又直接登录
+      // Common.toAutoLogin()
+          wx.redirectTo({
+              url: '/pages/login/login',
+          })
+	  })
   },
   onStateChange: function(e) {
 	  const that=this
@@ -110,7 +113,7 @@ Page({
 				  })
 				}).catch(err=>{
 				  console.log(err)
-				})  
+				})
 			  }else{ //解绑
 				  API_Passport.unbindUser(param).then(res=>{
 				    app.globalData.authorInfo.bool_bind=0
@@ -122,25 +125,25 @@ Page({
 				    console.log(err)
 				  })
 			  }
-			 
-			 
+
+
 		  }
 	  })
-		  
-	  
-    
+
+
+
   },
   subscribeMessage(e){
     console.log(e)
     wx.requestSubscribeMessage({
       tmplIds: ['Y2LCDRXld1ccrdmPavW4gBi1RhI8rjVyeOUencmPMpw'],
-      success (res) { 
+      success (res) {
         console.log(res)
       },
       complete(res){
         console.log(res)
       }
     })
-  
+
   }
-})
+})

+ 3 - 3
pages/member/index.wxml

@@ -14,11 +14,11 @@
   <!-- <wux-cell title="绑定微信号 接收订单模版消息" hoverClass="none">
 	  <wux-switch name="balanced" slot="footer" color="balanced" value="{{ bool_bind }}"  bind:change="onStateChange" />
   </wux-cell> -->
-  
+
 </wux-cell-group>
 
 
 
 <view class="btn_area">
- <wux-button block type="assertive" bind:click="logout">退出登</wux-button>
-</view>
+ <wux-button block type="assertive" bind:click="logout">退出登</wux-button>
+</view>

+ 2 - 2
pages/noshop/index.js

@@ -85,8 +85,8 @@ Page({
 		  app.globalData.authorInfo = {}
 		  app.globalData.sellerUser = {}
 		  app.globalData.sellerShop = {}
-      //退出登陆 会清除redis授权缓存,自动登陆一下,把redis授权重新写入,以防用户又直接登陆
+      //退出登录 会清除redis授权缓存,自动登录一下,把redis授权重新写入,以防用户又直接登录
       Common.toAutoLogin()
   	  }) 
   }
-})
+})

+ 1 - 1
pages/noshop/index.wxml

@@ -4,7 +4,7 @@
   <wux-result icon="{{icon}}" title="没有店铺" label="您还没有店铺,请先申请店铺" fixed>
 
     <wux-button block type="balanced" bind:click="goApplayShop">前往申请</wux-button>
-	<wux-button block type="assertive" bind:click="logout">退出登</wux-button>
+	<wux-button block type="assertive" bind:click="logout">退出登</wux-button>
 
   </wux-result>
 

+ 2 - 2
pages/order/index.js

@@ -51,7 +51,7 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function() {
-    //下拉刷新时,可能用户未登,再返回此页时顶部会一直显示加载状态,这里首先隐藏加载状态
+    //下拉刷新时,可能用户未登,再返回此页时顶部会一直显示加载状态,这里首先隐藏加载状态
     wx.hideNavigationBarLoading()	
       this.setData({
         ['pageParam.page_no']: 1,
@@ -167,4 +167,4 @@ Page({
       })
     })
   }
-})
+})

+ 7 - 7
pages/order/index.wxml

@@ -2,24 +2,24 @@
 <view wx:if="{{!loading}}">
 <wxs module="dateUtil" src="../../utils/dateTime.wxs"></wxs>
 <view class="cu-card article" wx:if="{{orderList.length>0}}">
-  <view class="cu-item shadow" wx:for="{{orderList}}" wx:key="{{index}}">
+  <view class="cu-item shadow" wx:for="{{orderList}}" wx:key="index">
  <view class="content  solid-bottom padding">
  <view>{{item.sn}}</view>
  <view><text class="text-red">{{item.order_status_text}}</text></view>
  </view>
 <view class="flex solid-bottom">
-<text class="text-green text-xl add-list-icon cuIcon-location"></text> 
+<text class="text-green text-xl add-list-icon cuIcon-location"></text>
 <view class="flex-sub">
 <view>{{item.ship_address}}</view>
 <view>{{item.ship_name}}<text class="margin-left-sm">{{item.ship_mobile}}</text></view>
 </view>
 </view>
     <!-- <wux-cell-group>
-      
+
       <wux-cell title="下单时间" extra="{{dateUtil.dateFormat(item.create_time)}}" hoverClass="none">
 
       </wux-cell>
-      
+
     </wux-cell-group> -->
 
     <!-- <view class="address">
@@ -32,14 +32,14 @@
 
 
 <view class="solid-bottom">
-<view class="content" wx:for="{{item.sku_list}}" wx:for-index="idx" wx:for-item="sku">
+<view class="content" wx:for="{{item.sku_list}}" wx:for-index="idx" wx:for-item="sku" wx:key="idx">
   <image src="{{sku.goods_image }}" ></image>
   <view class="desc">
    <view class="text-content text-ABC">{{sku.name}}</view>
    <view class="price-action">
 		         <text class="text-red text-sm margin-top-sm">¥{{sku.original_price}}</text>
 		 					  <view class="purchase-action">
-		 						 <text class="text-gray" >x{{sku.num}}</text> 
+		 						 <text class="text-gray" >x{{sku.num}}</text>
 		 					  </view>
   </view>
   </view>
@@ -78,4 +78,4 @@
 <wux-toptips id="wux-toptips" />
 <wux-toast id="wux-toast" />
 <wux-loading id="wux-loading" />
-<wux-dialog id="wux-dialog" />
+<wux-dialog id="wux-dialog" />

+ 8 - 8
pages/shop/myshop-list.wxml

@@ -1,14 +1,14 @@
 <!--pages/shop/myshop-list.wxml-->
-<block wx:for="{{shopList}}" wx:key="{{index}}" >
+<block wx:for="{{shopList}}" wx:key="index" >
 <wux-wing-blank size="default" style="margin-bottom:20rpx;">
   <wux-card  title="{{item.shop_name}}" actions="{{item.shop_type==='3'?actions:'' }}" bind:action="onAction" thumb="{{item.shop_logo}}" data-shopid="{{item.shop_id}}">
-    <view slot="body">地址:{{item.shop_province}}{{item.shop_city}}{{item.shop_county}}{{item.shop_town===null?"":item.shop_town}}{{item.shop_add}}</view>    
+    <view slot="body">地址:{{item.shop_province}}{{item.shop_city}}{{item.shop_county}}{{item.shop_town===null?"":item.shop_town}}{{item.shop_add}}</view>
   </wux-card>
 </wux-wing-blank>
 </block>
 
 
-	
+
 	<van-popup
 	  show="{{ hosptialSetting }}"
 	  position="bottom"
@@ -18,15 +18,15 @@
 <block wx:if="{{hosptials.length>0}}">
 <scroll-view scroll-y>
  <wux-checkbox-group  value="{{ hosptialSettingValues }}" title="{{currentShop.shop_name}}" bind:change="itemChange">
-         <wux-checkbox title="{{item.shop_name}}" wx:for="{{hosptials}}"  value="{{item.shop_id}}" wx:key="{{index}}" />
+         <wux-checkbox title="{{item.shop_name}}" wx:for="{{hosptials}}"  value="{{item.shop_id}}" wx:key="index" />
             </wux-checkbox-group>
-			
+
 <view class="btn-area">
- <wux-button block type="balanced" bind:click="submitSetting">设定</wux-button>   
-  
+ <wux-button block type="balanced" bind:click="submitSetting">设定</wux-button>
+
  </view>
  </scroll-view>
  </block>
  <view wx:else class="no-hosptial">该店铺所在区域暂无机构入驻! </view>
 </van-popup>
-<wux-toast id="wux-toast" />
+<wux-toast id="wux-toast" />

+ 3 - 3
pages/shop/shop-apply.js

@@ -281,7 +281,7 @@ Page({
           color: '#fff',
           text: '申请成功',
           success: () => {
-            //申请成功,重新登实现从买家到卖家的角色转换
+            //申请成功,重新登实现从买家到卖家的角色转换
             wx.removeStorageSync('authorInfo')
             wx.removeStorageSync('login_result')
             that.setData({
@@ -316,7 +316,7 @@ Page({
           color: '#fff',
           text: '申请成功',
           success: () => {
-            //申请成功,重新登陆设置当前登陆店铺信息
+            //申请成功,重新登录设置当前登录店铺信息
             wx.removeStorageSync('authorInfo')
             wx.removeStorageSync('login_result')
             that.setData({
@@ -342,4 +342,4 @@ Page({
   }
   }
 
-})
+})

+ 9 - 6
pages/store/index.js

@@ -17,7 +17,9 @@ Page({
     shops: [],
     todayOrderNum: 0,
     todayOrderTotal: 0,
-    loaded:false
+    loaded:false,
+      shopAdminMemberId: null,
+      userId: null
   },
 
   /**
@@ -34,7 +36,7 @@ Page({
 
   },
   attached:function(){
-	 
+
   },
   /**
    * 生命周期函数--监听页面显示
@@ -187,7 +189,7 @@ Page({
       })
     })
   },
- 
+
   /** 加载店铺信息 **/
   getCurrentShopData(){
 	  const that=this
@@ -199,8 +201,9 @@ Page({
 	      startTime: app.globalData.sellerShop.start_time,
 	      endTime: app.globalData.sellerShop.end_time,
 	      shop_state: app.globalData.sellerShop.shop_state,
-	      shop_state: app.globalData.sellerShop.shop_state,
 	      bool_o2o: app.globalData.authorInfo.bool_o2o,
+          shopAdminMemberId: app.globalData.sellerShop.member_id,
+          userId: app.globalData.authorInfo.uid
       })
       console.log('begininit')
 	    that.getTabBar().init()
@@ -210,10 +213,10 @@ Page({
 		  todayOrderNum: app.globalData.todayOrderNum,
 		  todayOrderTotal: app.globalData.todayOrderTotal,
 		  })
-          
+
 		  let i = 0;
 		  if(app.globalData.todayOrderNum>0||app.globalData.todayOrderTotal>0){
-			numDH()  
+			numDH()
 		  }
 		      function numDH() {
 				  clearTimeout()

+ 15 - 15
pages/store/index.wxml

@@ -63,9 +63,9 @@
 
   <wux-grids>
     <wux-grid  label="商品管理" bind:click="gridClick" data-name="product" >
-     
+
      <wux-icon type="ios-keypad" color="#11c1f3" slot="header" />
-          
+
     </wux-grid>
     <wux-grid  label="订单查询" data-name="orderquery"  bind:click="gridClick" >
     <wux-icon type="ios-search" color="#11c1f3"  slot="header" />
@@ -74,17 +74,17 @@
     <wux-icon type="ios-refresh" color="#11c1f3"  slot="header" />
     </wux-grid>
 
-    <wux-grid  label="结算管理" data-name="bill" bind:click="gridClick" >
-    <wux-icon type="ios-done-all" color="#11c1f3"  slot="header" />
-    </wux-grid>
+<!--    <wux-grid label="结算管理" data-name="bill" bind:click="gridClick" >-->
+<!--    <wux-icon type="ios-done-all" color="#11c1f3"  slot="header" />-->
+<!--    </wux-grid>-->
 
-    <wux-grid  label="资金提现" data-name="withdrawApply" bind:click="gridClick" >
-    <wux-icon type="ios-wallet" color="#11c1f3"  slot="header" />
-    </wux-grid>
+<!--    <wux-grid wx:if="{{shopAdminMemberId === userId}}"  label="资金提现" data-name="withdrawApply" bind:click="gridClick" >-->
+<!--    <wux-icon type="ios-wallet" color="#11c1f3"  slot="header" />-->
+<!--    </wux-grid>-->
 
-    <wux-grid  label="提现账户" data-name="withdrawAccount" bind:click="gridClick" >
-    <wux-icon type="ios-card" color="#11c1f3"  slot="header" />
-    </wux-grid>
+<!--    <wux-grid wx:if="{{shopAdminMemberId === userId}}"  label="提现账户" data-name="withdrawAccount" bind:click="gridClick" >-->
+<!--    <wux-icon type="ios-card" color="#11c1f3"  slot="header" />-->
+<!--    </wux-grid>-->
 
     <wux-grid  label="店铺设置" data-name="shopsetting" bind:click="gridClick" >
     <wux-icon type="ios-settings" color="#11c1f3"  slot="header" />
@@ -101,13 +101,13 @@
   </wux-grids>
   <view class="authorization" wx:if="{{changeShopShow}}">
     <wux-popup position="bottom" visible="{{ changeShopShow }}" bind:close="changeShopShowClose" closable>
-      <wux-radio-group value="{{ changeShopValue }}" title="切换登店铺" bind:change="onChangeShop">
+      <wux-radio-group value="{{ changeShopValue }}" title="切换登店铺" bind:change="onChangeShop">
         <scroll-view scroll-y style="height:50vh">
-        <wux-radio color="balanced" wx:for="{{shops}}" title="{{item.shop_name}}" value="{{item.shop_id}}" wx:key="{{item.shop_id}}" />
+        <wux-radio color="balanced" wx:for="{{shops}}" title="{{item.shop_name}}" value="{{item.shop_id}}" wx:key="index" />
         </scroll-view>
       </wux-radio-group>
     </wux-popup>
   </view>
 </block>
-  
-</van-skeleton>
+
+</van-skeleton>

+ 5 - 5
pages/welcome/index.js

@@ -30,7 +30,7 @@ Page({
           // }
           wx.setStorageSync('welcome', true)
           wx.setStorageSync('hasAuthorize', true)
-          Common.toAutoLogin()
+          Common.hasUserInfoAutoLogin()
         }
       },
     })
@@ -89,10 +89,10 @@ Page({
     const {
       errMsg
     } = e.detail
-    if (errMsg === 'getUserInfo:ok') {      
+    if (errMsg === 'getUserInfo:ok') {
       wx.setStorageSync('welcome', true)
       wx.setStorageSync('hasAuthorize', true)
-      Common.toAutoLogin()
+      Common.hasUserInfoAutoLogin()
     }
   },
   loadsuccess(e){
@@ -101,6 +101,6 @@ Page({
   loaderror(e){
     console.log('e',e)
   }
- 
 
-})
+
+})

+ 2 - 2
pages/welcome/index.wxml

@@ -7,10 +7,10 @@
 <view class="text-left margin">3、管理店铺订单,订单发货,处理售后等.</view>
 <view class="text-left margin">5、查询销售统计报表.</view>
 <view class="text-left margin">6、其他功能.</view>
-<view class="text-left margin" style="text-indent:2em"><text class="text-red">为识别用户身份,用户必须登陆后使用相关功能</text>.如果您已有账号,请使用您的商家账号进行登陆.没有账号,请点击注册按钮进行注册新账号.</view>
+<view class="text-left margin" style="text-indent:2em"><text class="text-red">为识别用户身份,用户必须登录后使用相关功能</text>.如果您已有账号,请使用您的商家账号进行登录.没有账号,请点击注册按钮进行注册新账号.</view>
 <view class="margin">
 
-<button class="bg-green margin text-l" bindgetuserinfo="getUserInfo" open-type="getUserInfo">授权登</button>
+<button class="bg-green margin text-l" bindgetuserinfo="getUserInfo" open-type="getUserInfo">授权登</button>
 
 </view>
 </view>

+ 216 - 216
project.config.json

@@ -1,221 +1,221 @@
 {
-  "description": "项目配置文件",
-  "packOptions": {
-    "ignore": [],
-    "include": []
-  },
-  "setting": {
-    "urlCheck": false,
-    "es6": true,
-    "enhance": true,
-    "postcss": true,
-    "preloadBackgroundData": false,
-    "minified": true,
-    "newFeature": true,
-    "coverView": true,
-    "nodeModules": true,
-    "autoAudits": false,
-    "showShadowRootInWxmlPanel": true,
-    "scopeDataCheck": false,
-    "uglifyFileName": false,
-    "checkInvalidKey": true,
-    "checkSiteMap": true,
-    "uploadWithSourceMap": true,
-    "compileHotReLoad": false,
-    "babelSetting": {
-      "ignore": [],
-      "disablePlugins": [],
-      "outputPath": ""
+    "description": "项目配置文件",
+    "packOptions": {
+        "ignore": [],
+        "include": []
     },
-    "useIsolateContext": true,
-    "useCompilerModule": false,
-    "userConfirmedUseCompilerModuleSwitch": false,
-    "condition": false
-  },
-  "compileType": "miniprogram",
-  "libVersion": "2.8.1",
-  "appid": "wxe95ca6dc3c58aed4",
-  "projectname": "B2b2cSeller",
-  "simulatorType": "wechat",
-  "simulatorPluginLibVersion": {},
-  "condition": {
-    "miniprogram": {
-      "list": [
-        {
-          "name": "pages/login/login",
-          "pathName": "pages/login/login",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "店铺",
-          "pathName": "pages/store/index",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "pages/index/index",
-          "pathName": "pages/index/index",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "产品",
-          "pathName": "pages/goods/goods-list",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "产品编辑",
-          "pathName": "pages/goods/edit",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "申请店铺",
-          "pathName": "pages/shop/shop-apply",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "我的店铺",
-          "pathName": "pages/shop/myshop-list",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "营业时间",
-          "pathName": "pages/store/businessSetting",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "店铺设置",
-          "pathName": "pages/shop/shop-edit",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "会员",
-          "pathName": "pages/member/index",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "截图",
-          "pathName": "pages/cropper/cropper",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "店铺",
-          "pathName": "pages/store/index",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "售后",
-          "pathName": "pages/aftersale/index",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "统计图表",
-          "pathName": "pages/statistic/index",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "没有店铺",
-          "pathName": "pages/noshop/index",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "pages/welcome/index",
-          "pathName": "pages/welcome/index",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "pages/store/index",
-          "pathName": "pages/store/index",
-          "query": "",
-          "scene": 1036,
-          "referrerInfo": {}
-        },
-        {
-          "name": "pages/welcome/index",
-          "pathName": "pages/welcome/index",
-          "query": "",
-          "scene": 1036,
-          "referrerInfo": {}
-        },
-        {
-          "name": "pages/goods/edit",
-          "pathName": "pages/goods/edit",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "pages/statistic/dateRange",
-          "pathName": "pages/statistic/dateRange",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "pages/statistic/index",
-          "pathName": "pages/statistic/index",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "pages/statistic/statisticNav",
-          "pathName": "pages/statistic/statisticNav",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "pages/bill/index",
-          "pathName": "pages/bill/index",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "pages/bill/billdetail",
-          "pathName": "pages/bill/billDetail",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "pages/fund/withdrawApply",
-          "pathName": "pages/fund/withdrawApply",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "pages/fund/withdrawAccount",
-          "pathName": "pages/fund/withdrawAccount",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "pages/fund/withdrawAccountEdit",
-          "pathName": "pages/fund/withdrawAccountEdit",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "pages/fund/addWithdrawApply",
-          "pathName": "pages/fund/addWithdrawApply",
-          "query": "",
-          "scene": null
+    "setting": {
+        "urlCheck": false,
+        "es6": false,
+        "enhance": true,
+        "postcss": true,
+        "preloadBackgroundData": false,
+        "minified": true,
+        "newFeature": true,
+        "coverView": true,
+        "nodeModules": true,
+        "autoAudits": false,
+        "showShadowRootInWxmlPanel": true,
+        "scopeDataCheck": false,
+        "uglifyFileName": false,
+        "checkInvalidKey": true,
+        "checkSiteMap": true,
+        "uploadWithSourceMap": true,
+        "compileHotReLoad": false,
+        "babelSetting": {
+            "ignore": [],
+            "disablePlugins": [],
+            "outputPath": ""
+        },
+        "useIsolateContext": true,
+        "useCompilerModule": false,
+        "userConfirmedUseCompilerModuleSwitch": false,
+        "condition": false
+    },
+    "compileType": "miniprogram",
+    "libVersion": "2.8.1",
+    "appid": "wxe95ca6dc3c58aed4",
+    "projectname": "B2b2cSeller",
+    "simulatorType": "wechat",
+    "simulatorPluginLibVersion": {},
+    "condition": {
+        "miniprogram": {
+            "list": [
+                {
+                    "name": "pages/login/login",
+                    "pathName": "pages/login/login",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "店铺",
+                    "pathName": "pages/store/index",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/index/index",
+                    "pathName": "pages/index/index",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "产品",
+                    "pathName": "pages/goods/goods-list",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "产品编辑",
+                    "pathName": "pages/goods/edit",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "申请店铺",
+                    "pathName": "pages/shop/shop-apply",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "我的店铺",
+                    "pathName": "pages/shop/myshop-list",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "营业时间",
+                    "pathName": "pages/store/businessSetting",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "店铺设置",
+                    "pathName": "pages/shop/shop-edit",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "会员",
+                    "pathName": "pages/member/index",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "截图",
+                    "pathName": "pages/cropper/cropper",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "店铺",
+                    "pathName": "pages/store/index",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "售后",
+                    "pathName": "pages/aftersale/index",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "统计图表",
+                    "pathName": "pages/statistic/index",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "没有店铺",
+                    "pathName": "pages/noshop/index",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/welcome/index",
+                    "pathName": "pages/welcome/index",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/store/index",
+                    "pathName": "pages/store/index",
+                    "query": "",
+                    "scene": 1036,
+                    "referrerInfo": {}
+                },
+                {
+                    "name": "pages/welcome/index",
+                    "pathName": "pages/welcome/index",
+                    "query": "",
+                    "scene": 1036,
+                    "referrerInfo": {}
+                },
+                {
+                    "name": "pages/goods/edit",
+                    "pathName": "pages/goods/edit",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/statistic/dateRange",
+                    "pathName": "pages/statistic/dateRange",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/statistic/index",
+                    "pathName": "pages/statistic/index",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/statistic/statisticNav",
+                    "pathName": "pages/statistic/statisticNav",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/bill/index",
+                    "pathName": "pages/bill/index",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/bill/billdetail",
+                    "pathName": "pages/bill/billDetail",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/fund/withdrawApply",
+                    "pathName": "pages/fund/withdrawApply",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/fund/withdrawAccount",
+                    "pathName": "pages/fund/withdrawAccount",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/fund/withdrawAccountEdit",
+                    "pathName": "pages/fund/withdrawAccountEdit",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/fund/addWithdrawApply",
+                    "pathName": "pages/fund/addWithdrawApply",
+                    "query": "",
+                    "scene": null
+                }
+            ]
         }
-      ]
+    },
+    "editorSetting": {
+        "tabIndent": "insertSpaces",
+        "tabSize": 4
     }
-  },
-  "editorSetting": {
-    "tabIndent": "insertSpaces",
-    "tabSize": 2
-  }
 }

+ 5 - 5
project.private.config.json

@@ -1,7 +1,7 @@
 {
-  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
-  "projectname": "B2b2cSeller",
-  "setting": {
-    "compileHotReLoad": true
-  }
+    "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+    "projectname": "B2b2cSeller",
+    "setting": {
+        "compileHotReLoad": true
+    }
 }

+ 10 - 12
utils/checkToken.js

@@ -5,24 +5,23 @@ const app=getApp()
 export  function checkToken(){
   return new Promise((resolve,reject)=>{
 	const authorInfo=app.globalData.authorInfo
-  
+
 	if(authorInfo==null||authorInfo==''){
-		//自动登尝试
+		//自动登尝试
 		wx.removeStorageSync('login_result')
 		console.log('checkTokenAutoLogin')
 		Common.toAutoLogin()
 		return
 	}
-	
+
     const access_token_timeout = authorInfo.access_token_timeout
 	const refresh_token_timeout=authorInfo.refresh_token_timeout
 		const now=Date.parse(new Date())/1000
-		console.log('test',!refresh_token_timeout||refresh_token_timeout<now)
-	if(!refresh_token_timeout||refresh_token_timeout<now){ 
-		//认为刷新token已经完全失效,必须重新登陆,跳转登陆界面,
+	if(!refresh_token_timeout||refresh_token_timeout<now){
+		//认为刷新token已经完全失效,必须重新登录,跳转登录界面,
 		 wx.removeStorageSync('authorInfo')
 		// wx.removeStorageSync('sellerUser')
-		 wx.removeStorageSync('sellerShop')	
+		 wx.removeStorageSync('sellerShop')
 		wx.removeStorageSync('login_result')
 		app.globalData.authorInfo={}
 		wx.redirectTo({
@@ -30,8 +29,7 @@ export  function checkToken(){
 		})
 		reject()
 		return
-	}	
-	console.log('timeout',access_token_timeout)
+	}
 	if (!access_token_timeout || access_token_timeout <=now) //access_token 失效 刷新token
 	{
 		 API_Passport.refreshToken({'refresh_token':authorInfo.refresh_token}).then(res=>{
@@ -44,11 +42,11 @@ export  function checkToken(){
 			console.log(err)
 			reject()
 		})
-	    
+
 	}
 	else{
 	    resolve()
 	}
-  
+
 })
-}
+}

+ 159 - 158
utils/common.js

@@ -1,179 +1,180 @@
 import * as API_Passport from '../api/passport.js'
 import * as API_Shop from '../api/shop.js'
 const app = getApp()
-/** 自动登 */
+/** 自动登 */
 
+export async function hasUserInfoAutoLogin() {
+    console.log('autologintest',app.globalData.authorInfo)
+    const authorInfo=app.globalData.authorInfo
+    if(Object.keys(authorInfo).length>0){
+        if(authorInfo.bool_o2o===1){
+            wx.switchTab({
+                url: '/pages/store/index',
+            })
+        }else{
+            wx.redirectTo({
+                url: '/pages/noshop/index',
+            })
+        }
+        return
+    }
 
-export async function toAutoLogin(){
-//尝试自动登陆之前判断有没有授权用户信息,没有授权用户信息直接跳回到欢迎页
-  const setting=await wxgetSetting()
-  if (!setting.authSetting['scope.userInfo']) {
-    wx.removeStorageSync('welcome')
-    wx.removeStorageSync('hasAuthorize')
-    wx.redirectTo({
-      url: '/pages/welcome/index',
-    })
-    return
-  }
-  console.log('autologintest',app.globalData.authorInfo)
-  const authorInfo=app.globalData.authorInfo
-  if(Object.keys(authorInfo).length>0){
-    if(authorInfo.bool_o2o===1){
-      wx.switchTab({
-        url: '/pages/store/index',
-      })
-    }else{
-      wx.redirectTo({
-        url: '/pages/noshop/index',
-      })
+    // 检测是否登录 如果已经登录 或者登录结果为账户未发现 则不再进行自动登录
+    if (wx.getStorageSync('login_result') === 'account_not_found') {
+        wx.redirectTo({
+            url: '/pages/login/login',
+        })
+        return
     }
-    return
-  }
-  
-
-  // 检测是否登录 如果已经登录 或者登录结果为账户未发现 则不再进行自动登录
-  if (wx.getStorageSync('login_result') === 'account_not_found') {
-    wx.redirectTo({
-      url: '/pages/login/login',
-    })
-    return
-  }
-
-
-  let final = {}
-  const code= await wxlogin()
-  const uuid =wx.getStorageSync('uuid')
-  const mp_type = 'miniprogramo2oseller'
-  const result=await API_Passport.autoLogin({
-    code,
-    uuid,
-    mini_program_type:mp_type
-  })
-  if(result.reson === 'account_not_found'){ //没有绑定账号 跳到登陆页面
-    wx.setStorageSync('login_result', result.reson)
-    wx.redirectTo({
-      url: '/pages/login/login',
-    })
-  }
-  if (result.reson === 'unionid_not_found') { // unionid_not_found 如果已经进行过用户授权但是没有获取到unionID
-    let {
-      encryptedData,
-      iv
-    } = await wxgetUserInfo({
-      withCredentials: true,
-      lang: 'zh_CN'
-    })
-    final = await API_Passport.accessUnionID({
-      code,
-      uuid,
-      encrypted_data: encryptedData,
-      iv
-    })
-    
-  }
-   
-  if(final.reson === 'account_not_found'){ //没有绑定账号 跳到登陆页面
-    wx.setStorageSync('login_result', result.reson)
-    wx.redirectTo({
-      url: '/pages/login/login',
+
+    let final = {}
+    const code= await wxlogin()
+    const uuid =wx.getStorageSync('uuid')
+    const mp_type = 'miniprogramo2oseller'
+    const result=await API_Passport.autoLogin({
+        code,
+        uuid,
+        mini_program_type:mp_type
     })
-  }
-const res=result.access_token ? result : final
-  const {
-    
-    access_token_timeout,
-    refresh_token_timeout,
-  
-  } = res
-
-  let now = Math.round(new Date() / 1000)
-        if (res.access_token && res.refresh_token && res.uid) {			  
-    app.globalData.authorInfo={...res,'refresh_token_timeout':now+refresh_token_timeout-500,'access_token_timeout':now+access_token_timeout-500}	
-        //登陆信息写入本地存储,删除登陆结果标记       
-          wx.removeStorageSync('login_result')
-          wx.setStorageSync('authorInfo', app.globalData.authorInfo)
-          //登陆成功 跳转到店铺首页
-          console.log('bool_o2o',app.globalData.authorInfo.bool_o2o)
-          if(app.globalData.authorInfo.bool_o2o===0){
+    if(result.reson === 'account_not_found'){ //没有绑定账号 跳到登录页面
+        wx.setStorageSync('login_result', result.reson)
+        wx.redirectTo({
+            url: '/pages/login/login',
+        })
+    }
+    if (result.reson === 'unionid_not_found') { // unionid_not_found 如果已经进行过用户授权但是没有获取到unionID
+        let {
+            encryptedData,
+            iv
+        } = await wxgetUserInfo({
+            withCredentials: true,
+            lang: 'zh_CN'
+        })
+        final = await API_Passport.accessUnionID({
+            code,
+            uuid,
+            encrypted_data: encryptedData,
+            iv
+        })
+
+    }
+
+    if(final.reson === 'account_not_found'){ //没有绑定账号 跳到登录页面
+        wx.setStorageSync('login_result', result.reson)
+        wx.redirectTo({
+            url: '/pages/login/login',
+        })
+    }
+    const res=result.access_token ? result : final
+    const {
+
+        access_token_timeout,
+        refresh_token_timeout,
+
+    } = res
+    //
+    let now = Math.round(new Date() / 1000)
+    if (res.access_token && res.refresh_token && res.uid) {
+        app.globalData.authorInfo={...res,'refresh_token_timeout':now+refresh_token_timeout-500,'access_token_timeout':now+access_token_timeout-500}
+        //登录信息写入本地存储,删除登录结果标记
+        wx.removeStorageSync('login_result')
+        wx.setStorageSync('authorInfo', app.globalData.authorInfo)
+        //登录成功 跳转到店铺首页
+        console.log('bool_o2o',app.globalData.authorInfo.bool_o2o)
+        if(app.globalData.authorInfo.bool_o2o===0){
             wx.redirectTo({
-              url: '/pages/noshop/index',
+                url: '/pages/noshop/index',
             })
-          }else{
+        }else{
             wx.switchTab({
-              url: '/pages/store/index',
+                url: '/pages/store/index',
             })
-          }
-          
         }
+
+    }
 }
 
-// 同步获取登陆code
+export async function toAutoLogin(){
+//尝试自动登录之前判断有没有授权用户信息,没有授权用户信息直接跳回到欢迎页
+    const setting=await wxgetSetting()
+    if (!setting.authSetting['scope.userInfo']) {
+        wx.removeStorageSync('welcome')
+        wx.removeStorageSync('hasAuthorize')
+        wx.redirectTo({
+            url: '/pages/welcome/index',
+        })
+        return
+    }
+    await hasUserInfoAutoLogin()
+}
+
+// 同步获取登录code
 function wxlogin(){
-  return new Promise((resolve,reject)=>{
-     wx.login({
-       complete: (res) => {resolve(res.code)}
-     })
-   })
- }
- // 同步获取用户信息
- function wxgetUserInfo(option){
-   return new Promise((resolve,reject)=>{
-     wx.getUserInfo({
-       ...option,
-       complete: (res) => {
-         console.log(res)
-         resolve(res)
-       }
-     })
-   })
- }
- //同步获取用授权设置
- function wxgetSetting(){
-   return new Promise((resolve,reject)=>{
-    wx.getSetting({
-      complete: (res) => {
-        resolve(res)
-      }
+    return new Promise((resolve,reject)=>{
+        wx.login({
+            complete: (res) => {resolve(res.code)}
+        })
+    })
+}
+// 同步获取用户信息
+function wxgetUserInfo(option){
+    return new Promise((resolve,reject)=>{
+        wx.getUserInfo({
+            ...option,
+            complete: (res) => {
+                console.log(res)
+                resolve(res)
+            }
+        })
+    })
+}
+//同步获取用授权设置
+function wxgetSetting(){
+    return new Promise((resolve,reject)=>{
+        wx.getSetting({
+            complete: (res) => {
+                resolve(res)
+            }
+        })
     })
-   })
- }
+}
 
 
 
 /** 获取当前店铺信息 */
 export function getCurrentShopData(){
-  return new Promise((resolve, reject)=>{
-	// const authorInfo=app.globalData.authorInfo
-	// if(authorInfo===null||authorInfo===''){
-	// 	wx.redirectTo({
-	// 		url:'/pages/login/login'
-	// 	})
-	// 	return
-	// }
-	
-    // if (authorInfo.bool_o2o===1){
-      Promise.all([
-        /**当前店铺信息 */
-        API_Shop.getShopData(),
-        /** 店铺订单统计信息 */
-        API_Shop.getDashboardData()
-      ])
-    .then(res => {
-      app.globalData.sellerShop = res[0]
-      wx.setStorageSync('sellerShop', res[0])
-      app.globalData.orderNum = res[1].wait_ship_order_num
-      app.globalData.todayOrderNum = res[1].today_order_num
-      app.globalData.todayOrderTotal=res[1].today_order_total
-      resolve(res[0])
-    }).catch(err=>{
-		reject(err)
-	})
-  //   }else{
-  //     wx.redirectTo({
-	// 	  url:'/pages/noshop/index'
-	//   })
-  //   }
-	
-  })
-  
-}
+    return new Promise((resolve, reject)=>{
+        // const authorInfo=app.globalData.authorInfo
+        // if(authorInfo===null||authorInfo===''){
+        // 	wx.redirectTo({
+        // 		url:'/pages/login/login'
+        // 	})
+        // 	return
+        // }
+
+        // if (authorInfo.bool_o2o===1){
+        Promise.all([
+            /**当前店铺信息 */
+            API_Shop.getShopData(),
+            /** 店铺订单统计信息 */
+            API_Shop.getDashboardData()
+        ])
+            .then(res => {
+                app.globalData.sellerShop = res[0]
+                wx.setStorageSync('sellerShop', res[0])
+                app.globalData.orderNum = res[1].wait_ship_order_num
+                app.globalData.todayOrderNum = res[1].today_order_num
+                app.globalData.todayOrderTotal=res[1].today_order_total
+                resolve(res[0])
+            }).catch(err=>{
+            reject(err)
+        })
+        //   }else{
+        //     wx.redirectTo({
+        // 	  url:'/pages/noshop/index'
+        //   })
+        //   }
+
+    })
+
+}

+ 2 - 2
utils/request.js

@@ -61,7 +61,7 @@ function server(options){
       success: function (res) {
         if(res.statusCode===403){
           console.log('statusCode',res.statusCode)
-         //退出登,跳转到授权页面
+         //退出登,跳转到授权页面
           // reject({ error: '授权已过期', code: 403})
           wx.removeStorageSync('authorInfo')
           wx.removeStorageSync('sellerShop')
@@ -112,4 +112,4 @@ export default function request(options){
 	})
   })
   
-}
+}

+ 3 - 3
wux/cascader/index.wxml

@@ -3,17 +3,17 @@
 	    <view class="{{ classes.hd }}">
 	    	<view class="{{ classes.title }}" wx:if="{{ title }}">{{ title }}</view>
 	    	<view class="{{ classes.menus }}" wx:if="{{ activeOptions.length }}">
-	    		<block wx:for="{{ activeOptions }}" wx:key="">
+	    		<block wx:for="{{ activeOptions }}" wx:key="index">
 	    			<view class="{{ classes.menu }} {{ activeIndex === index ? prefixCls + '__menu--active' : '' }}" data-menu-index="{{ index }}" bindtap="onMenuClick">{{ item[fieldNames['label']] }}</view>
 	    		</block>
 	    	</view>
 	    </view>
 	    <view class="{{ classes.bd }}" style="{{ bodyStyle }}">
-	    	<block wx:for="{{ showOptions }}" wx:for-item="option" wx:for-index="optionIndex" wx:key="">
+	    	<block wx:for="{{ showOptions }}" wx:for-item="option" wx:for-index="optionIndex" wx:key="optionIndex">
 	    		<view class="{{ classes.inner }}">
 		    		<scroll-view scroll-y class="wux-scroll-view-class {{ classes.scrollView }}">
 			    		<view class="{{ classes.option }}">
-			    			<block wx:for="{{ option }}" wx:key="">
+			    			<block wx:for="{{ option }}" wx:for-index="idx" wx:key="idx">
 					    		<view
 						    		class="{{ classes.item }} {{ activeValue[optionIndex] === item[fieldNames['value']] ? prefixCls + '__item--active' : '' }} {{ item.disabled ? prefixCls + '__item--disabled' : '' }}"
 						    		data-option-index="{{ optionIndex }}"

+ 1 - 1
wux/dialog/index.wxml

@@ -25,7 +25,7 @@
         </view>
     </view>
     <view slot="footer" class="{{ classes.buttons }}">
-        <block wx:for="{{ buttons }}" wx:for-item="button" wx:key="">
+        <block wx:for="{{ buttons }}" wx:for-item="button" wx:key="button">
             <button
                 class="{{ classes.button[index].wrap }}"
                 disabled="{{ button.disabled }}"

+ 1 - 1
wux/radio-group/index.wxml

@@ -1,5 +1,5 @@
 <wux-cell-group id="wux-cell-group" wux-class="{{ prefixCls }}" prefixCls="{{ cellGroupPrefixCls }}" title="{{ title }}" label="{{ label }}">
-    <block wx:for="{{ common.getOptions(options) }}" wx:for-item="option" wx:key="" wx:if="{{ options.length > 0 }}">
+    <block wx:for="{{ common.getOptions(options) }}" wx:for-item="option" wx:key="index" wx:if="{{ options.length > 0 }}">
         <wux-radio
             prefixCls="{{ option.prefixCls || 'wux-radio' }}"
             cellPrefixCls="{{ option.cellPrefixCls || 'wux-cell' }}"

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
wux/upload/index.wxss