소스 검색

渠道添加and 我的信息

wangyong 6 년 전
부모
커밋
36f8df7e62

+ 2 - 1
app.json

@@ -88,7 +88,8 @@
     "components/data-none/data-none",
     "components/data-none/data-none",
     "components/divider/divider",
     "components/divider/divider",
     "pages/login/login",
     "pages/login/login",
-    "pages/orderCanvas/orderCanavs"
+    "pages/orderCanvas/orderCanavs",
+    "pages/channelInfor/channelInfor"
   ],
   ],
   "subpackages": [
   "subpackages": [
     {
     {

+ 7 - 4
pages/car/index.js

@@ -77,12 +77,15 @@ Page({
     })
     })
     
     
     if (un_id != undefined && un_id != '' && un_id != null){
     if (un_id != undefined && un_id != '' && un_id != null){
-
+      let data = {
+        user_id: un_id
+      }
+      if (wx.getStorageSync('channelIdObj').channelAccountId){
+        data.channel_account_id = wx.getStorageSync('channelIdObj').channelAccountId
+      }
       wx.request({
       wx.request({
         url: host + "shoppingcartapi/shoppingcartview",
         url: host + "shoppingcartapi/shoppingcartview",
-        data: {
-          user_id: un_id
-        },
+        data: data,
         method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
         method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
         header: {
         header: {
           'Accept': 'application/json'
           'Accept': 'application/json'

+ 83 - 0
pages/channelInfor/channelInfor.js

@@ -0,0 +1,83 @@
+// pages/channelInfor/channelInfor.js
+var app = getApp();
+let host = app.globalData.servsers; // 请求的url
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    channelObj:{}
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.getChannelInfo(this)
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  },
+  getChannelInfo(that){
+    wx.request({
+      url: host + '/getMyChannelInfo',
+      method:'get',
+      data:{
+        channelAccountId: wx.getStorageSync('channelIdObj').channelAccountId
+      },
+      success(res){
+        console.log(res)
+        that.setData({
+          channelObj:res.data
+        })
+      }
+    })
+  }
+})

+ 3 - 0
pages/channelInfor/channelInfor.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 29 - 0
pages/channelInfor/channelInfor.wxml

@@ -0,0 +1,29 @@
+
+<view>
+  <view class='channel-box'>
+    <view class='channel-list f-box'>
+      <view class='channel-label'>联系人</view>
+      <view class='channel-value f-item'>{{channelObj.channel.channelName}}</view>
+    </view>
+    <view class='channel-list f-box'>
+      <view class='channel-label'>电话</view>
+      <view class='channel-value f-item'>{{channelObj.channel.channelTelphone}}</view>
+    </view>
+    <view class='channel-list f-box'>
+      <view class='channel-label'>邮箱</view>
+      <view class='channel-value f-item'>{{channelObj.channel.channelEmail}}</view>
+    </view>
+    <view class='channel-list f-box'>
+      <view class='channel-label'>三证合一号码</view>
+      <view class='channel-value f-item'>{{channelObj.channel.channelBankNo}}</view>
+    </view>
+    <view class='channel-list f-box'>
+      <view class='channel-label '>开票信息</view>
+      <view class='channel-value f-item'>{{channelObj.channel.channelInvoiceInfo}}</view>
+    </view>
+    <view class='channel-list f-box'>
+      <view class='channel-label '>账户信息</view>
+      <view class='channel-value f-item'>{{channelObj.channelAccount.loginName}}</view>
+    </view>
+  </view>
+</view>

+ 12 - 0
pages/channelInfor/channelInfor.wxss

@@ -0,0 +1,12 @@
+/* pages/channelInfor/channelInfor.wxss */
+page{
+  background:#fff;
+}
+.channel-list{
+  line-height:88rpx;
+  margin:0 26rpx;
+  border-bottom:2rpx solid #e0e0e0;
+}
+.channel-value{
+  text-align: right
+}

+ 2 - 2
pages/index/index.js

@@ -576,11 +576,11 @@ Page({
     })
     })
   },
   },
   navTap(e){
   navTap(e){
-    console.log(e);
+    // console.log(e);
     let item = e.currentTarget.dataset.item;
     let item = e.currentTarget.dataset.item;
     if (item.type == 1 && !wx.getStorageSync('channelIdObj')) { // 表示是优质的杯,并且还没有登录过渠道
     if (item.type == 1 && !wx.getStorageSync('channelIdObj')) { // 表示是优质的杯,并且还没有登录过渠道
       wx.navigateTo({
       wx.navigateTo({
-        url: '/pages/login/login',
+        url: '/pages/login/login?url=/pages/kindSecondList/kindSecondList',
       })
       })
     } else {
     } else {
       wx.navigateTo({
       wx.navigateTo({

+ 2 - 1
pages/kind/index.wxml

@@ -81,7 +81,7 @@
       <!-- goodsList -->
       <!-- goodsList -->
       <view class='goods-box '>
       <view class='goods-box '>
       <!-- banner -->
       <!-- banner -->
-        <view class='goods-ban'>
+        <view class='goods-ban' wx:if="{{classifyNavList[banIndex].classify_logo}}">
           <image src='{{classifyNavList[banIndex].classify_logo}}' mode='scaleToFill'></image>
           <image src='{{classifyNavList[banIndex].classify_logo}}' mode='scaleToFill'></image>
         </view>
         </view>
         <view class='f-box f-flex-wrap f-justify-content-between'>
         <view class='f-box f-flex-wrap f-justify-content-between'>
@@ -90,6 +90,7 @@
             <!-- <view class='goods-summary'></view> -->
             <!-- <view class='goods-summary'></view> -->
             <view class='goods-title'>{{item.commodity_name}}</view>
             <view class='goods-title'>{{item.commodity_name}}</view>
             <view class='goods-price'>¥{{item.commodity_sale}}</view>
             <view class='goods-price'>¥{{item.commodity_sale}}</view>
+            <view class='mar-t10'>渠道价:<text class='c-theme'>¥{{item.commodity_channel_price}}</text></view>
           </view>
           </view>
         </view>
         </view>
         
         

+ 3 - 0
pages/kind/index.wxss

@@ -140,6 +140,9 @@ width:40rpx;
 }
 }
 .goods-title{
 .goods-title{
   margin:10rpx 0;
   margin:10rpx 0;
+  overflow: hidden;/*超出部分隐藏*/
+  white-space: nowrap;/*不换行*/
+  text-overflow:ellipsis;/*超出部分文字以...显示*/
 }
 }
 .goods-price{
 .goods-price{
   color:#e60012;
   color:#e60012;

+ 3 - 0
pages/kindSecondList/kindSecondList.js

@@ -113,6 +113,9 @@ Page({
     if (that.data.forid) {
     if (that.data.forid) {
       data.commodity_levelTwo = that.data.forid
       data.commodity_levelTwo = that.data.forid
     }
     }
+    // if (that.data.channelIdObj.channelAccountId) {
+    //   data.commodity_levelTwo = that.data.forid
+    // }
     wx.request({
     wx.request({
       url: host + "commodityapi/commoditviewfoeeverybody",
       url: host + "commodityapi/commoditviewfoeeverybody",
       data: data,
       data: data,

+ 6 - 3
pages/login/login.js

@@ -9,13 +9,16 @@ Page({
   data: {
   data: {
     account:null,
     account:null,
     pwd:null,
     pwd:null,
+    url:null
   },
   },
 
 
   /**
   /**
    * 生命周期函数--监听页面加载
    * 生命周期函数--监听页面加载
    */
    */
   onLoad: function (options) {
   onLoad: function (options) {
-
+    this.setData({
+      url:options.url
+    })
   },
   },
 
 
   /**
   /**
@@ -98,8 +101,8 @@ Page({
           })
           })
         } else {
         } else {
           wx.setStorageSync('channelIdObj', res.data)
           wx.setStorageSync('channelIdObj', res.data)
-          wx.navigateTo({
-            url: '/pages/kindSecondList/kindSecondList',
+          wx.redirectTo({
+            url: that.data.url,
           })
           })
         }
         }
       }
       }

+ 13 - 1
pages/mine/mine.js

@@ -127,7 +127,7 @@ Page({
       userInfo: userInfo,
       userInfo: userInfo,
       userId: un_id,
       userId: un_id,
       userRole: userRole,
       userRole: userRole,
-      channIdState: wx.getStorageSync('channelIdObj') ? true : false
+      channIdState: wx.getStorageSync('channelIdObj').channelAccountId ? true : false
     })
     })
     console.log(that.data.channIdState)
     console.log(that.data.channIdState)
   },
   },
@@ -175,6 +175,18 @@ Page({
     this.setData({
     this.setData({
       channIdState:false
       channIdState:false
     })
     })
+  },
+  channelInfo(){
+    if (wx.getStorageSync('channelIdObj').channelAccountId){
+      wx.navigateTo({
+        url: '/pages/channelInfor/channelInfor',
+      })
+    } else {
+      wx.navigateTo({
+        url: '/pages/login/login?url=/pages/channelInfor/channelInfor',
+      })
+    }
+    
   }
   }
 
 
 })
 })

+ 10 - 0
pages/mine/mine.wxml

@@ -52,6 +52,16 @@
     </view>
     </view>
   </view>
   </view>
 
 
+    <!-- 我的定制订单 -->
+ <view class='user-order'>
+    <view class="pad-t20 pad-b20 mar-r20 f-s30 mar-l20 order-title f-box f-align-items-center" bindtap='channelInfo'>
+      <view class='f-item'>我的信息</view>
+      <view class='f-s28 f-box f-align-items-center'>
+        <icon class='{{madeList.icon}} iconfont'></icon>
+      </view>
+    </view>
+  </view>
+
   <!-- 退出渠道 -->
   <!-- 退出渠道 -->
   <view class='channe-box' wx:if="{{channIdState}}" bindtap='outChann'>
   <view class='channe-box' wx:if="{{channIdState}}" bindtap='outChann'>
     <button class='f-s30'>退出渠道</button>
     <button class='f-s30'>退出渠道</button>

+ 10 - 6
pages/orderList/orderList.js

@@ -109,15 +109,19 @@ Page({
     this.getOrderList(this)
     this.getOrderList(this)
   },
   },
   getOrderList(that) {
   getOrderList(that) {
+    let data = {
+      user_id: app.globalData.user_id,
+      status: that.data.isSelect,
+      offset: that.data.page,
+      limit: that.data.limit
+    }
+    if (wx.getStorageSync('channelIdObj').channelAccountId){
+      data.channel_account_id = wx.getStorageSync('channelIdObj').channelAccountId;
+    }
     wx.request({
     wx.request({
       url: host + '/orderapi/orderlist',
       url: host + '/orderapi/orderlist',
       method: 'get',
       method: 'get',
-      data: {
-        user_id: app.globalData.user_id,
-        status: that.data.isSelect,
-        offset:that.data.page,
-        limit:that.data.limit
-      },
+      data:data,
       success(res) {
       success(res) {
         console.log(res, "orderItem")
         console.log(res, "orderItem")
         let data = res.data,goodsList = that.data.goodsList;
         let data = res.data,goodsList = that.data.goodsList;

+ 10 - 5
pages/searchList/searchList.js

@@ -44,13 +44,18 @@ Page({
   },
   },
   getSearchList(that){
   getSearchList(that){
     if (that.data.commodity_name){
     if (that.data.commodity_name){
+      let data = {
+        commodity_name: that.data.commodity_name,
+        offset: that.data.page,
+        limit: that.data.limit,
+      }
+      //添加渠道id
+      if (wx.getStorageSync('channelIdObj').channelId){
+        data.channelId = wx.getStorageSync('channelIdObj').channelId
+      }
       wx.request({
       wx.request({
         url: host + "commodityapi/findAllforseach",
         url: host + "commodityapi/findAllforseach",
-        data: {
-          commodity_name: that.data.commodity_name,
-          offset: that.data.page,
-          limit: that.data.limit,
-        },
+        data: data,
         method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
         method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
         header: {
         header: {
           'Accept': 'application/json'
           'Accept': 'application/json'

+ 1 - 0
pages/searchList/searchList.wxml

@@ -22,6 +22,7 @@
             <!-- <view class='goods-summary'></view> -->
             <!-- <view class='goods-summary'></view> -->
             <view class='goods-title'>{{item.commodity_name}}</view>
             <view class='goods-title'>{{item.commodity_name}}</view>
             <view class='c-theme'>¥{{item.commodity_sale}}</view>
             <view class='c-theme'>¥{{item.commodity_sale}}</view>
+            <view class='mar-t10'>渠道价:<text class='c-theme'>¥{{item.commodity_channel_price}}</text></view>
           </view>
           </view>
         </view>
         </view>
       </view>
       </view>

+ 8 - 1
project.config.json

@@ -28,7 +28,7 @@
 			"list": []
 			"list": []
 		},
 		},
 		"miniprogram": {
 		"miniprogram": {
-			"current": 24,
+			"current": 25,
 			"list": [
 			"list": [
 				{
 				{
 					"id": 0,
 					"id": 0,
@@ -199,6 +199,13 @@
 					"pathName": "pages/orderCanvas/orderCanavs",
 					"pathName": "pages/orderCanvas/orderCanavs",
 					"query": "",
 					"query": "",
 					"scene": null
 					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "我的信息",
+					"pathName": "pages/channelInfor/channelInfor",
+					"query": "",
+					"scene": null
 				}
 				}
 			]
 			]
 		}
 		}