From d9d162e4bfc03ff2828ec79cf221c2e75d8a19dd Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Fri, 2 Apr 2021 17:03:30 +0800 Subject: [PATCH] 我的小店 --- packageA/pages/distribution/shop/shop.js | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- packageA/pages/distribution/shop/shop.wxml | 280 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------- packageA/pages/distribution/shop/shop.wxss | 225 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 582 insertions(+), 31 deletions(-) diff --git a/packageA/pages/distribution/shop/shop.js b/packageA/pages/distribution/shop/shop.js index da4a1d3..0853527 100644 --- a/packageA/pages/distribution/shop/shop.js +++ b/packageA/pages/distribution/shop/shop.js @@ -1,7 +1,9 @@ // packageA//pages/distribution/commision/commision.js const app = getApp(); let self = null; -var os = app.globalData.setting; +var os = app.globalData.setting, + ut= require("../../../../utils/util.js"); + Page({ @@ -14,6 +16,7 @@ Page({ isSort: false,//控制排序开关状态,true开启排序 isDescending: false, //isDescending降序,ascending升序 imghost: '', + url: os.imghost, tabArr: ['最新','销量','评论','价格'], currentTabIndex: 0, @@ -24,6 +27,12 @@ Page({ isLoading: false, // 检测是否已经发送请求,防止重复发送请求 noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 pageNum: 1, // 当前页数 + + rank_switch: false, + card_field: "", + card_name: "", + max_card_field: "", + card_list: null }, /** @@ -34,7 +43,7 @@ Page({ app.isLogin().then(function(data) {//进入页面前已经授权登录成功 self.setData({ userInfo: data, - }); + }); }); //从别人的分享的跳转过来 @@ -177,7 +186,58 @@ Page({ }; }); } - + var th=this; + //更新一下会员的信息 + if(getApp().globalData.user_id) { + if(!getApp().globalData.userInfo['is_distribut']){ + th.setData({ishidden_comise:1}) + } + getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id, { + isShowLoading:false, + success: function (e) { + getApp().globalData.userInfo = e.data.data; + getApp().getConfig2(function (e) { + var swithc_list = e.switch_list; + var sw_arr = JSON.parse(swithc_list); + //---如果后台有开等级卡的开关--- + if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { + th.setData({ + rank_switch: true + }); + //---回调卡的列表--- + th.getPlusCardType(function (ob) { + th.setData({ + card_list: ob.card_list + }); + var ti = setInterval(function () { + var user = getApp().globalData.userInfo; + if (!user) return false; + clearInterval(ti); + if (user.card_field && user['card_expiredate']) { + var str = user['card_expiredate'].replace(/-/g, '/'); + var end = new Date(str); + end = Date.parse(end) / 1000; + var now = ut.gettimestamp(); + //--- 判断是等级会员,且在有效期范围内 --- + if (user.card_field && now < end) { + var card_name = ob.name_map.get(user.card_field); + if (card_name.length > 4) card_name = card_name.substring(0, 8); + th.setData({ + card_field: user.card_field, + card_name: card_name, + card_list: ob.card_list + }); + } + } + }, 500) + }) + } + }) + } + }) + } + + }, /** @@ -527,4 +587,46 @@ Page({ console.log(url); app.goto(url); }, + + //--- 获取卡类列表 --- + getPlusCardType: function (func) { + var storid = os.stoid; + var th = this; + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, + {}).then(res => { + + if(res.data.code!=0 || !res.data.data){ + var ob = { + "card_list": [], + "name_map": "" + }; + func(ob); + return false; + } + + var plusCard = res.data.data; + var arr = [1219, 2089, 3031]; + var new_arr = new Array(); + var card_name_map = new Map(); + + var user = getApp().globalData.userInfo; + if(plusCard) { + for (var i = 0; i < plusCard.length; i++) { + if ((!user || user.card_field == null || user.card_field == "") && (plusCard[i].IsStopBuy == true)) { + continue; + } + var name = "card" + plusCard[i].CorrPrice.toLowerCase(); + card_name_map.set(name, plusCard[i].CardName); + new_arr.push(plusCard[i]); + + } + } + var ob = { + "card_list": new_arr, + "name_map": card_name_map + }; + func(ob); + }) + }, + }) \ No newline at end of file diff --git a/packageA/pages/distribution/shop/shop.wxml b/packageA/pages/distribution/shop/shop.wxml index 229b51e..35cfd66 100644 --- a/packageA/pages/distribution/shop/shop.wxml +++ b/packageA/pages/distribution/shop/shop.wxml @@ -1,4 +1,5 @@ + @@ -69,16 +70,136 @@ {{item.goods_name}} - - - 1.00 - 6.00 - - - 0.90VIP超级会员 - - 分成金额:1.00 - + + + + + {{item.prom_integral}}积分 + + + + + + {{item.prom_price}} + + + + + + + {{item.market_price}} + + + + + + + + + + + + + + + {{filter.toFix(item[card_field],2)}} + + + {{card_name}} + + + + + + + + {{item.market_price}} + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + + + {{item.market_price}} + + + + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + {{item.market_price}} + + + + + + + {{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}} + + + {{g_filter.get_card_price(item,card_list,1)}} + + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + + + {{item.market_price}} + + + + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + + + {{item.market_price}} + + + + + + + + @@ -91,18 +212,133 @@ {{item.goods_name}} - - - - 1.00 - 6.00 - - - 0.90VIP超级会员 - - 分成金额:1.00 - - + + + + {{item.prom_integral}}积分 + + + + + + {{item.prom_price}} + + + + + + + {{item.market_price}} + + + + + + + + + + + + + + + {{filter.toFix(item[card_field],2)}} + + + {{card_name}} + + + + + + + + {{item.market_price}} + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + + + {{item.market_price}} + + + + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + {{item.market_price}} + + + + + + + {{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}} + + + {{g_filter.get_card_price(item,card_list,1)}} + + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + + + {{item.market_price}} + + + + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + + + {{item.market_price}} + + + + + + 分成金额:1.00 diff --git a/packageA/pages/distribution/shop/shop.wxss b/packageA/pages/distribution/shop/shop.wxss index c9b3f78..b13f3f7 100644 --- a/packageA/pages/distribution/shop/shop.wxss +++ b/packageA/pages/distribution/shop/shop.wxss @@ -104,12 +104,6 @@ page { /* word-break: break-all; word-wrap: break-word; */ } - -.money::before { - content: '¥'; - font-size: 22rpx; -} - .md { position: relative; } @@ -391,6 +385,225 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked::before { } +.collects { + margin-top: 40rpx; + margin-bottom: 40rpx; +} + +.ai-center{ + align-items: center; +} + +.ib { + display: inline-block; +} + +.fs20 { + font-size: 20rpx; +} + +.fs22 { + font-size: 22rpx; +} + +.fs24 { + font-size: 24rpx; +} + +.fs26 { + font-size: 26rpx; +} + +.fs28 { + font-size: 28rpx; +} + +.fs35 { + font-size: 35rpx; position: relative;top:5rpx +} + +.flex-center { + display: flex; + justify-content: center; + align-items: center; +} + +.ellipsis-1 { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +/* .ellipsis-1x { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; +} */ + +.xc-wc { + color: #d60021; +} + +.xc-ash { + color: #b9b9b9; +} + +.choice_box .choice_list .choice_footer .price { + color: #f23030; + height: 10px; +} + +.flex { + display: flex; +} + +.ellipsis-2 { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; +} + +.goods_name { + height: 62rpx; + margin-top: 6rpx; + line-height: 30rpx; +} + +.hang { + width: 100%; + margin: auto; + padding-left: 21rpx; +} + +.hang .collect { + width: 347rpx; + height: 520rpx; + border-radius: 25rpx; + border: 1rpx solid rgb(214, 214, 214); + overflow: hidden; + margin-right: 14rpx; + margin-bottom: 5rpx; +} + +.collect .bottom { + padding: 0rpx 20rpx; +} + +.collect .sp { + width: 100%; + height: 326rpx; +} + +.collect .money { + margin-top: 28rpx; + margin-bottom: 8rpx; + line-height: 28rpx; + align-items: baseline; +} + +.collect .money view { + line-height: 28rpx; +} + +.collect .money .flex { + font-weight: bold; +} + +.collect .money .flex .fs24 { + padding-top: 5rpx; +} + +.collect .Discount { + width: 156rpx; + height: 28rpx; + border-radius: 20rpx; + background-color: rgb(56, 56, 56); + font-size: 18rpx; + color: rgb(255, 255, 255); +} + +.collect .Discount image { + height: 18rpx; + width: 18rpx; + line-height: 28rpx; + margin-right: 3rpx; +} + +.collect.ml20 { + margin-left: 13rpx; +} + +.fs24.dollar { + padding: 0rpx; +} + +.money .price { + margin-left: 12rpx; + text-decoration: line-through; + line-height: 23rpx; +} + +.province { + line-height: 26rpx; +} + +.nothing { + height: 75rpx; + width: 100%; +} + +.nothing .no_content { + margin: 0rpx 11rpx; + color: rgb(138, 138, 138); +} + +.nothing .Foil { + width: 80rpx; + height: 2rpx; + background-color: rgb(138, 138, 138); +} + +.line_th { + text-decoration: line-through; +} + +.card_bg { + box-sizing: border-box; + padding: 2rpx 10rpx; + height: 28rpx; + border-radius: 26rpx; + font-size: 18rpx; + line-height: 28rpx; + max-width: 210rpx; + background: #333; + color: #fff; + margin-left: 8rpx; + display: flex; + align-items: center; + position: relative; + top: -4rpx; +} + +.card_bg image { + width: 19rpx; + height: 19rpx; + margin-right: 8rpx; +} + +/* .card_bg .card_name { + max-width: 76rpx; + width: auto; + overflow: hidden; + white-space: nowrap; +} */ + + + + -- libgit2 0.21.4