Commit 56fac99aad930ac22f1c0a55c0b03d4da6b578f1

Authored by 后端研发-苏明海
2 parents 9b3a4709 878718aa

Merge branch 'dev' into 'test'

Dev

See merge request !421
... ... @@ -35,30 +35,32 @@ App({
35 35 "selectedColor": "#f23030",//文字被选择后color
36 36 "borderStyle": "white",//
37 37 "backgroundColor": "#ffffff",//背景color
  38 + "iscustom":'',
  39 + "url":"",
38 40 "list": [
39 41 {
40 42 "weappurl": "/pages/index/index/index",
41 43 "nav_name": "首页",
42   - "src": "/images/bar/index.png",
43   - "src_sele": "/images/bar/index_on.png"
  44 + "src": "/miniapp/images/bar/index.png",
  45 + "src_sele": "/miniapp/images/bar/index_on.png"
44 46 },
45 47 {
46 48 "weappurl": "/pages/goods/categoryList/categoryList",
47 49 "nav_name": "分类",
48   - "src": "/images/bar/fl.png",
49   - "src_sele": "/images/bar/fl_on.png"
  50 + "src": "/miniapp/images/bar/fl.png",
  51 + "src_sele": "/miniapp/images/bar/fl_on.png"
50 52 },
51 53 {
52 54 "weappurl": "/pages/cart/cart/cart",
53 55 "nav_name": "购物车",
54   - "src": "/images/bar/car.png",
55   - "src_sele": "/images/bar/car_on.png"
  56 + "src": "/miniapp/images/bar/car.png",
  57 + "src_sele": "/miniapp/images/bar/car_on.png"
56 58 },
57 59 {
58 60 "weappurl": "/pages/user/index/index",
59 61 "nav_name": "我的",
60   - "src": "/images/bar/user.png",
61   - "src_sele": "/images/bar/user_on.png"
  62 + "src": "/miniapp/images/bar/user.png",
  63 + "src_sele": "/miniapp/images/bar/user_on.png"
62 64 }
63 65 ]
64 66 },
... ...
app.json
... ... @@ -83,15 +83,15 @@
83 83 "pages/user/assistance/assistance_success",
84 84 "pages/user/assistance/assistance",
85 85 "pages/video/index",
86   - "pages/template/index"
  86 + "pages/template/index",
  87 + "pages/store/index"
87 88  
88 89 ],
89 90  
90 91 "subPackages": [{
91 92 "root": "packageA/",
92 93 "name":"pack1",
93   - "pages": [
94   - "pages/store/index",
  94 + "pages": [
95 95 "pages/prom_list/prom_list",
96 96 "pages/quan_list/quan_list",
97 97 "pages/quan_pro/quan_pro"
... ... @@ -111,7 +111,38 @@
111 111 "backgroundColor": "#ffffff",
112 112 "enablePullDownRefresh": true
113 113 },
114   -
  114 + "tabBar": {
  115 + "color": "#6e6d6b",
  116 + "selectedColor": "#f23030",
  117 + "borderStyle": "white",
  118 + "backgroundColor": "#ffffff",
  119 + "list": [
  120 + {
  121 + "pagePath": "pages/index/index/index",
  122 + "text": "首页",
  123 + "iconPath": "packageA/images/bar/index.png",
  124 + "selectedIconPath": "packageA/images/bar/index_on.png"
  125 + },
  126 + {
  127 + "pagePath": "pages/goods/categoryList/categoryList",
  128 + "text": "分类",
  129 + "iconPath": "packageA/images/bar/fl.png",
  130 + "selectedIconPath": "packageA/images/bar/fl_on.png"
  131 + },
  132 + {
  133 + "pagePath": "pages/cart/cart/cart",
  134 + "text": "购物车",
  135 + "iconPath": "packageA/images/bar/car.png",
  136 + "selectedIconPath": "packageA/images/bar/car_on.png"
  137 + },
  138 + {
  139 + "pagePath": "pages/user/index/index",
  140 + "text": "我的",
  141 + "iconPath": "packageA/images/bar/user.png",
  142 + "selectedIconPath": "packageA/images/bar/user_on.png"
  143 + }
  144 + ]
  145 + },
115 146 "debug": false,
116 147 "sitemapLocation": "sitemap.json"
117 148 }
118 149 \ No newline at end of file
... ...
packageA/pages/prom_list/prom_list.wxml
... ... @@ -46,7 +46,7 @@
46 46 <!-- 左边 -->
47 47 <view style="text-align: left; padding-left: 20rpx">
48 48 <view class="co-red"><text class="f_hei">搭配价</text>¥{{filters.toFix(data.shop_price+dp_price,2)}}</view>
49   - <view class="co-red"><text class="f_hei">已省</text>¥{{cut_price}}</view>
  49 + <view class="co-red"><text class="f_hei">已省</text>¥{{filters.toFix(cut_price,2)}}</view>
50 50 </view>
51 51 <!-- 右边 -->
52 52 <view bindtap="openSpecModel" class="buy_btn ">立即购买</view>
... ...
pages/cart/cart/cart.js
... ... @@ -55,9 +55,9 @@ Page({
55 55 },
56 56 onShow: function() {
57 57 var th = this;
58   - th.setData({
59   - isTabBar: getApp().globalData.isTabBar,
60   - });
  58 + //th.setData({
  59 + // isTabBar: getApp().globalData.isTabBar,
  60 + //});
61 61  
62 62 t.editTabBar(); //显示自定义的底部导航
63 63 this.getCardList();
... ... @@ -78,7 +78,6 @@ Page({
78 78 })
79 79 }
80 80 });
81   - isTabBar
82 81  
83 82 },
84 83  
... ... @@ -1191,8 +1190,9 @@ Page({
1191 1190 }).then(res=>{
1192 1191 if(res.data.code==0) discount=res.data.data;
1193 1192 })
1194   - //---如果有打折的信息,赠送的信息---
1195   - if(discount && discount['goods_id']){
  1193 +
  1194 + //---如果有打折的信息,赠送的信息,赠送的时候要判断是不是限购数量---
  1195 + if(discount && discount['goods_id'] && discount.limit_num>=discount.bs && discount.gift_storecount>=discount.bs){
1196 1196 var o=discount.goodsinfo;
1197 1197 var newd = {
1198 1198 goods_id: o.goods_id,
... ...
pages/cart/cart/cart.wxml
... ... @@ -183,7 +183,7 @@
183 183  
184 184  
185 185 <warn id="warn"></warn>
186   -<view wx:if="{{isTabBar == true}}">
  186 +<!-- <view wx:if="{{isTabBar == true}}">
187 187 <import src="../../tabbar/tabbar.wxml" />
188 188 <template is="tabBar" data="{{tabBar}}" />
189   -</view>
190 189 \ No newline at end of file
  190 +</view> -->
191 191 \ No newline at end of file
... ...
pages/cart/cart2/cart2.js
... ... @@ -695,9 +695,9 @@ Page({
695 695 //--看有没有减价--
696 696 if(item_map.prom_price && item_map.price-item_map.prom_price){
697 697 if(cart_item.prom_pt_json){
698   - cart_item.prom_pt_json.push({"prom_id":item_map.prom_id,"dis":item_map.price-item_map.prom_price,"ispt":0})
  698 + cart_item.prom_pt_json.push({"prom_id":item_map.prom_id,"dis":(item_map.price-item_map.prom_price).toFixed(2),"ispt":0})
699 699 }else{
700   - cart_item.prom_pt_json=[{"prom_id":item_map.prom_id,"dis":item_map.price-item_map.prom_price,"ispt":0}];
  700 + cart_item.prom_pt_json=[{"prom_id":item_map.prom_id,"dis":(item_map.price-item_map.prom_price).toFixed(2),"ispt":0}];
701 701 }
702 702  
703 703 o_price-=(item_map.price-item_map.prom_price);
... ... @@ -840,12 +840,12 @@ Page({
840 840 if(o_price>=freight_free && freight_free>0 && !is_good_no_by && th.data.is_no_by[pickid]!=1){
841 841 continue;
842 842 }
843   -
844 843 //--如果是包邮券使用的情况下,如果商品是包邮的,那么就不进行计算--
845 844 if(th.data.using_quan[pickid] && th.data.using_quan[pickid].isby==1 && !is_good_no_by){
846 845 continue;
847 846 }
848 847  
  848 +
849 849 //----------------如果是选择了物流---------------------
850 850 if(cart_item.exp_type == 0 && item[j].is_free_shipping==0){
851 851 //如果地址不为空
... ... @@ -1365,8 +1365,8 @@ Page({
1365 1365  
1366 1366 //--判断优惠活动的提交--
1367 1367 if(th.data.formData.cut_price>0){
1368   - order_prom_list.discount_amount=th.data.formData.cut_price;
1369   - var ob=[{"prom_id":th.data.bn_goods.prom_id,"dis":th.data.formData.cut_price,"ispt":0}]
  1368 + order_prom_list.discount_amount=th.data.formData.cut_price.toFixed(2);
  1369 + var ob=[{"prom_id":th.data.bn_goods.prom_id,"dis":th.data.formData.cut_price.toFixed(2),"ispt":0}]
1370 1370 order_prom_list.prom_pt_json=JSON.stringify(ob);
1371 1371 }
1372 1372 if(th.data.formData.give_integral>0){
... ... @@ -1512,7 +1512,7 @@ Page({
1512 1512 }
1513 1513 //--判断优惠活动的提交--
1514 1514 if(t_item.cut_price>0){
1515   - order_prom_list.discount_amount=t_item.cut_price;
  1515 + order_prom_list.discount_amount=t_item.cut_price.toFixed(2);
1516 1516 order_prom_list.prom_pt_json=JSON.stringify(t_item.prom_pt_json);
1517 1517 }
1518 1518 if(t_item.s_intValue>0){
... ... @@ -2364,6 +2364,7 @@ Page({
2364 2364 //-----获取购物车进来的劵-------
2365 2365 get_cart_quan:function () {
2366 2366 var th=this;
  2367 + var is_xz_yh=1;
2367 2368 //等待值的出现
2368 2369 getApp().waitfor2(this,"g_cart_q_time","order_prom_list_cart",async function () {
2369 2370 var arr=th.data.order_prom_list_cart;
... ... @@ -2387,6 +2388,7 @@ Page({
2387 2388 //如果有限制使用优惠券,就要返回
2388 2389 if(gd.prom_type==3){
2389 2390 if(th.data.prom_goods_map[pickup_id][gd.prom_id].is_xz_yh) continue;
  2391 + is_xz_yh=0;
2390 2392 th.data.prom_goods_map[pickup_id][gd.prom_id].coupon_sele=1;
2391 2393 }
2392 2394 var item_price=gd.goods_price*gd.goods_num;
... ... @@ -2418,7 +2420,7 @@ Page({
2418 2420 arr[ind].check_quan_price_list=check_quan_price_list;
2419 2421  
2420 2422 //是否关闭使用优惠券
2421   - if (th.data.is_close_quan != 1) {
  2423 + if (th.data.is_close_quan != 1 && !is_xz_yh) {
2422 2424 //--调用接口,获取优惠券的列表,3秒钟内控制接口请求--
2423 2425 var url="/api/weshop/couponList/getUseCouponList";
2424 2426 await app.request.promiseGet(url,{ data:{storeId:oo.stoid,userId:app.globalData.user_id,BuySum:ckeck_quan_price,WareIds:check_quan_ware_list,pageSize:100}}).then(res=>{
... ...
pages/goods/categoryList/categoryList.js
... ... @@ -535,6 +535,15 @@ Page({
535 535 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
536 536  
537 537 },
  538 +
  539 +
  540 + //---图片失败,默认图片---
  541 + bind_Goodsbnerr: function (e) {
  542 + var _errImg = e.target.dataset.errorimg;
  543 + var _errObj = {};
  544 + _errObj[_errImg] ="/miniapp/images/default_g_img.gif";
  545 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  546 + },
538 547 // 新的版本分类点击一级分类
539 548 click_classify:function(e){
540 549 clearInterval(this.data.timer);
... ...
pages/goods/categoryList/categoryList.wxml
... ... @@ -382,7 +382,7 @@
382 382 <view class="choice_list" style="height:{{msgStatus != true?'100%':''}}">
383 383 <navigator class="choice_item" style="margin-bottom:{{dataLength -1 == index?'100px':'0'}}" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:for="{{requestData}}" data-id="{{index}}" wx:key="{{index}}">
384 384 <view class="img-wrap">
385   - <image src="{{url+item.original_img}}" binderror="bind_bnerr2" data-url="{{url+item.original_img}}" lazy-load="true" data-errorimg="requestData[{{index}}].original_img"></image>
  385 + <image src="{{url+item.original_img}}" binderror="bind_Goodsbnerr" data-url="{{url+item.original_img}}" lazy-load="true" data-errorimg="requestData[{{index}}].original_img"></image>
386 386 </view>
387 387 <view class="item-cont">
388 388 <view class="title">{{item.goods_name}}</view>
... ... @@ -487,7 +487,7 @@
487 487 </block>
488 488  
489 489 </block>
490   -<view wx:if="{{isTabBar == true}}">
  490 +<!-- <view wx:if="{{isTabBar == true}}">
491 491 <import src="../../tabbar/tabbar.wxml" />
492 492 <template is="tabBar" data="{{tabBar}}" />
493   -</view>
494 493 \ No newline at end of file
  494 +</view> -->
495 495 \ No newline at end of file
... ...
pages/index/index/index.js
... ... @@ -102,38 +102,43 @@ Page({
102 102 is_disgraceful: 0
103 103 })
104 104 },
  105 +
105 106 async onShow() {
106 107 var th = this;
107 108 //获取底部导航
108   - await getApp().request.promiseGet("/api/weshop/storeFooter/get/"+o.stoid, {
  109 + // await getApp().request.promiseGet("/api/weshop/storeFooter/get/"+o.stoid, {
109 110  
110   - }).then(res => {
111   - var e = res;
112   - console.log(e)
113   - if(e.data.code != -1){
114   - getApp().globalData.isTabBar = true
115   - //console.log(JSON.parse(e))
116   - var itemList = e.data.data.data;
  111 + // }).then(res => {
  112 + // var e = res;
  113 + // console.log(e)
  114 + // if(e.data.code != -1){
  115 + // getApp().globalData.isTabBar = true
  116 + // //console.log(JSON.parse(e))
  117 + // var itemList = e.data.data.data;
117 118  
118   - itemList = JSON.parse(itemList)
119   - for(var i=0; i<itemList.length; i++){
120   - itemList[i]['active'] = false
121   - }
122   - console.log(itemList)
123   - getApp().globalData.tabBar.backgroundColor = e.data.data.bkcolor
124   - getApp().globalData.tabBar.selectedColor = e.data.data.fontcolor_sele
125   - getApp().globalData.tabBar.color = e.data.data.fontcolor
126   - getApp().globalData.tabBar.list = itemList
127   - wx.hideTabBar({})
128   - }else{
129   - getApp().globalData.isTabBar = true
130   - }
131   - th.setData({
132   - isTabBar: getApp().globalData.isTabBar,
133   - });
134   - })
135   - console.log("isTabBar:="+getApp().globalData.isTabBar)
136   - t.editTabBar(); //显示自定义的底部导航
  119 + // itemList = JSON.parse(itemList)
  120 + // for(var i=0; i<itemList.length; i++){
  121 + // itemList[i]['active'] = false
  122 + // }
  123 + // console.log(itemList)
  124 + // getApp().globalData.tabBar.backgroundColor = e.data.data.bkcolor
  125 + // getApp().globalData.tabBar.selectedColor = e.data.data.fontcolor_sele
  126 + // getApp().globalData.tabBar.color = e.data.data.fontcolor
  127 + // getApp().globalData.tabBar.list = itemList
  128 + // getApp().globalData.tabBar.iscustom = '1'
  129 + // getApp().globalData.tabBar.url = "";
  130 + // wx.hideTabBar({})
  131 + // }else{
  132 + // getApp().globalData.isTabBar = true
  133 + // getApp().globalData.tabBar.iscustom = '2'
  134 + // getApp().globalData.tabBar.url = th.data.url;
  135 + // }
  136 + // th.setData({
  137 + // isTabBar: getApp().globalData.isTabBar,
  138 + // });
  139 + // })
  140 + // console.log("isTabBar:="+getApp().globalData.isTabBar)
  141 + // t.editTabBar(); //显示自定义的底部导航
137 142  
138 143 if (getApp().globalData.user_id) getApp().requestCardNum();
139 144 await this.init_load();
... ...
pages/index/index/index.wxml
... ... @@ -360,8 +360,8 @@
360 360 </view>
361 361 </block>
362 362 <!-- <view wx:if="{{isTabBar == true}}"> -->
363   - <import src="../../tabbar/tabbar.wxml" />
364   - <template is="tabBar" data="{{tabBar}}" />
  363 + <!-- <import src="../../tabbar/tabbar.wxml" />
  364 + <template is="tabBar" data="{{tabBar}}" /> -->
365 365 <!-- </view> -->
366 366  
367 367  
... ...
pages/tabbar/tabbar.js 0 → 100644
  1 +// pages/tabbar.js
  2 +var d = getApp().globalData;
  3 +Page({
  4 +
  5 + /**
  6 + * 页面的初始数据
  7 + */
  8 + data: {
  9 + isTabBar:d.isTabBar
  10 + },
  11 +
  12 + /**
  13 + * 生命周期函数--监听页面加载
  14 + */
  15 + onLoad: function (options) {
  16 +
  17 + },
  18 +
  19 + /**
  20 + * 生命周期函数--监听页面初次渲染完成
  21 + */
  22 + onReady: function () {
  23 +
  24 + },
  25 +
  26 + /**
  27 + * 生命周期函数--监听页面显示
  28 + */
  29 + onShow: function () {
  30 +
  31 + },
  32 +
  33 + /**
  34 + * 生命周期函数--监听页面隐藏
  35 + */
  36 + onHide: function () {
  37 +
  38 + },
  39 +
  40 + /**
  41 + * 生命周期函数--监听页面卸载
  42 + */
  43 + onUnload: function () {
  44 +
  45 + },
  46 +
  47 + /**
  48 + * 页面相关事件处理函数--监听用户下拉动作
  49 + */
  50 + onPullDownRefresh: function () {
  51 +
  52 + },
  53 +
  54 + /**
  55 + * 页面上拉触底事件的处理函数
  56 + */
  57 + onReachBottom: function () {
  58 +
  59 + },
  60 +
  61 + /**
  62 + * 用户点击右上角分享
  63 + */
  64 + onShareAppMessage: function () {
  65 +
  66 + }
  67 +})
0 68 \ No newline at end of file
... ...
pages/tabbar/tabbar.json 0 → 100644
  1 +{
  2 + "usingComponents": {}
  3 +}
0 4 \ No newline at end of file
... ...
pages/tabbar/tabbar.wxml 0 → 100644
  1 +<!--pages/tabbar.wxml-->
  2 +
  3 + <template name="tabBar">
  4 + <view class="tab-bar" style="position:fixed;color: {{tabBar.color}}; background: {{tabBar.backgroundColor}}; {{tabBar.position=='top'? 'top: 0' : 'bottom: 0'}};width:100%;height:50px;z-index:9999999">
  5 + <block wx:for="{{tabBar.list}}" wx:key="weappurl">
  6 + <navigator url="{{item.weappurl}}" bindtap="goto({{item.weappurl}})" class="tabbar_item {{item.clas}}" style="{{item.active? 'color: '+(item.selectedColor? item.selectedColor : tabBar.selectedColor) : ''}};position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;">
  7 + <view style="width:50%;height:50%;margin-left:25%;"><image src="{{tabBar.url}}{{item.src_sele}}" wx:if="{{item.active&&item.src_sele}}" class="img" style="width:100%;height:100%"></image>
  8 + <image src="{{tabBar.url}}{{item.src}}" wx:if="{{!item.active&&item.src}}" class="img" style="width:100%;height:100%"></image></view>
  9 + <view style="width:100%;height:100%;"><text class="tabbar_text" wx:if="{{item.nav_name}}" style="font-size:0.8rem">{{item.nav_name}}</text></view>
  10 + </navigator>
  11 + </block>
  12 + </view>
  13 + </template>
... ...
pages/tabbar/tabbar.wxss 0 → 100644
  1 +/* pages/tabbar.wxss */
0 2 \ No newline at end of file
... ...
pages/user/index/index.wxml
... ... @@ -297,7 +297,7 @@
297 297 </view>
298 298  
299 299 <pop_txt id="pop_txt"></pop_txt>
300   -<view wx:if="{{isTabBar == true}}">
  300 +<!-- <view wx:if="{{isTabBar == true}}">
301 301 <import src="../../tabbar/tabbar.wxml" />
302 302 <template is="tabBar" data="{{tabBar}}" />
303   -</view>
304 303 \ No newline at end of file
  304 +</view> -->
305 305 \ No newline at end of file
... ...
pages/user/order_detail/order_detail.js
... ... @@ -235,15 +235,13 @@ Page({
235 235 if(!e.confirm) return false;
236 236 //如果是秒杀和拼单的商品,取消订单要返回redis,并取消订单
237 237 //if(is_skill==1 || is_zsorder>=2){
238   -
239   - getApp().request.delete("/api/weshop/order/cancelTeamOrder/"+os.stoid+"/"+o,{
  238 + getApp().request.post("/api/weshop/order/cancelOrder/"+os.stoid+"/"+o+"/"+getApp().globalData.user_id,{
240 239 data:{},
241 240 success: function(t) {
242 241 if(t.data.code==0)
243 242 th.requestOrderDetail(o), wx.setStorageSync("order:order_list:update", !0);
244 243 },
245 244 })
246   -
247 245 /*----
248 246 }else{
249 247 getApp().request.put("/api/weshop/order/updatebyId", {
... ...
pages/user/order_list/order_list.js
... ... @@ -261,7 +261,7 @@ Page({
261 261 //如果是秒杀和拼单的商品,取消订单要返回redis,并取消订单
262 262 if (t.confirm) {
263 263 //if(is_skill==1 || is_zsorder>=2){
264   - getApp().request.delete("/api/weshop/order/cancelTeamOrder/" + os.stoid + "/" + a, {
  264 + getApp().request.post("/api/weshop/order/cancelOrder/"+os.stoid+"/"+a+"/"+getApp().globalData.user_id, {
265 265 data: {},
266 266 success: function(t) {
267 267 if (t.data.code == 0) {
... ... @@ -600,6 +600,7 @@ Page({
600 600  
601 601  
602 602 pay_next(e){
  603 + var th=this;
603 604 if (e.order_amount == 0) {
604 605 var dd = {
605 606 parent_sn: e.order_sn,
... ...