Commit d87cde43b94c774d49ecbe5e3b6482604dd74783

Authored by yvan.ni
1 parent 570ac6b7

服务卡项的优化

packageA/pages/cardList/cardList.js
@@ -11,13 +11,12 @@ Page({ @@ -11,13 +11,12 @@ Page({
11 list: null, 11 list: null,
12 isLoading: false, // 检测是否已经发送请求,防止重复发送请求 12 isLoading: false, // 检测是否已经发送请求,防止重复发送请求
13 noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 13 noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
14 - pageNum: 1, // 当前页数  
15 - 14 + pageNum: 1, // 当前页数
16 currentQuery: { 15 currentQuery: {
17 store_id: app.globalData.setting.stoid, 16 store_id: app.globalData.setting.stoid,
18 - },  
19 - 17 + },
20 default_img: '/miniapp/images/default_g_img.gif', 18 default_img: '/miniapp/images/default_g_img.gif',
  19 + object:null,
21 }, 20 },
22 21
23 /** 22 /**
@@ -30,7 +29,15 @@ Page({ @@ -30,7 +29,15 @@ Page({
30 userInfo: data, 29 userInfo: data,
31 imghost: app.globalData.setting.imghost, 30 imghost: app.globalData.setting.imghost,
32 }); 31 });
33 - }); 32 + });
  33 + var url="/api/weshop/store_module/gets/"+app.globalData.setting.stoid+"/0/5";
  34 + getApp().promiseGet(url,{}).then(res=>{
  35 + if(res.data.code==0 && res.data.data && res.data.data.length>0){
  36 + var json=JSON.parse(res.data.data[0].json_str);
  37 + var content=json[0].content;
  38 + self.setData({object:content});
  39 + }
  40 + })
34 }, 41 },
35 42
36 /** 43 /**
@@ -54,8 +61,7 @@ Page({ @@ -54,8 +61,7 @@ Page({
54 isLogin: true, 61 isLogin: true,
55 }); 62 });
56 63
57 - this.getData(true, url, currentQuery);  
58 - 64 + this.getData(true, url, currentQuery);
59 // app.request.promiseGet("/api/weshop/ad/page?pid=2&store_id=" + app.globalData.setting.stoid, { 65 // app.request.promiseGet("/api/weshop/ad/page?pid=2&store_id=" + app.globalData.setting.stoid, {
60 // data: { 66 // data: {
61 // enabled: 1 67 // enabled: 1
@@ -64,7 +70,6 @@ Page({ @@ -64,7 +70,6 @@ Page({
64 // console.log('res==>1', res); 70 // console.log('res==>1', res);
65 // }); 71 // });
66 72
67 -  
68 app.request.promiseGet("/api/weshop/ad/page?pid=2&store_id=" + app.globalData.setting.stoid, { 73 app.request.promiseGet("/api/weshop/ad/page?pid=2&store_id=" + app.globalData.setting.stoid, {
69 data: { 74 data: {
70 enabled: 1 75 enabled: 1
packageA/pages/cardList/cardList.json
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 "navigationBarTitleText": "卡项列表", 2 "navigationBarTitleText": "卡项列表",
3 "enablePullDownRefresh": false, 3 "enablePullDownRefresh": false,
4 "usingComponents": { 4 "usingComponents": {
5 - "nodata": "/components/nodata/nodata" 5 + "nodata": "/components/nodata/nodata",
  6 + "advertising":"/components/diy_advertising/diy_advertising"
6 } 7 }
7 } 8 }
8 \ No newline at end of file 9 \ No newline at end of file
packageA/pages/cardList/cardList.wxml
  1 +<block wx:if="{{object}}">
  2 + <advertising object="{{object}}"></advertising>
  3 + <view style="background-color: #{{object.bg_color}};">
  4 + <!-- 列表 -->
  5 + <block wx:if="{{object.column=='4'}}">
  6 +
  7 + <view class="{{object.noboder!=1?'b-bottom':''}}" wx:for="{{list.pageData}}" style="padding: 10rpx 20rpx;"
  8 + bindtap="go_goods" data-gid="{{item.id}}">
  9 +
  10 + <view class="flex bg-white ">
  11 + <view>
  12 + <image class="image" src="{{imghost + item.imgUrl}}"/>
  13 + </view>
  14 + <view class="flex fdc space-bt f1 pdl20">
  15 + <view>
  16 + <view class="pdv20 fs28"><text class="ellipsis-2">{{item.serviceName}}</text></view>
  17 + <view class="fs24 c7b">有效天数:{{item.validDays}}</view>
  18 + </view>
  19 + <view class="flex space-bt ali-c">
  20 + <view class="price">{{item.money}}</view>
  21 + </view>
  22 + <view style="height: 10rpx;"></view>
  23 + </view>
  24 + </view>
  25 + </view>
  26 +
  27 + </block>
  28 +
  29 + <!-- 一列和俩列 -->
  30 + <block wx:else>
  31 + <view class="pd20 flex-set">
  32 + <!-- 1列 2列 -->
  33 + <view wx:for="{{list.pageData}}" class="{{object.column=='1'?'w100':'w50'}} {{index%2==1?'ml':''}} bg-white"
  34 + bindtap="go_goods" data-gid="{{item.id}}"
  35 + style="margin-bottom: 20rpx;">
  36 + <view style="width: 100%;"><image src="{{imghost + item.imgUrl}}" mode="aspectFill"/></view>
  37 + <view class="flex fdc space-bt f1 pdl20">
  38 + <view>
  39 + <view class="pdv20 fs28"><text class="ellipsis-2">{{item.serviceName}}</text></view>
  40 + <view class="fs24 c7b">有效天数:{{item.validDays}}</view>
  41 + </view>
  42 + <view class="flex space-bt ali-c">
  43 + <view class="price">{{item.money}}</view>
  44 + </view>
  45 + <view style="height: 10rpx;"></view>
  46 + </view>
  47 + </view>
  48 + </view>
  49 + </block>
  50 + </view>
  51 + <nodata class="t-c" wx:if="{{list.pageData.length == 0 && list.pageData}}"></nodata>
  52 + <view wx:if="{{noMore}}" class="noMore">- 已经到底了 -</view>
  53 +</block>
  54 +
  55 +<block wx:else>
1 <view class="page"> 56 <view class="page">
2 <swiper class="swiper" autoplay indicator-dots circular easing-function="easeOutCubic"> 57 <swiper class="swiper" autoplay indicator-dots circular easing-function="easeOutCubic">
3 <swiper-item wx:for="{{banner}}"><image src="{{item.ad_code ? item.ad_code : (imghost + default_img)}}" class="swiper-img"/></swiper-item> 58 <swiper-item wx:for="{{banner}}"><image src="{{item.ad_code ? item.ad_code : (imghost + default_img)}}" class="swiper-img"/></swiper-item>
4 - <!-- <swiper-item>234</swiper-item>  
5 - <swiper-item>345</swiper-item> -->  
6 - </swiper>  
7 - 59 + </swiper>
8 <scroll-view class="scroll-view" scroll-y> 60 <scroll-view class="scroll-view" scroll-y>
9 <view class="bg-white"> 61 <view class="bg-white">
10 - <view class="flex pd20" wx:for="{{list.pageData}}"> 62 + <view class="flex pd20" wx:for="{{list.pageData}}" bindtap="go_goods" data-gid="{{item.id}}">
11 <view> 63 <view>
12 <image class="image" src="{{imghost + item.imgUrl}}"/> 64 <image class="image" src="{{imghost + item.imgUrl}}"/>
13 </view> 65 </view>
@@ -18,14 +70,15 @@ @@ -18,14 +70,15 @@
18 </view> 70 </view>
19 <view class="flex space-bt ali-c"> 71 <view class="flex space-bt ali-c">
20 <view class="price">{{item.money}}</view> 72 <view class="price">{{item.money}}</view>
21 - <view class="btn-details" bindtap="go_goods" data-gid="{{item.id}}">卡项详情</view> 73 + <view class="btn-details" >卡项详情</view>
22 </view> 74 </view>
23 </view> 75 </view>
24 </view> 76 </view>
25 77
26 <nodata class="t-c" wx:if="{{list.pageData.length == 0 || list == null}}"></nodata> 78 <nodata class="t-c" wx:if="{{list.pageData.length == 0 || list == null}}"></nodata>
27 </view> 79 </view>
28 - <!-- <nodata class="t-c" wx:if="{{list.pageData.length == 0 && list.pageData}}"></nodata> -->  
29 - <view class="noMore">- 已经到底了 -</view> 80 +
  81 + <view wx:if="{{noMore}}" class="noMore">- 已经到底了 -</view>
30 </scroll-view> 82 </scroll-view>
31 </view> 83 </view>
  84 +</block>
32 \ No newline at end of file 85 \ No newline at end of file
packageA/pages/cardList/cardList.wxss
@@ -64,4 +64,14 @@ page { @@ -64,4 +64,14 @@ page {
64 .swiper-img { 64 .swiper-img {
65 display: block; 65 display: block;
66 margin: auto; 66 margin: auto;
67 -}  
68 \ No newline at end of file 67 \ No newline at end of file
  68 +}
  69 +
  70 +.list_item{ display: inline-block;}
  71 +.w100{ width: 100%;}
  72 +.w50{ width: 49%; }
  73 +
  74 +
  75 +.w50 image{ width: 100%; height: 340rpx; }
  76 +.flex-set{display: flex;flex-wrap: wrap;}
  77 +.ml{margin-left: 15rpx;}
  78 +.b-bottom{ border-bottom:1rpx solid #fff}
69 \ No newline at end of file 79 \ No newline at end of file
packageA/pages/cart2_ser/cart2_ser.js 0 → 100644
  1 +var t = getApp(),app=t, a = t.request, e = require("../../../utils/common.js"),
  2 + s = require("../../../utils/util.js"), o = require("../../../utils/md5.js"), to = getApp();
  3 +var oo=t.globalData.setting,os=oo;
  4 +var regeneratorRuntime = require('../../../utils/runtime.js');
  5 +var util_pay = require("../../../utils/pay.js");
  6 +
  7 +Page({
  8 + data: {
  9 + url: t.globalData.setting.url,
  10 + resourceUrl: t.globalData.setting.resourceUrl,
  11 + imgUrl: t.globalData.setting.imghost,
  12 +
  13 + invoiceToggle: !0,
  14 + payWithUserMoney: !0,
  15 + payWithPoints: !0,
  16 + maxWord: 0,
  17 + enterAddressPage: !1,
  18 +
  19 + //页面获取的参数
  20 + param:null,
  21 + postdata:null,
  22 + //提交订单的格式
  23 + formData: {
  24 + order_amount:0,//支付金额
  25 + total_amount:0,//总价
  26 + all_price:0,//商品卖的总价
  27 + pay_points: 0,//使用积分
  28 + user_money: 0,//使用余额
  29 + couponCode: "",//使用优惠券(多单就用逗号隔开)
  30 + shipping_price:0,//物流费用
  31 + },
  32 +
  33 + /*----------------立即购买---------------------*/
  34 + is_b_now:0, //0是购物车结算 1立即购买
  35 + bn_goods:null, //立即购买时候的调用商品
  36 + bn_use_money:0,//是否使用余额
  37 + bn_pick:0, //选择的门店
  38 + bn_pickname: "", //选择的门店名称
  39 +
  40 + /*------------------------*/
  41 + //判断页面是返回回来的还是 首次进入的
  42 + yuer:0,
  43 + },
  44 + onLoad: function(t) {
  45 + var appD=getApp().globalData.service_now;
  46 + this.data.postdata=appD;
  47 + this.data.param=t;
  48 + var th=this;
  49 +
  50 + getApp().promiseGet("/api/wx/weappSendlist/page", {
  51 + data: {
  52 + store_id: os.stoid,
  53 + typeid: "1002"
  54 + }}).then(res=>{
  55 + if (res.data.code == 0 && res.data.data.pageData.length > 0) {
  56 + var template_id = res.data.data.pageData[0].template_id;
  57 + th.setData({template_id:template_id});
  58 + }
  59 + })
  60 +
  61 + },
  62 + onUnload: function () { this.setData({ isclose: 1 })},
  63 +
  64 + //------获取会员信息-----先获取用户信息,在进行下一步---
  65 + get_info:function(func){
  66 + var user_id = t.globalData.user_id;
  67 + to.auth.get_u(func);
  68 + },
  69 +
  70 +
  71 + //----------------展示页面,是再获取用户信息之后--------------
  72 + show_page:function(){
  73 + var th=this;
  74 + //th.setData({ userinfo: to.globalData.userInfo}); 会员信息要时时获取
  75 + var user=getApp().globalData.userInfo;
  76 + getApp().request.get("/api/weshop/users/get/" + oo.stoid + "/" + user.user_id, {
  77 + data:{r:Math.random()},
  78 + success: function (e) {
  79 +
  80 + getApp().globalData.userInfo = e.data.data;
  81 + th.setData({userinfo:e.data.data});
  82 + //获取立即购买的商品信息
  83 + th.get_buy_goods();
  84 +
  85 + //获取提现金额
  86 + getApp().request.get("/api/weshop/withdrawals/summoney", {
  87 + data: { user_id: to.globalData.user_id, store_id: oo.stoid, status: 0 },
  88 + success: function (su) {
  89 + if (su.data.code == 0) {
  90 + var yuer = parseFloat(th.data.userinfo.user_money -
  91 + (th.data.userinfo.frozen_money>0?th.data.userinfo.frozen_money:0) - su.data.data.summoney).toFixed(2);
  92 + th.setData({ txmon: su.data.data.summoney, yuer: yuer });
  93 + }
  94 + }
  95 + });
  96 + }
  97 + });
  98 + },
  99 +
  100 + //-----获取立即购买的商品信息----
  101 + get_buy_goods: function (){
  102 + var th=this,a=getApp().request;
  103 + var gg = th.data.postdata;
  104 + var url="/api/weshop/serviceCard/get/" + oo.stoid + "/" + gg.id
  105 + //调用商品
  106 + a.get(url, {
  107 + success: function (t) {
  108 + var gd = t.data.data;
  109 + t.data.data.original_img = oo.imghost + t.data.data.imgUrl;
  110 + t.data.data['buynum'] = gg.goods_num;
  111 + t.data.data.shop_price=gd.money;
  112 +
  113 + th.setData({
  114 + bn_goods: t.data.data, bn_pickname: gg.pick_name,
  115 + bn_pick: gg.pick_id
  116 + });
  117 + th.calculatePrice2();
  118 +
  119 + }
  120 + });
  121 + },
  122 +
  123 + //----------子页返回父页触发----------
  124 + onShow: function() {
  125 + var th=this;
  126 + if (th.data.isclose==0){
  127 + wx.navigateTo({
  128 + url: "/pages/index/index/index"
  129 + })
  130 + }
  131 + //先获取是否有关闭使用优惠券
  132 + getApp().getConfig2(function (ee) {
  133 + //var json_d = JSON.parse(ee.switch_list);
  134 + //th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
  135 + //th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch});
  136 + th.show_page();
  137 + })
  138 + },
  139 +
  140 +
  141 + showInvoice: function() {
  142 + this.setData({
  143 + invoiceToggle: !this.data.invoiceToggle
  144 + });
  145 + },
  146 +
  147 +
  148 + //---------计算立即购买----------
  149 + calculatePrice2: function () {
  150 + console.log('calculatePrice2');
  151 + var th = this, good = this.data.bn_goods;
  152 + //-----------计算商品总价--------------
  153 + var allpice = good.shop_price * good.buynum;
  154 + allpice=parseFloat(allpice).toFixed(2);
  155 + var txt = "formData.all_price";
  156 + th.setData({ [txt]: allpice, });
  157 +
  158 + var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
  159 + //-----------------总价-----------------
  160 + var total_m = parseFloat(allpice) + parseFloat( th.data.formData.shipping_price);
  161 + total_m = parseFloat(total_m).toFixed(2);
  162 +
  163 + var atxt= "formData.total_amount";
  164 + th.setData({ [atxt]: total_m, })
  165 + var order_m = total_m;
  166 + var txt = "formData.user_money";
  167 + var txt2 = "formData.order_amount";
  168 +
  169 + th.setData({ [txt]: 0, [txt2]: order_m })
  170 +
  171 + },
  172 +
  173 + submitForm:function(){
  174 + var th=this;
  175 + this.sendsm(function(){
  176 + th.submit_func();
  177 + })
  178 + },
  179 +
  180 + //--------------------提交订单-----------------------
  181 + submit_func: async function(){
  182 + if(this.data.is_summit_ing==1) return false; //--提交中退出--
  183 + this.data.is_summit_ing=1;
  184 + var th=this,pdata=new Array();
  185 + var ff=true;
  186 + var item={
  187 + 'user_id': to.globalData.user_id,
  188 + 'account': th.data.formData.order_amount, //使用余额
  189 + 'store_id':oo.stoid, //商家
  190 + 'list':new Array(),
  191 + };
  192 + var gg = getApp().globalData.service_now;
  193 + var goods={
  194 + 'card_id': th.data.bn_goods.id,
  195 + 'itemid': th.data.bn_goods.erpItemID,
  196 + 'qty': gg.goods_num,
  197 + 'price': th.data.formData.order_amount,
  198 + 'pickup_id':gg.pick_id,
  199 + 'pickup_keyid':gg.keyid,
  200 + };
  201 +
  202 + //--导购分享过来的id--
  203 + if(gg.guide_id){
  204 + goods.guide_id=gg.guide_id;
  205 + goods.guide_type=gg.guide_type;
  206 + //调用接口判断是不是会员
  207 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/"+oo.stoid+"/"+gg.guide_id,{}).then(res=>{
  208 + if(res.data.code==0){
  209 + goods.guide_name=res.data.data.salesman;
  210 + goods.guide_sn=res.data.data.salesman_no;
  211 + }
  212 + })
  213 + }
  214 + item.list.push(goods);
  215 + pdata=item;
  216 +
  217 + var str = JSON.stringify(pdata);
  218 + console.log("支付数据");
  219 + console.log(str);
  220 + //return false;
  221 + wx.showLoading({title: "加载中"});
  222 + wx.request({
  223 + url: oo.url + '/api/weshop/recharge/saveRecharge',
  224 + data: str,
  225 + method: 'POST',
  226 + header: {
  227 + 'content-type': 'application/json'
  228 + },// 设置请求的 header
  229 + success: function (res) {
  230 +
  231 + wx.hideLoading();
  232 + if (res.statusCode == 200) {
  233 + var data=res.data;
  234 + if(data.code==0){
  235 +
  236 + var order_amount = pdata.account;
  237 + //要进行判断,如果是用微信支付,就要跳转到支付界面
  238 + if (order_amount > 0) {
  239 + th.setData({ isclose: 0 });
  240 +
  241 + getApp().request.post("/api/weshop/order/pay/createRechargeOrder", {
  242 + data: {
  243 + parentSn: data.data.order_sn,
  244 + store_id: oo.stoid
  245 + },
  246 + success: function (su) {
  247 + var n=su.data.data;
  248 + th.weixinPay(n,
  249 + function () {
  250 + getApp().showWarning("购买成功");
  251 + setTimeout(function () {
  252 + wx.reLaunch({
  253 + url: "/packageA/pages/cardList/cardList",
  254 + })
  255 + },1000)
  256 + }, function () {
  257 + getApp().showWarning("支付失败");
  258 + setTimeout(function () {
  259 + wx.reLaunch({
  260 + url: "/packageA/pages/cardList/cardList",
  261 + })
  262 + },1000)
  263 + })
  264 + }
  265 + })
  266 + }
  267 + }
  268 + else{
  269 + th.data.is_summit_ing=0; //是否提交中
  270 + getApp().confirmBox(data.msg);
  271 + }
  272 + } else {
  273 + th.data.is_summit_ing=0; //是否提交中
  274 + console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode);
  275 + }
  276 + },
  277 + fail: function () {
  278 + th.data.is_summit_ing=0; //是否提交中
  279 + wx.hideLoading();
  280 + console.log("index.js wx.request CheckCallUser fail");
  281 + },
  282 + complete: function () {}
  283 + })
  284 + },
  285 +
  286 + cart_set_err: function (e) {
  287 + var txt = e.currentTarget.dataset.err;
  288 + var ob = {};
  289 + ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif";
  290 + this.setData(ob);
  291 + },
  292 +
  293 + //------调起支付框--------
  294 + weixinPay: function (n, success, fail) {
  295 + wx.requestPayment({
  296 + timeStamp: String(n.timeStamp),
  297 + nonceStr: n.nonceStr,
  298 + package: n.packageValue,
  299 + signType: n.signType,
  300 + paySign: n.paySign,
  301 + success: function (n) {
  302 + console.log(n), getApp().showSuccess("支付成功!");
  303 + "function" == typeof success && success();
  304 + wx.redirectTo({
  305 + url: "../deposit/deposit"
  306 + });
  307 + },
  308 + fail: function (n) {
  309 + console.log(n), "requestPayment:fail" == n.errMsg ? getApp().showWarning("支付失败") : "requestPayment:fail cancel" == n.errMsg ? getApp().showWarning("您已取消支付") : getApp().showWarning("支付失败:" + n.errMsg.substr("requestPayment:fail ".length)),
  310 + "function" == typeof fail && fail();
  311 + }
  312 + });
  313 + },
  314 +
  315 + //订阅消息提醒
  316 + sendsm:function(func)
  317 + {
  318 + var template_id = this.data.template_id;
  319 + // //授权订阅
  320 + wx.requestSubscribeMessage({
  321 + tmplIds: [template_id],
  322 + success(res) {
  323 + func();
  324 + },
  325 + fail(res) {
  326 + func();
  327 + }
  328 + })
  329 +
  330 + },
  331 +
  332 +
  333 +});
packageA/pages/cart2_ser/cart2_ser.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "填写订单",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "warn": "/components/long_warn/long_warn"
  6 + }
  7 +}
0 \ No newline at end of file 8 \ No newline at end of file
packageA/pages/cart2_ser/cart2_ser.wxml 0 → 100644
  1 +<wxs module="filters" src="../../../utils/filter.wxs"></wxs>
  2 +<form bindsubmit="submitForm">
  3 + <view class="container">
  4 +
  5 + <!------立即购买-------->
  6 + <block>
  7 + <view class="use-item bfff bdr_t-14 mgt20">
  8 + <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image> <view>{{bn_pickname}}</view></view>
  9 + <view class="order-detail">
  10 + <view class="goods-img">
  11 + <image class="wh100 bdr14" src="{{bn_goods.original_img}}"
  12 + binderror='cart_set_err' data-err="bn_goods.original_img"></image>
  13 + </view>
  14 + <navigator class="order-cont" url="/packageA/goodsInfo/goodsInfo?goods_id={{bn_goods.id}}">
  15 + <view class="goods-name ellipsis-2">{{bn_goods.serviceName}}</view>
  16 + <!-- 商品属性 -->
  17 + <!-- <view class="flex-vertical fs28 color-gray n_guige"> -->
  18 + <!-- <view class="goods-color"><text>{{filters.show_gui_ge(bn_goods.goods_spec,bn_goods.goods_color)}}</text></view> -->
  19 + <!-- </view> -->
  20 + <!-----商品名称规格------>
  21 + <view class="order-num flex-space-between">
  22 + <view class="co-red">¥<text class="fs36">{{filters.toFix(bn_goods.shop_price,2)}}</text></view>
  23 + <view class="goods-num">x{{bn_goods.buynum}}</view>
  24 + </view>
  25 + </navigator>
  26 + </view>
  27 + </block>
  28 + <!--
  29 + <view class="coupon-mes flex-vertical">
  30 + <view>留言</view>
  31 + <view class="leave-word">
  32 + <input placeholder-class="fs28" placeholder='给商家留言,最多100字'bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="100" name="user_note"></input>
  33 + </view>
  34 + </view>-->
  35 +
  36 + <view class="information bdr14">
  37 + <view class="item">
  38 + <view>服务卡金额</view>
  39 + <view class="co-red">¥ {{formData.all_price}}元</view>
  40 + </view>
  41 + </view>
  42 + </view>
  43 + <view class="btn-wrap">
  44 + <view class="pay-amount">
  45 + <view class="payable">应付金额:<text class="co-red">¥{{formData.order_amount}}</text></view>
  46 + </view>
  47 + <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button>
  48 + </view>
  49 +</form>
  50 +<warn id="warn"></warn>
packageA/pages/cart2_ser/cart2_ser.wxss 0 → 100644
  1 +@import '../../../app.wxss';
  2 +
  3 +.bdr_t-14 {
  4 + border-top-left-radius: 14rpx;
  5 + border-top-right-radius: 14rpx;
  6 +}
  7 +.bdr_b-14 {
  8 + border-bottom-left-radius: 14rpx;
  9 + border-bottom-right-radius: 14rpx;
  10 +}
  11 +.bdr14 {
  12 + border-radius: 14rpx;
  13 +}
  14 +.mgt20 {
  15 + margin-top: 20rpx;
  16 +}
  17 +.shadow {
  18 + box-shadow: 0 4rpx 12px #e7e9eb;
  19 +}
  20 +.shadow-1 {
  21 + box-shadow: 16rpx 0px 12px #e7e9eb;
  22 +}
  23 +
  24 +
  25 +page {
  26 + /* background-color: #FAFAFA; */
  27 + background-color: #F0F0F0;
  28 + padding: 0 22rpx;
  29 + box-sizing: border-box;
  30 +}
  31 +.container {
  32 + background-color: #F0F0F0;
  33 + /* padding-top: 28rpx; */
  34 + padding-bottom: 120rpx;
  35 +}
  36 +.user-mes {
  37 + position: relative;
  38 + background-color: #fff;
  39 + font-size: 32rpx;
  40 + color: #444;
  41 + /* margin-top: 28rpx; */
  42 + border-radius: 14rpx;
  43 +}
  44 +.user-contact {
  45 + padding: 24rpx 26rpx;
  46 + font-weight: 600;
  47 +}
  48 +
  49 +.location {
  50 + position: relative;
  51 + padding: 0 70rpx 24rpx;
  52 +}
  53 +
  54 +.pos-icon {
  55 + position: absolute;
  56 + left: 28rpx;
  57 + top: 6rpx;
  58 + width: 30rpx;
  59 + height: 36rpx;
  60 +}
  61 +
  62 +.border-img {
  63 + width: 100%;
  64 + height: 12rpx;
  65 +}
  66 +
  67 +.update-logistics {
  68 + position: absolute;
  69 + right: 0;
  70 + top: 0;
  71 + width: 80rpx;
  72 + height: 100%;
  73 + display: flex;
  74 + align-items: center;
  75 + justify-content: center;
  76 +}
  77 +
  78 +.arrow-rigth {
  79 + width: 32rpx;
  80 + height: 32rpx;
  81 +}
  82 +
  83 +.order-meg {
  84 + margin-bottom: 20rpx;
  85 + font-size: 28rpx;
  86 +
  87 +}
  88 +
  89 +.order-detail {
  90 + padding: 30rpx 0;
  91 + border-bottom: 2rpx solid #eee;
  92 + color: #777;
  93 + min-height: 190rpx;
  94 + background-color: #fff;
  95 +
  96 +}
  97 +
  98 +.goods-img {
  99 + float: left;
  100 + width: 200rpx;
  101 + height: 200rpx;
  102 + margin: 0 20rpx;
  103 +}
  104 +
  105 +.order-cont {
  106 + float: left;
  107 + width: 438rpx;
  108 +}
  109 +
  110 +.goods-name {
  111 + height: 74rpx;
  112 + line-height: 40rpx;
  113 + overflow: hidden;
  114 + margin-bottom: 16rpx;
  115 + font-size: 28rpx;
  116 + color: #333;
  117 +}
  118 +
  119 +.goods-color {
  120 + font-size: 24rpx;
  121 +}
  122 +
  123 +.order-num {
  124 + margin-top: 25rpx;
  125 + font-size: 24rpx;
  126 + line-height: 42rpx;
  127 +}
  128 +
  129 +.set-mes{
  130 + background-color: #fff;
  131 + /* margin-top: 20rpx; */
  132 +}
  133 +.use-item{
  134 + display: flex;
  135 + align-items: center;
  136 + height: 80rpx;
  137 + /* border-bottom: 1px solid #ddd; */
  138 + font-size: 30rpx;
  139 + /* width:95%;
  140 +margin:auto; */
  141 + padding: 0 26rpx;
  142 +}
  143 +.use-item>view{
  144 + display: flex;
  145 + /* margin-right: 12rpx; */
  146 +}
  147 +.use-item.bfff{
  148 + background-color: #fff;
  149 +}
  150 +.use-item .dp{
  151 + display: block;
  152 + width: 50rpx;
  153 + height: 50rpx;
  154 + margin-left: -6rpx;
  155 +}
  156 +
  157 +.set-item {
  158 + justify-content: space-between;
  159 + background-color: #fff;
  160 +}
  161 +
  162 +.set-btn {
  163 + display: flex;
  164 + font-size: 24rpx;
  165 +}
  166 +
  167 +.set-mes input {
  168 + width: 380rpx;
  169 + height: 50rpx;
  170 + line-height: 50rpx;
  171 + border: 1px solid #ddd;
  172 +}
  173 +
  174 +.use-btn {
  175 + width: 100rpx;
  176 + height: 50rpx;
  177 + margin-left: 20rpx;
  178 + line-height: 50rpx;
  179 + text-align: center;
  180 + background-color: #f23030;
  181 + color: #fff;
  182 +}
  183 +
  184 +.coupon-mes {
  185 + /* box-sizing: border-box; */
  186 + height:95rpx;
  187 + padding: 0 26rpx;
  188 + background-color: #fff;
  189 + font-size: 30rpx;
  190 + color: #444;
  191 + /* width: 100%; */
  192 + border-radius: 14rpx;
  193 + margin-top: 20rpx;
  194 + margin-bottom: 20rpx;
  195 +}
  196 +
  197 +.coupon-title {
  198 + display: flex;
  199 + justify-content: space-between;
  200 + align-items: center;
  201 + height: 92rpx;
  202 +}
  203 +
  204 +.coupon-title>view {
  205 + display: flex;
  206 +}
  207 +
  208 +.coupon-num {
  209 + height: 36rpx;
  210 + margin-left: 20rpx;
  211 + padding: 0 16rpx;
  212 + line-height: 36rpx;
  213 + text-align: center;
  214 + background-color: #f23030;
  215 + color: #fff;
  216 + font-size: 24rpx;
  217 +}
  218 +
  219 +.leave-word {
  220 + position: relative;
  221 + font-size: 24rpx;
  222 + margin-left: 20rpx;
  223 + flex-grow: 1;
  224 +}
  225 +
  226 +.word-box {
  227 + font-size: 26rpx;
  228 + /* width: 600rpx; */
  229 + padding: 10rpx;
  230 + height: 28rpx;
  231 + line-height: 40rpx;
  232 +}
  233 +
  234 +.max-word {
  235 + position: absolute;
  236 + right: 0;
  237 + bottom: 0;
  238 +}
  239 +
  240 +.information {
  241 + padding: 0 26rpx;
  242 + background-color: #fff;
  243 + /* margin-bottom: 120rpx; */
  244 +}
  245 +
  246 +.information .item {
  247 + display: flex;
  248 + justify-content: space-between;
  249 + height: 60rpx;
  250 + line-height: 60rpx;
  251 + font-size: 26rpx;
  252 + color: #777;
  253 +}
  254 +
  255 +.btn-wrap {
  256 + height: 94rpx;
  257 + box-sizing: border-box;
  258 + display: flex;
  259 + justify-content: space-between;
  260 + background-color: white;
  261 + align-items: center;
  262 + position: fixed;
  263 + bottom: 0;
  264 + left: 0;
  265 + width: 100%;
  266 + padding: 0 30rpx;
  267 +}
  268 +
  269 +.tips-btn {
  270 + color: white;
  271 + background-color: #FE4445;
  272 + height: 72rpx;
  273 + line-height: 72rpx;
  274 + padding: 0 42rpx;
  275 + border-radius: 36rpx;
  276 + margin-left: 0;
  277 + margin-right: 0;
  278 +}
  279 +
  280 +.payable {
  281 + color: #444;
  282 +}
  283 +
  284 +.shipping-modal {
  285 + z-index: 20;
  286 + position: fixed;
  287 + bottom: 0;
  288 + left: 0;
  289 + right: 0;
  290 + overflow-y: hidden;
  291 + color: #666666;
  292 + background-color: white;
  293 +}
  294 +
  295 +.shipping-nav {
  296 + text-align: center;
  297 + font-size: 35rpx;
  298 + padding-top: 30rpx;
  299 +}
  300 +
  301 +.shipping-list {
  302 + padding: 20rpx 30rpx 40rpx;
  303 + font-size: 28rpx;
  304 +}
  305 +
  306 +.shipping-item {
  307 + display: block;
  308 + padding: 20rpx 0;
  309 +}
  310 +
  311 +.shipping-btn {
  312 + width: 100%;
  313 + color: white;
  314 + background-color: #f23030;
  315 + line-height: 90rpx;
  316 + text-align: center;
  317 + font-size: 40rpx;
  318 +}
  319 +
  320 +/*----------nyf新增,地址---------*/
  321 +.add_new{
  322 + height: 90rpx;
  323 + display: flex;
  324 + align-items: center;
  325 + padding: 0 26rpx;
  326 +}
  327 +.addr_jia{width: 45rpx; height: 45rpx; border: 1rpx solid #ddd;
  328 + margin-right: 15rpx;vertical-align: middle;}
  329 +.yu_er{
  330 + margin-left: 10rpx;
  331 + /* margin-right: 60rpx; */
  332 +}
  333 +.wuliu{margin-left: 20rpx;}
  334 +
  335 +
  336 +/*---- 优惠券列表 -----*/
  337 +.xc-coupon-frame{
  338 + width: 100%;
  339 + height: 92rpx;
  340 +
  341 +}
  342 +.xc-coupon-frame .work-frame{
  343 + width: 100%;
  344 + height: 100%;
  345 + border-bottom:3rpx solid #eee;
  346 + padding: 0 26rpx;
  347 + background-color: white;
  348 +}
  349 +.xc-right{
  350 + width:20rpx;
  351 + height:20rpx;
  352 + border-top:2rpx solid #000;
  353 + border-right:2rpx solid #000;
  354 + transform:rotate(45deg);
  355 + display:inline-block;
  356 +}
  357 +
  358 +.xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; }
  359 +.xc-right-frame{font-size: 30rpx;line-height: 92rpx; margin-right: 10rpx }
  360 +
  361 +/* 自定义弹出窗口 */
  362 +.cx-popup{
  363 + width:100%;
  364 + height:880rpx;
  365 + background: #fff;
  366 + z-index: 35;
  367 + border-top-left-radius: 20rpx;
  368 + border-top-right-radius: 20rpx;
  369 + position:fixed;
  370 + bottom:0;
  371 + left: 0;
  372 + /* padding-bottom: 25rpx; */
  373 +}
  374 +
  375 +.cx-popup .top{
  376 + width:95%;
  377 + height:100rpx;
  378 + border-bottom:3rpx solid #ddd;
  379 + margin: auto;
  380 + margin-top: 30rpx;
  381 +
  382 +}
  383 +.xc-top-content{
  384 + width: 93%;
  385 + height:85rpx;
  386 + padding-top: 30rpx;
  387 + font-size: 34rpx;
  388 + font-weight: 600;
  389 +
  390 +}
  391 +
  392 +
  393 +.xc-valid-coupon{
  394 + width: 90%;
  395 + height:40rpx;
  396 + padding-top: 24rpx;
  397 + overflow: hidden;
  398 +}
  399 +.xc-frame{
  400 + width: 100%;
  401 + height:60%;
  402 +}
  403 +
  404 +.xc-frame .list-frame{
  405 + width: 95%;
  406 + height: 100%;
  407 + overflow-y:scroll;
  408 +
  409 +}
  410 +.xc-close-frame{
  411 + margin-top:-10rpx;
  412 +
  413 +}
  414 +
  415 +.xc-close{
  416 + width: 37rpx;
  417 +height: 37rpx;
  418 +border-radius: 50%;
  419 +border: 3rpx solid #333;
  420 +text-align: center;
  421 +line-height: 34rpx;
  422 +font-size: 29rpx;
  423 +color: #333;
  424 +
  425 +}
  426 +.xc-money{
  427 + color: #af2346;
  428 + font-size: 35rpx;
  429 +}
  430 +
  431 +.xc-money-frame{
  432 + margin-left:35rpx;
  433 +
  434 +}
  435 +.xc-coupon-effect{
  436 + width: 99%;
  437 + min-height: 100rpx;
  438 + border-bottom:3rpx solid #ddd;
  439 +
  440 +
  441 +}
  442 +.xc-goods-coupon{
  443 + width: 85%;
  444 + height:100%;
  445 +
  446 +}
  447 +.xc-title{
  448 + width:50%;
  449 + margin-left:222rpx;
  450 +
  451 +}
  452 +.xc-coupon-money0{
  453 + color: #c91e31;
  454 + font-size: 35rpx;
  455 + line-height: 40rpx;
  456 +
  457 +}
  458 +.xc-coupon-money{
  459 + color: #c91e31;
  460 + font-size: 35rpx;
  461 + line-height: 40rpx;
  462 + padding-top: 10px;
  463 +
  464 +}
  465 +.xc-coupon-money1{
  466 + color: #444;
  467 + font-size: 28rpx;
  468 + line-height: 60rpx;
  469 +
  470 +
  471 +}
  472 +.xc-coupon-time{
  473 + height: 50rpx;
  474 + font-size: 27rpx;
  475 + color: #a4a4a4;
  476 +}
  477 +.xc-coupon-time .time{
  478 + margin-left: 15rpx;
  479 + font-size: 27rpx;
  480 +}
  481 +.xc-coupon-selection{
  482 + height:100%;
  483 +}
  484 +
  485 +.xc-confirm {
  486 + width: 50%;
  487 + border-radius: 50rpx;
  488 + height: 80rpx;
  489 + margin:0 auto;
  490 + background:#d60021;
  491 + color:#fff;
  492 + font-size:28rpx;
  493 + margin-top: 28rpx;
  494 +}
  495 +
  496 +.up{ animation: up .7s; }
  497 +.down{ animation: down 1s; }
  498 +@keyframes up { 0% { transform: translateY(550rpx); } 100% { transform: translateY(0); } }
  499 +@keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } }
  500 +
  501 +.xc-not-Selection{
  502 + width: 40rpx;
  503 +height: 40rpx;
  504 + background: #eeeeee;
  505 +}
  506 +
  507 +
  508 +.xc-close-express{
  509 + width: 40rpx;
  510 +height: 40rpx;
  511 +border-radius: 50%;
  512 +border: 3rpx solid #333;
  513 +text-align: center;
  514 +font-size:32rpx;
  515 +line-height: 38rpx;
  516 +color: #333;
  517 +margin-top: 5rpx;
  518 +}
  519 +.cx-popup .tops{
  520 + width: 100%;
  521 +height: 145rpx;
  522 +border-bottom: 3rpx solid #eee;
  523 +
  524 +}
  525 +.top-content {
  526 + width: 82%;
  527 +padding-top: 33px;
  528 +height: 100%;
  529 +padding-left: 40rpx;
  530 +}
  531 +.close-frame{
  532 + margin-top: 30rpx;
  533 +
  534 +}
  535 +
  536 +.xc-hook {
  537 +width: 33rpx;
  538 +height: 33rpx;
  539 +transform: rotate(-135deg);
  540 +line-height: 35rpx;
  541 +text-align: center;
  542 +margin-right: 20rpx
  543 +
  544 +
  545 +}
  546 +.xc-hooks {
  547 +width: 30rpx;
  548 +height: 30rpx;
  549 +border: 1rpx solid #999;
  550 +margin-right: 20rpx;
  551 +}
  552 +.express_list_frame{
  553 + display: flex;
  554 +height: 80rpx;
  555 +align-items: center;
  556 +padding-left: 40rpx;
  557 +border-bottom: 1rpx solid #eee;
  558 +
  559 +}
  560 +.express_list{
  561 + width: 100%;
  562 + height: 65%;
  563 + overflow-y: auto;
  564 + margin-bottom: 40rpx;
  565 +
  566 +}
  567 +.xc-confirms {
  568 + box-sizing: border-box;
  569 + width: 40%;
  570 + border-radius: 50rpx;
  571 + height: 80rpx;
  572 + margin:0 auto;
  573 + font-size:28rpx;
  574 + background: #fff;
  575 + color: #333;
  576 + border: 2rpx solid #333;
  577 +}
  578 +
  579 +
  580 +/* 优惠券的改版样式 */
  581 +.xc-coupon-frame{
  582 + /* width: 710rpx; */
  583 + width: 100%;
  584 + height:auto;
  585 + margin: 0 auto;
  586 +
  587 +}
  588 +.xc-coupon-frame .coupon-frame{
  589 + width: 100%;
  590 + height: 200rpx;
  591 + margin-top:10rpx;
  592 + border-bottom: 1rpx solid #eee;
  593 +
  594 +}
  595 +.xc-coupon-frame .coupon-frame .coupon-left{
  596 + width: 215rpx;
  597 + height:100%;
  598 + overflow: hidden;
  599 +}
  600 +.xc-money-frames{
  601 + width:96%;
  602 + margin-top: -10px;
  603 +}
  604 +
  605 +.xc-rmb-symbol{
  606 + font-size:40rpx;
  607 +
  608 +}
  609 +
  610 +.xc-rmb-val{
  611 + font-size:60rpx;
  612 +
  613 +}
  614 +.coupon-explain{
  615 + font-size:25rpx;
  616 +width:100%;
  617 +
  618 +
  619 +}
  620 +.xc-valuer{
  621 + margin-top:39rpx;
  622 + margin-left:28rpx;
  623 + font-size:25rpx;
  624 +}
  625 +.coupon-frame .oval{
  626 + width:155rpx;
  627 + height:83rpx;
  628 + border-radius: 50%;
  629 + right:-78rpx;
  630 + top:-37rpx;
  631 +}
  632 +.coupon-right{
  633 + height: 99%;
  634 + border-top: 1rpx solid #eaeaea;
  635 + border-right: 1rpx solid #eaeaea;
  636 + flex-grow: 1;
  637 +}
  638 +.coupon-annotation{
  639 + width: 95%;
  640 + height: 100%;
  641 +
  642 +}
  643 +.xc-brand{
  644 + width:100rpx;
  645 + height:35rpx;
  646 + line-height: 35rpx;
  647 + font-size:21rpx;
  648 + border-radius:10rpx; position: relative; top:-1px;
  649 + margin-right: 8rpx
  650 +}
  651 +.top-frame{
  652 + width:82%;
  653 + height: 75rpx;
  654 + margin-top:10rpx;
  655 +}
  656 +.top-frame .coupon-wode{
  657 + font-size: 25rpx;
  658 + margin-left:10rpx;
  659 + width:340rpx;
  660 + height:88rpx;
  661 +}
  662 +.coupon-code{
  663 + width:60rpx;
  664 + height:60rpx;
  665 + margin-top:5rpx;
  666 +
  667 +}
  668 +.frame{
  669 + width: 100%
  670 +}
  671 +.coupon-time{
  672 + font-size: 23rpx;
  673 + line-height:33rpx;
  674 + color: #333;
  675 +}
  676 +
  677 +.clik-get{
  678 + width:125rpx;
  679 + height:45rpx;
  680 + border-radius: 25rpx;
  681 + line-height: 45rpx;
  682 + font-size:25rpx;
  683 + bottom:67rpx;
  684 + right:6px;
  685 +}
  686 +
  687 +.code-img{
  688 + margin-left:20rpx;
  689 +}
  690 +.bottmo-explain{
  691 +top:145rpx;
  692 +width:94%;
  693 +border-top:1rpx dashed #eee;
  694 +padding-top:8rpx;
  695 +height:38rpx;
  696 +line-height: 51rpx;
  697 +
  698 +}
  699 +.font-word{
  700 + font-size: 22rpx;
  701 +}
  702 +.circle-size{
  703 + background: #a0a0a0;
  704 + width: 27rpx;
  705 + height: 27rpx;
  706 + margin-top:13rpx;
  707 + margin-left:8rpx;
  708 + display: flex;
  709 + align-items: center;
  710 +}
  711 +.xc-jiantou{
  712 + transform: rotate(-90deg);
  713 + color: #fff;
  714 + font-size: 15rpx;
  715 + text-align: center;
  716 + width: 24rpx;
  717 +}
  718 +.xc-buttom{
  719 + box-sizing: border-box;
  720 + width:100%;
  721 + min-height:76rpx;
  722 + height:auto;
  723 + line-height:40rpx;
  724 + border-left:1rpx solid #eee;
  725 + border-right:1rpx solid #eee;
  726 + border-bottom:1rpx solid #eee;
  727 +}
  728 +
  729 +.goods-num{
  730 + font-size: 28rpx;
  731 + color: #333;
  732 +}
  733 +
  734 +.explain-coupon{
  735 + font-size:25rpx;
  736 + padding: 10rpx 10rpx
  737 +}
  738 +.circle-frame{
  739 + width: 20rpx;
  740 + height: auto;
  741 + z-index:1;
  742 + left:210rpx;
  743 +
  744 +}
  745 +.circle-sawtooth{
  746 + width: 11rpx;
  747 + height: 11rpx;
  748 + background: #fff;
  749 +}
  750 +
  751 +.red{background-color: #fe7496;}
  752 +.green{ background-color: #22c7c1;}
  753 +.blue{background-color:#5e82e3;}
  754 +.g_gray{background-color: #aaaaaa}
  755 +
  756 +.f_text{text-align: center; height:96rpx; }
  757 +.xc-hook.sn {
  758 + margin-top:12%;
  759 +width:45rpx;
  760 +height:45rpx;
  761 +font-size:28rpx;
  762 +line-height:44rpx;
  763 +
  764 +
  765 +}
  766 +.xc-hooks.on{
  767 + margin-top:12%;
  768 +width:42rpx;
  769 +height:42rpx;
  770 +}
  771 +.may_use_coupon{
  772 + /* width: 95%; */
  773 + /* height: 68rpx; */
  774 + line-height:78rpx;
  775 + padding: 0 26rpx;
  776 + justify-content: space-between;
  777 + align-items: center;
  778 +}
  779 +.determine-frame{
  780 + width: 100%;
  781 + height: 130rpx;
  782 +
  783 +}
  784 +.xc-determine{
  785 + height: 80rpx;
  786 + width: 40%;
  787 + border-radius: 50rpx;
  788 +background: #d60021;
  789 +color: #fff;
  790 +font-size: 28rpx;
  791 +margin: 0 auto;
  792 +
  793 +}
  794 +.click-buttem{
  795 +width: 90%;
  796 +margin: auto;
  797 +}
  798 +.logistics-name{
  799 + margin-right:20rpx;
  800 +}
  801 +.xc-border{
  802 + border-top:8rpx solid #eee;
  803 +width: 100%
  804 +}
  805 +.main-top{
  806 +margin-top: 20rpx;
  807 +
  808 +}
  809 +.xc-hookts{
  810 +border: 1rpx solid #999;
  811 +
  812 +}
  813 +.xc-hookts.on{
  814 + width:30rpx;
  815 +height:30rpx;
  816 +
  817 +}
  818 +.xc-hookt.sn{
  819 + width: 32rpx;
  820 +height: 32rpx;
  821 +font-size: 28rpx;
  822 +line-height: 34rpx;
  823 +}
  824 +.xc-hookt{
  825 + transform: rotate(-135deg);
  826 +text-align: center;
  827 +
  828 +}
  829 +.main-bottom{
  830 + margin-bottom: 20rpx;
  831 +
  832 +}
  833 +.xc-hookst{
  834 + border: 1rpx solid #999;
  835 +
  836 +}
  837 +.xc-hookst.ons{
  838 + width: 42rpx;
  839 +height: 42rpx;
  840 +margin-left: 20rpx;
  841 +
  842 +}
  843 +.is_use_coupon{
  844 + width: 65%;
  845 +justify-content: flex-end;
  846 +padding-top: 10rpx;
  847 +
  848 +
  849 +}
  850 +.xc-hooka{
  851 + transform: rotate(-135deg);
  852 +text-align: center;
  853 +
  854 +}
  855 +.xc-hooka.sn{
  856 + width: 45rpx;
  857 +height: 45rpx;
  858 +font-size: 28rpx;
  859 +line-height: 44rpx;
  860 +margin-left: 20rpx;
  861 +
  862 +}
  863 +.color-gray{
  864 + color: #808080;
  865 +}
  866 +.n_guige{ display: inline-block; background:rgb(236, 236, 236); color: rgb(63,63,63); padding: 3rpx 10rpx; border-radius: 3rpx }
  867 +.gift_image{ width: 60rpx; height: 60rpx; position: absolute; top: 0; left: 0}
  868 +
  869 +.quan_num_show{ padding: 4rpx 6rpx; background-color:#ea5551; color:#fff; border-radius: 6rpx;margin-left:10rpx;font-size:24rpx;}
  870 +
  871 +.navigator-hover {
  872 + background: none;
  873 + opacity: 1;
  874 +}
  875 +
  876 +.plus_buy{
  877 + background-color: #fff;
  878 + margin:15rpx 0;
  879 + padding: 20rpx 10rpx;
  880 + position: relative;
  881 +}
  882 +
  883 +.card_bg {
  884 + box-sizing: border-box;
  885 + padding: 2rpx 10rpx;
  886 + height: 28rpx;
  887 + border-radius: 26rpx;
  888 + font-size: 18rpx;
  889 + line-height: 28rpx;
  890 + max-width: 210rpx;
  891 + background: #333;
  892 + color: #fff;
  893 + margin-left: 8rpx;
  894 + position:relative;
  895 + top:7rpx;
  896 +}
  897 +
  898 +.card_bg image {
  899 + width: 19rpx;
  900 + height: 19rpx;
  901 + margin-right: 8rpx;
  902 +}
  903 +
  904 +.card_name {
  905 + position: relative;
  906 + top: -4rpx;
  907 + margin-left: 6px;
  908 +}
  909 +
  910 +.car_tri_up {
  911 + width: 0;height: 0;
  912 + border-left: 20rpx solid transparent;
  913 + border-right: 20rpx solid transparent;
  914 + border-bottom: 20rpx solid #fff;
  915 + position: absolute;
  916 + right: 20rpx;
  917 + top:-10rpx
  918 +}
  919 +.card_op{
  920 + position: absolute;
  921 + right: 20rpx;
  922 + top:36rpx
  923 +}
  924 +
packageA/pages/goodsInfo/goodsInfo.js
@@ -34,9 +34,7 @@ Page({ @@ -34,9 +34,7 @@ Page({
34 34
35 data: null, 35 data: null,
36 content: "", //商品详情 36 content: "", //商品详情
37 - comments: null, //商品评论  
38 - c_curr_p: 1, //评论分页  
39 - com_num: 0, //评论人数 37 +
40 gallery: null, //图片滚动 38 gallery: null, //图片滚动
41 is_collect: 0, 39 is_collect: 0,
42 collect_id: 0, 40 collect_id: 0,
@@ -45,8 +43,7 @@ Page({ @@ -45,8 +43,7 @@ Page({
45 optionItemId: 0, 43 optionItemId: 0,
46 goodsInputNum: 1, 44 goodsInputNum: 1,
47 openSpecModal: !1, 45 openSpecModal: !1,
48 - openSpecModal_pt: !1, //拼单的弹起,  
49 - openPromModal: !1, 46 +
50 activeCategoryId: 0, 47 activeCategoryId: 0,
51 supportPageScroll: !1, 48 supportPageScroll: !1,
52 address: { 49 address: {
@@ -108,15 +105,13 @@ Page({ @@ -108,15 +105,13 @@ Page({
108 activity: null 105 activity: null
109 }, 106 },
110 107
111 - //已选的商品(属性)  
112 - sele_g_spec_name: '',  
113 - sele_g_id: '',  
114 - sele_g: null, 108 +
115 //门店相关 109 //门店相关
116 ismend: 0, 110 ismend: 0,
117 is_sec_mend: 0, 111 is_sec_mend: 0,
118 sto_sele_name: "", //选中的门店名称 112 sto_sele_name: "", //选中的门店名称
119 sto_sele_id: "", //选中的门店id 113 sto_sele_id: "", //选中的门店id
  114 + sto_sele_keyid:'', //选中的门店线下
120 sto_sele_distr: "", //选择的门店的配送方式 115 sto_sele_distr: "", //选择的门店的配送方式
121 is_show_sto_cat: 1, //是否显示门店分类 116 is_show_sto_cat: 1, //是否显示门店分类
122 only_pk: null, 117 only_pk: null,
@@ -127,44 +122,17 @@ Page({ @@ -127,44 +122,17 @@ Page({
127 sec_pick_index: 0, //第二级门店选择ID 122 sec_pick_index: 0, //第二级门店选择ID
128 fir_pick_index: 0, //第一级门店选择ID 123 fir_pick_index: 0, //第一级门店选择ID
129 all_pick_list:null,//所有的门店先记录起来 124 all_pick_list:null,//所有的门店先记录起来
130 - //同一条形码的所有商品  
131 - sku_g: null,  
132 - sku_g_pt: null, //---拼单的普通购买--- 125 +
133 //联系电话 126 //联系电话
134 mobile: '', 127 mobile: '',
135 - //分类,品牌,国别名称  
136 - cat_name: '',  
137 - brand_name: '',  
138 - nation_name: '',  
139 -  
140 //商品的活动类型 0普通 1秒杀 2团购 3优惠 4 积分购 6拼单 128 //商品的活动类型 0普通 1秒杀 2团购 3优惠 4 积分购 6拼单
141 - prom_type: 0,  
142 - prom_time_text: "",  
143 - prom_price: null,  
144 - prom_buy_limit: 0,  
145 - djs: null,  
146 - prom_st: 0,  
147 - prom_r_null: 0,  
148 - prom_end_time: null,  
149 - prom_start_time: null,  
150 - prom_act: null,  
151 - pd_xx: 0,  
152 - is_normal: 0, //是否普通购买  
153 - teamgroup: null, //有多少人开团  
154 - grounp_tatal: 0, //有几个人开团  
155 timer: [], 129 timer: [],
156 130
157 //商品的购买次数 131 //商品的购买次数
158 prom_buy_num: -1, 132 prom_buy_num: -1,
159 g_buy_num: null, 133 g_buy_num: null,
160 - prom_goods_num: 0, //活动商品数量  
161 - prom_buy_num: 0, //活动商品购买数量  
162 - prom_redis_num: 0, //活动商品redis数量  
163 -  
164 - //拼单的规则显示  
165 - is_show_gz: 0, 134 +
166 //会员自己的购买的拼单商品的情况 135 //会员自己的购买的拼单商品的情况
167 - user_order_pt_state: 0,  
168 //购买的订单 136 //购买的订单
169 buy_order: null, 137 buy_order: null,
170 //1加入购物车 2立即购买 138 //1加入购物车 2立即购买
@@ -175,11 +143,6 @@ Page({ @@ -175,11 +143,6 @@ Page({
175 isshow: 0, 143 isshow: 0,
176 bconfig: null, //基础配置 144 bconfig: null, //基础配置
177 145
178 - fir_comments: null, //详情页上的评价  
179 - fir_quan: null, //详情页上的券  
180 - quan_list: null, //券列表  
181 -  
182 - coupon: 0,  
183 //会员分享的头像 146 //会员分享的头像
184 share_head: "", 147 share_head: "",
185 share_goods_img: "", 148 share_goods_img: "",
@@ -189,15 +152,6 @@ Page({ @@ -189,15 +152,6 @@ Page({
189 swiperCurrent: 0, //轮播的下标 152 swiperCurrent: 0, //轮播的下标
190 hiddenn: 0, //控制轮播计数显示 153 hiddenn: 0, //控制轮播计数显示
191 154
192 - currentTab: 0, // 选择器控制参数  
193 - mapurl: "",  
194 - mapurl_f_img: "",  
195 - videopicture: 0, //视频图片的控制  
196 -  
197 - video: 0, //视频图片切换器  
198 - index: 0,  
199 - noon: 0, //开始视频的隐藏  
200 -  
201 screenWidth: 0, 155 screenWidth: 0,
202 canvasHidden: 1, 156 canvasHidden: 1,
203 157
@@ -208,8 +162,6 @@ Page({ @@ -208,8 +162,6 @@ Page({
208 is_show_gb: 0, //是否国别 162 is_show_gb: 0, //是否国别
209 is_closecoupon: 0, 163 is_closecoupon: 0,
210 164
211 - //是否点赞中  
212 - iszaning: 0,  
213 165
214 select_store: 0, //选择更多 166 select_store: 0, //选择更多
215 index: 1, 167 index: 1,
@@ -230,51 +182,39 @@ Page({ @@ -230,51 +182,39 @@ Page({
230 default_store: {}, //创建添加默认门店地址的对象 182 default_store: {}, //创建添加默认门店地址的对象
231 183
232 comments_no_more:0, 184 comments_no_more:0,
233 - get_c:0, //获取评价是不是成 185 +
234 is_collect_load:0, //是不是处理 186 is_collect_load:0, //是不是处理
235 is_newsales_rules:0, //是否开启最新的门店规则,此时会新读门店,当点击选择门店时会触发读取线下库存 187 is_newsales_rules:0, //是否开启最新的门店规则,此时会新读门店,当点击选择门店时会触发读取线下库存
236 sales_rules:1, //默认是线上销售 188 sales_rules:1, //默认是线上销售
237 189
238 wait_for_user_store:null, 190 wait_for_user_store:null,
239 - prom_goods:null, //商品优惠列表  
240 - order_prom:null, //订单优惠  
241 - collocationGoods:null, //搭配购  
242 -  
243 poster:null, //自定义海报 191 poster:null, //自定义海报
244 - share_b_img:'', //自定义分享的背景  
245 - 192 + share_b_img:'', //自定义分享的背景
246 showPoster: false, 193 showPoster: false,
247 hui_condition:null, 194 hui_condition:null,
248 sto_sele_name_1:'',//分享的门店名称 195 sto_sele_name_1:'',//分享的门店名称
249 - 196 +
250 }, 197 },
251 198
252 //------初始化加载---------- 199 //------初始化加载----------
253 onLoad: function(t) { 200 onLoad: function(t) {
254 - // wx.setNavigationBarTitle({  
255 - // title: "商品详情",  
256 - // }) 201 +
257 var ee = this, 202 var ee = this,
258 that = ee, 203 that = ee,
259 th = ee, 204 th = ee,
260 gid = t.goods_id, 205 gid = t.goods_id,
261 - first_leader=t.first_leader,  
262 - room_id=t.room_id,  
263 - room_user_share=t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id  
264 - 206 + first_leader=t.first_leader;
  207 +
265 //-- 自定义海报 -- 208 //-- 自定义海报 --
266 getApp().request.promiseGet("/api/weshop/goods/poster/page", { 209 getApp().request.promiseGet("/api/weshop/goods/poster/page", {
267 data:{store_id:os.stoid, type:1, is_use:1} 210 data:{store_id:os.stoid, type:1, is_use:1}
268 }).then(res=>{ 211 }).then(res=>{
269 - if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0]){  
270 - 212 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0]){
271 var poster_data=res.data.data.pageData[0]; 213 var poster_data=res.data.data.pageData[0];
272 - var json_str=poster_data.jsonStr;  
273 - 214 + var json_str=poster_data.jsonStr;
274 if(json_str){ 215 if(json_str){
275 var json_data=JSON.parse(json_str); 216 var json_data=JSON.parse(json_str);
276 - if(json_data.bg_img){  
277 - 217 + if(json_data.bg_img){
278 //-- 把图片那到本地 -- 218 //-- 把图片那到本地 --
279 wx.getImageInfo({ 219 wx.getImageInfo({
280 src:json_data.bg_img, 220 src:json_data.bg_img,
@@ -285,8 +225,7 @@ Page({ @@ -285,8 +225,7 @@ Page({
285 fail: function(res) {} 225 fail: function(res) {}
286 }); 226 });
287 } 227 }
288 - th.setData({poster:json_data})  
289 - 228 + th.setData({poster:json_data})
290 } 229 }
291 } 230 }
292 }) 231 })
@@ -308,9 +247,7 @@ Page({ @@ -308,9 +247,7 @@ Page({
308 247
309 } 248 }
310 ee.setData({ gid: gid}); 249 ee.setData({ gid: gid});
311 - if(first_leader){  
312 - console.log("log---".first_leader);  
313 - 250 + if(first_leader){
314 getApp().globalData.first_leader=first_leader; 251 getApp().globalData.first_leader=first_leader;
315 //调用接口判断是不是会员 252 //调用接口判断是不是会员
316 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{ 253 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
@@ -319,16 +256,6 @@ Page({ @@ -319,16 +256,6 @@ Page({
319 } 256 }
320 }) 257 })
321 } 258 }
322 -  
323 - //-- 如果有房间号 --  
324 - if(room_id){  
325 - getApp().globalData.room_id=room_id;  
326 - getApp().globalData.room_goods_id=gid;  
327 - //如果是会员分享过来的要记录  
328 - if(room_user_share)  
329 - getApp().globalData.room_user_share=room_user_share;  
330 - }  
331 -  
332 var c_guide_id=t.c_guide_id; 259 var c_guide_id=t.c_guide_id;
333 if(c_guide_id){ 260 if(c_guide_id){
334 th.data.c_guide_id=c_guide_id; 261 th.data.c_guide_id=c_guide_id;
@@ -340,75 +267,19 @@ Page({ @@ -340,75 +267,19 @@ Page({
340 267
341 //----获取系统参数----- 268 //----获取系统参数-----
342 getApp().getConfig2(function(e) { 269 getApp().getConfig2(function(e) {
343 - ee.setData({  
344 - bconfig: e,  
345 - sales_rules:e.sales_rules,  
346 - });  
347 -  
348 - if (e.categoryset.indexOf("," + 1 + ",") != -1) {  
349 - ee.setData({  
350 - is_show_pl: 1  
351 - });  
352 - }  
353 - if (e.categoryset.indexOf("," + 3 + ",") != -1) {  
354 - ee.setData({  
355 - is_show_pp: 1  
356 - });  
357 - }  
358 - if (e.categoryset.indexOf("," + 2 + ",") != -1) {  
359 - ee.setData({  
360 - is_show_gb: 1  
361 - });  
362 - }  
363 - 270 +
364 var json_d = JSON.parse(e.switch_list); 271 var json_d = JSON.parse(e.switch_list);
365 ee.setData({ 272 ee.setData({
366 store_config: e, 273 store_config: e,
367 sys_switch:json_d, 274 sys_switch:json_d,
368 - is_closecoupon: json_d.is_closecoupon,  
369 - is_newsales_rules:json_d.is_newsales_rules  
370 }); 275 });
371 - ee.init(gid);  
372 - //------几人评价-------  
373 - //n.init(th, "", "comments");  
374 - 276 +
  277 +
375 th.requestCardNum(), wx.pageScrollTo && th.setData({ 278 th.requestCardNum(), wx.pageScrollTo && th.setData({
376 supportPageScroll: !0 279 supportPageScroll: !0
377 }); 280 });
378 281
379 - //计算等级价相关  
380 - var swithc_list=e.switch_list;  
381 - var sw_arr=JSON.parse(swithc_list);  
382 - //---如果后台又开等级卡的开关---  
383 - if(sw_arr.rank_switch && sw_arr.rank_switch=="2"){  
384 - th.setData({rank_switch:true});  
385 - //---回调卡的列表---  
386 - th.getPlusCardType(function(ob){  
387 - th.setData({card_list:ob.card_list});  
388 - var ti = setInterval(function () {  
389 - var user = getApp().globalData.userInfo;  
390 - if (!user) return false;  
391 - clearInterval(ti);  
392 -  
393 - if(user.card_field && user['card_expiredate']){  
394 - var str = user['card_expiredate'].replace(/-/g, '/');  
395 - var end = new Date(str);  
396 - end = Date.parse(end) / 1000;  
397 - var now = ut.gettimestamp();  
398 - //--- 判断是等级会员,且在有效期范围内 ---  
399 - if(user.card_field && now<end){  
400 - var card_name=ob.name_map.get(user.card_field);  
401 - if(card_name.length>6) card_name=card_name.substring(0,6);  
402 -  
403 - var is_near_date=0;  
404 - if(end-now<60*60*30*24) is_near_date=1; //如果小于30天  
405 - th.setData({card_field:user.card_field,card_name:card_name,card_list:ob.card_list,is_near_date:is_near_date});  
406 - }  
407 - }  
408 - }, 500)  
409 - })  
410 - }  
411 - 282 +
412 },1); 283 },1);
413 284
414 //获取用户设备信息,屏幕宽度 285 //获取用户设备信息,屏幕宽度
@@ -430,12 +301,9 @@ Page({ @@ -430,12 +301,9 @@ Page({
430 //--定时器推迟一下-- 301 //--定时器推迟一下--
431 setTimeout(function () { 302 setTimeout(function () {
432 if(th.data.data) var g_distr_type=th.data.data.distr_type; 303 if(th.data.data) var g_distr_type=th.data.data.distr_type;
433 - //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--  
434 - if(ee.distr_type!=0 && g_distr_type!=0 && ee.distr_type!=g_distr_type ){  
435 - //th.data.fir_def_store={}; //赋值空对象  
436 - //return false;  
437 - //th.data.fir_def_store.is_no_dis=1;  
438 - ee.is_no_dis=1; 304 + //--如果默认门店不在等级卡的默认们店以内
  305 + if(that.data.storageId!=null && that.data.storageId!="" && that.data.storageId.indexOf(ee.keyid)==-1){
  306 + ee.is_no_dis=1;
439 } 307 }
440 308
441 var appd=getApp().globalData; 309 var appd=getApp().globalData;
@@ -454,7 +322,8 @@ Page({ @@ -454,7 +322,8 @@ Page({
454 def_pick_store: e, 322 def_pick_store: e,
455 sto_sele_name: e.pickup_name, 323 sto_sele_name: e.pickup_name,
456 sto_sele_id: e.pickup_id, 324 sto_sele_id: e.pickup_id,
457 - sto_sele_distr: e.distr_type 325 + sto_sele_distr: e.distr_type,
  326 + sto_sele_keyid:e.keyid,
458 }) 327 })
459 }else{ 328 }else{
460 //要用接口是获取距离,js的计算不准 329 //要用接口是获取距离,js的计算不准
@@ -471,7 +340,8 @@ Page({ @@ -471,7 +340,8 @@ Page({
471 def_pick_store: e, 340 def_pick_store: e,
472 sto_sele_name: e.pickup_name, 341 sto_sele_name: e.pickup_name,
473 sto_sele_id: e.pickup_id, 342 sto_sele_id: e.pickup_id,
474 - sto_sele_distr: e.distr_type 343 + sto_sele_distr: e.distr_type,
  344 + sto_sele_keyid:e.keyid,
475 }) 345 })
476 } 346 }
477 347
@@ -491,7 +361,8 @@ Page({ @@ -491,7 +361,8 @@ Page({
491 def_pick_store: e, 361 def_pick_store: e,
492 sto_sele_name: e.pickup_name, 362 sto_sele_name: e.pickup_name,
493 sto_sele_id: e.pickup_id, 363 sto_sele_id: e.pickup_id,
494 - sto_sele_distr: e.distr_type 364 + sto_sele_distr: e.distr_type,
  365 + sto_sele_keyid:e.keyid,
495 }) 366 })
496 } 367 }
497 } 368 }
@@ -501,186 +372,21 @@ Page({ @@ -501,186 +372,21 @@ Page({
501 }); 372 });
502 373
503 }, 374 },
504 -  
505 //------------程序初始化入口------------- 375 //------------程序初始化入口-------------
506 - async init(gid) {  
507 - var ee = this,  
508 - th = ee,  
509 - gallery = null,  
510 - is_collect = 0,  
511 - collect_id = 0,  
512 - categories3 = ee.data.categories3,  
513 - fir_com = null,  
514 - fir_quan = null,  
515 - mapurl = null,  
516 - mapurl_f_img = null;  
517 -  
518 -  
519 - //------图片滚动----------  
520 - await getApp().request.promiseGet("/api/weshop/goodsimages/page", {  
521 - data: {  
522 - store_id: os.stoid,  
523 - goods_id: gid,  
524 - },  
525 - }).then(res => {  
526 -  
527 - var t = res;  
528 - var g = t.data.data.pageData;  
529 - if (g.length == 0) {  
530 - var ie = {  
531 - "image_url": o.imghost + "/public/images/default_goods_image_240.gif"  
532 - };  
533 - g.push(ie);  
534 - gallery = g;  
535 - return;  
536 - }  
537 - for (var i = 0; i < g.length; i++) {  
538 - if (g[i].image_url.indexOf(o.imghost) == -1)  
539 - g[i].image_url = o.imghost + g[i].image_url;  
540 - }  
541 - gallery = g;  
542 - })  
543 - //------是否收藏----------  
544 - await getApp().request.promiseGet("/api/weshop/goodscollect/page", {  
545 - data: {  
546 - store_id: os.stoid,  
547 - goods_id: gid,  
548 - user_id: oo.user_id,  
549 - }  
550 - }).then(res => {  
551 - var t = res;  
552 - var data = t.data.data.pageData;  
553 - if (data.length > 0) {  
554 - //ee.setData({ is_collect: 1, collect_id: data[0].collect_id, });  
555 - is_collect = 1;  
556 - collect_id = data[0].collect_id;  
557 - }  
558 - })  
559 -  
560 - //------获取评价的统计数量----  
561 - await getApp().request.promiseGet("/api/weshop/comment/countlist/", {  
562 - data: {  
563 - store_id: os.stoid,  
564 - goods_id: gid  
565 - },  
566 - //failRollback: !0,  
567 -  
568 - }).then(res => {  
569 - var t = res;  
570 - var g = t.data.data[0];  
571 - if (g != null && g != undefined) {  
572 - var allnum = g.c0 + g.c1 + g.c2 + g.c3 + g.c4 + g.c5;  
573 - var num2 = g.c4 + g.c5;  
574 - var num3 = g.c3;  
575 - var num4 = g.c0 + g.c1 + g.c2;  
576 -  
577 - var dd = ee.data.categories3;  
578 - dd[0].num = allnum;  
579 - dd[1].num = g.cimg;  
580 - dd[2].num = num2;  
581 - dd[3].num = num3;  
582 - dd[4].num = num4;  
583 -  
584 - categories3 = dd;  
585 - }  
586 - })  
587 -  
588 - //----获取详情页的评价----  
589 - await getApp().request.promiseGet("/api/weshop/comment/pageComment", {  
590 - data: {  
591 - store_id: os.stoid,  
592 - goods_id: gid,  
593 - pageSize: 3,  
594 - parent_id: 0,  
595 - page:1,  
596 - is_show:1,  
597 - },  
598 - }).then(res => {  
599 - fir_com = res.data.data.pageData;  
600 - })  
601 -  
602 - if (fir_com) {  
603 - for (var ind in fir_com) {  
604 - if (fir_com[ind].head_pic == "") fir_com[ind].head_pic = ee.data.iurl + "/miniapp/images/hui_hear_pic.png";  
605 - if (fir_com[ind].img) fir_com[ind].img = ut.unserialize(fir_com[ind].img);  
606 - if (fir_com[ind].weapp_img) fir_com[ind].weapp_img = JSON.parse(fir_com[ind].weapp_img);  
607 - }  
608 - }  
609 -  
610 - if (th.data.is_closecoupon != 1) {  
611 - //----获取详情页的券的数量----  
612 - await getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", {  
613 - data: {  
614 - store_id: os.stoid,  
615 - type: 1,  
616 - pageSize: 3,  
617 - page: 1,  
618 - is_share:0,  
619 - },  
620 - }).then(res1 => {  
621 - fir_quan = res1.data.data.pageData;  
622 - })  
623 - }  
624 -  
625 - //--------获取视频图片---------  
626 - // await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, {  
627 - // 1: 1  
628 - // }).then(res1 => {  
629 - // if (res1.data.code == 0) {  
630 - // mapurl = res1.data.data.video_url;  
631 - // mapurl_f_img = res1.data.data.video_img;  
632 - // }  
633 - // })  
634 -  
635 - ee.setData({  
636 - gallery: gallery,  
637 - is_collect: is_collect,  
638 - collect_id: collect_id,  
639 - categories3: categories3,  
640 - fir_quan: fir_quan,  
641 - fir_comments: fir_com,  
642 - mapurl_f_img: mapurl_f_img,  
643 - mapurl: mapurl,  
644 - });  
645 -  
646 - }, 376 + async init(gid) {},
647 377
648 //---展示--- 378 //---展示---
649 onShow: function() { 379 onShow: function() {
650 - var goods_list = null,th = this,that=this;  
651 -  
652 - //优惠券要实时更新  
653 - getApp().getConfig2(function(e) {  
654 - var json_d = JSON.parse(e.switch_list);  
655 - th.setData({is_closecoupon: json_d.is_closecoupon})  
656 - th.setData({is_open_offline: json_d.is_pricing_open})  
657 - },1)  
658 -  
659 -  
660 - var ui = setInterval(function () {  
661 - goods_list = th.selectComponent("#goods_list");  
662 - if (goods_list) {  
663 - clearInterval(ui);  
664 - goods_list.init();  
665 - return false  
666 - }  
667 - }, 300)  
668 - 380 + var that=this;
669 this.data.is_timer = 1; 381 this.data.is_timer = 1;
670 - var ee = this,  
671 - gid = this.data.gid,  
672 - i = getApp().request;  
673 -  
674 - this.wait_for_store_config(); 382 + var ee = this,gid = this.data.gid, i = getApp().request;
  383 + this.wait_for_store_config();
675 384
676 i.get("/api/weshop/serviceCard/get/" + o.stoid + "/" + ee.data.gid, { 385 i.get("/api/weshop/serviceCard/get/" + o.stoid + "/" + ee.data.gid, {
677 failRollback: !0, 386 failRollback: !0,
678 success: function(t) { 387 success: function(t) {
679 if (t.data.code == 0) { 388 if (t.data.code == 0) {
680 - console.log('xx==><==', t.data.data);  
681 - // let data = {  
682 - // goods_name: t.data.data.serviceName,  
683 - // }; 389 +
684 that.setData({ 390 that.setData({
685 'data.goods_name': t.data.data.serviceName, 391 'data.goods_name': t.data.data.serviceName,
686 'data.shop_price': t.data.data.money, 392 'data.shop_price': t.data.data.money,
@@ -688,188 +394,26 @@ Page({ @@ -688,188 +394,26 @@ Page({
688 'data.serviceContent': t.data.data.serviceContent, 394 'data.serviceContent': t.data.data.serviceContent,
689 'data.image_url': t.data.data.imgUrl, 395 'data.image_url': t.data.data.imgUrl,
690 'data.goods_id': t.data.data.id, 396 'data.goods_id': t.data.data.id,
691 - });  
692 - // self.setData({  
693 - // details: t.data.data,  
694 - // data,  
695 - // });  
696 - // if (t.data.data.is_on_sale != 1) {  
697 - // wx.showModal({  
698 - // title: '商品已经下架',  
699 - // showCancel: !1,  
700 - // complete: function() {  
701 - // wx.navigateBack();  
702 - // }  
703 - // });  
704 - // }  
705 -  
706 - // var timestamp = Date.parse(new Date());  
707 - // timestamp = timestamp / 1000;  
708 - // if (t.data.data.on_time > timestamp) {  
709 - // wx.showModal({  
710 - // title: '商品还未上架',  
711 - // showCancel: !1,  
712 - // complete: function() {  
713 - // wx.navigateBack();  
714 - // }  
715 - // });  
716 - // }  
717 -  
718 - // if (t.data.data.down_time > 0) {  
719 - // if (t.data.data.down_time < timestamp) {  
720 - // wx.showModal({  
721 - // title: '商品已经到期下架',  
722 - // showCancel: !1,  
723 - // complete: function() {  
724 - // wx.navigateBack();  
725 - // }  
726 - // });  
727 - // }  
728 - // }  
729 -  
730 - // ee.check_is_youhui(ee.data.gid);  
731 -  
732 - // t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss');  
733 - // var txt = (t.data.data.shop_price / t.data.data.market_price * 10).toFixed(2).toString();  
734 -  
735 -  
736 - // if(txt != 0) {  
737 - // if(txt.indexOf('.') != -1) {  
738 - // var arrtxt = txt.split('.');  
739 - // if(arrtxt[1].length == 1 && arrtxt[1][0] == 0) {  
740 - // txt = txt.slice(0,-2);  
741 - // };  
742 -  
743 - // if(arrtxt[1].length == 2 && arrtxt[1][1] == 0) {  
744 - // txt = txt.slice(0,-1);  
745 - // };  
746 - // };  
747 - // } else {  
748 - // txt = 0;  
749 - // } 397 + 'data.id': t.data.data.id,
  398 + });
  399 +
750 400
  401 + //-----商品详情---
  402 + if(!t.data.data.serviceContent) t.data.data.serviceContent=" ";
  403 + a.wxParse("content", "html", t.data.data.serviceContent, ee, 6);
  404 + e.wxParseAddFullImageUrl(ee, "content");
  405 +
  406 + //获取重表
  407 + getApp().promiseGet("/api/weshop/serviceItem/list",{
  408 + data:{store_id:o.stoid,service_id:t.data.data.id}
  409 + }).then(res=>{
  410 + if(res.data.code==0){
  411 + var list=res.data.data;
  412 + that.setData({service_list:list})
  413 + }
  414 + })
751 415
752 - // t.data.data['disc'] = txt;  
753 -  
754 - // if (t.data.data.original_img.indexOf(o.imghost) == -1)  
755 - // t.data.data.original_img = o.imghost + t.data.data.original_img;  
756 -  
757 - // if (t.data.data.goods_content == null) t.data.data.goods_content = "";  
758 -  
759 - // //-----商品详情---  
760 - // if(!t.data.data.goods_content) t.data.data.goods_content=" ";  
761 - // a.wxParse("content", "html", t.data.data.goods_content, ee, 6);  
762 - // e.wxParseAddFullImageUrl(ee, "content");  
763 -  
764 - // ee.setData({  
765 - // data: t.data.data,  
766 - // sele_g: t.data.data,  
767 - // userInfo:getApp().globalData.userInfo  
768 - // });  
769 -  
770 -  
771 - // //获取统一条形码,普通商品和优惠促销的商品  
772 - // if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 2 || ee.data.data.prom_type == 3 || ee.data.data.prom_type == 5){  
773 - // //默认门店要拿下门店库存  
774 - // if(that.data.sales_rules==2 && that.data.is_newsales_rules){  
775 - // //获取门店  
776 - // ee.get_sto();  
777 - // //--等待某个值只运行---,这里有可能因为导航的时间太久,而不能计算门店库存  
778 - // getApp().waitfor2(that,"wait_for_user_store","fir_def_store",function(){  
779 - // if(th.data.fir_def_store && th.data.fir_def_store.pickup_id ){  
780 - // var lock=0,plist=null;  
781 - // //先读取门店的lock,采用链式写法,少用await  
782 - // getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{  
783 - // data:{store_id:os.stoid,wareId:ee.data.data.goods_id,storageId:that.data.fir_def_store.pickup_id,pageSize:1000}  
784 - // }).then(res=>{  
785 - // if(res.data.code==0 && res.data.data.total>0){  
786 - // for(var i in res.data.data.pageData)  
787 - // lock+=res.data.data.pageData[i].outQty  
788 - // }  
789 - // //---通过接口获取门店的线下库存信息--  
790 - // return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{  
791 - // data:{storageNos:that.data.fir_def_store.pickup_no,wareIds:encodeURIComponent(th.data.data.erpwareid),storeId:os.stoid}  
792 - // })  
793 - // }).then(res=>{  
794 - // if(res.data.code==0 && res.data.data.total>0){  
795 - // plist=res.data.data.pageData[0];  
796 - // }  
797 - // if(plist && plist.CanOutQty-lock>0){  
798 - // that.data.fir_def_store.CanOutQty=plist.CanOutQty-lock;  
799 - // }else{  
800 - // that.data.fir_def_store.CanOutQty=0;  
801 - // }  
802 - // //--给门店赋值线下库存--  
803 - // th.setData({def_pick_store:that.data.fir_def_store});  
804 - // })  
805 - // }  
806 - // })  
807 - // }else{  
808 - // //获取门店  
809 - // ee.get_sto();  
810 - // }  
811 -  
812 - // ee.get_sku(o.stoid, t.data.data.sku, gid);  
813 - // }  
814 - // else {  
815 - // var gg = "", item = t.data.data;  
816 -  
817 - // if(item.goods_spec=="null" || item.goods_spec==null ) item.goods_spec="";  
818 - // if(item.goods_color=="null" || item.goods_color==null) item.goods_color="";  
819 -  
820 - // if (item.goods_spec != "" && item.goods_color != "") {  
821 - // gg = item.goods_spec + "/" + item.goods_color;  
822 - // } else if (item.goods_spec != "" || item.goods_color != "") {  
823 - // gg = item.goods_spec + item.goods_color;  
824 - // } else {  
825 - // gg = "规格1";  
826 - // }  
827 - // t.data.data.gg = gg;  
828 - // var uu = [];  
829 - // uu.push(t.data.data);  
830 - // ee.setData({  
831 - // sku_g: uu,  
832 - // });  
833 - // }  
834 - // ee.data.g_buy_num = new Map();  
835 - // ee.check_prom(gid, ee.data.data.prom_type, ee.data.data.prom_id);  
836 -  
837 - // var th = ee;  
838 - // if (ee.data.cat_name == '') {  
839 - // //过去国别,分类,品牌的名称  
840 - // i.get("/api/weshop/goodscategory/get/" + o.stoid + "/" + th.data.data.cat_id, {  
841 - // success: function(t) {  
842 - // var dd = t.data.data;  
843 - // if (t.data.code == 0) {  
844 - // th.setData({  
845 - // cat_name: dd.name  
846 - // });  
847 - // }  
848 - // }  
849 - // });  
850 - // //过去国别,分类,品牌的名称  
851 - // i.get("/api/weshop/brand/get/" + o.stoid + "/" + th.data.data.brand_id, {  
852 - // success: function(t) {  
853 - // var dd = t.data.data;  
854 - // if (t.data.code == 0) {  
855 - // th.setData({  
856 - // brand_name: dd.name  
857 - // });  
858 - // }  
859 - // }  
860 - // });  
861 - // //过去国别,分类,品牌的名称  
862 - // i.get("/api/weshop/nation/get/" + o.stoid + "/" + th.data.data.nation_id, {  
863 - // success: function(t) {  
864 - // var dd = t.data.data;  
865 - // if (t.data.code == 0) {  
866 - // th.setData({  
867 - // nation_name: dd.name  
868 - // });  
869 - // }  
870 - // }  
871 - // });  
872 - // } 416 +
873 417
874 } else { 418 } else {
875 wx.showModal({ 419 wx.showModal({
@@ -883,6 +427,7 @@ Page({ @@ -883,6 +427,7 @@ Page({
883 } 427 }
884 }); 428 });
885 this.data.enterAddressPage && (this.data.enterAddressPage = !1); 429 this.data.enterAddressPage && (this.data.enterAddressPage = !1);
  430 + this.get_sto();
886 431
887 }, 432 },
888 enterAddress: function() { 433 enterAddress: function() {
@@ -890,6 +435,7 @@ Page({ @@ -890,6 +435,7 @@ Page({
890 url: "/pages/user/address_list/address_list?operate=selectAddress" 435 url: "/pages/user/address_list/address_list?operate=selectAddress"
891 }); 436 });
892 }, 437 },
  438 +
893 onUnload: function() { 439 onUnload: function() {
894 for(var i = 1; i < 100; i++) { 440 for(var i = 1; i < 100; i++) {
895 clearInterval(i); 441 clearInterval(i);
@@ -945,811 +491,102 @@ Page({ @@ -945,811 +491,102 @@ Page({
945 this.setData({ 491 this.setData({
946 activeCategoryId: 1 492 activeCategoryId: 1
947 }); 493 });
948 -  
949 - if (th.data.cat_name == '') {  
950 - //过去国别,分类,品牌的名称  
951 - i.get("/api/weshop/goodscategory/get/" + o.stoid + "/" + th.data.data.cat_id, {  
952 - success: function(t) {  
953 - var dd = t.data.data;  
954 - if (t.data.code == 0) {  
955 - th.setData({  
956 - cat_name: dd.name  
957 - });  
958 - }  
959 - }  
960 - });  
961 - //过去国别,分类,品牌的名称  
962 - i.get("/api/weshop/brand/get/" + o.stoid + "/" + th.data.data.brand_id, {  
963 - success: function(t) {  
964 - var dd = t.data.data;  
965 - if (t.data.code == 0) {  
966 - th.setData({  
967 - brand_name: dd.name  
968 - });  
969 - }  
970 - }  
971 - });  
972 - //过去国别,分类,品牌的名称  
973 - i.get("/api/weshop/nation/get/" + o.stoid + "/" + th.data.data.nation_id, {  
974 - success: function(t) {  
975 - var dd = t.data.data;  
976 - if (t.data.code == 0) {  
977 - th.setData({  
978 - nation_name: dd.name  
979 - });  
980 - }  
981 - }  
982 - });  
983 - }  
984 - },  
985 -  
986 - //获取redis中的数量  
987 - async getactLen(func) {  
988 - var r_num = 0,  
989 - prom_type = this.data.prom_type,  
990 - prom_id = this.data.prom_id;  
991 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {  
992 - 1: 1  
993 - }).then(res => {  
994 - var em = res;  
995 - if (em.data.code == 0) {  
996 - r_num = em.data.data;  
997 - }  
998 - })  
999 - func(r_num);  
1000 }, 494 },
1001 495
  496 +
1002 //------------加入购物车-------------- 497 //------------加入购物车--------------
1003 addCart: function(t) { 498 addCart: function(t) {
1004 var th = this; 499 var th = this;
1005 var ind = t.currentTarget.dataset.openSpecModal_ind; 500 var ind = t.currentTarget.dataset.openSpecModal_ind;
  501 + var action= t.currentTarget.dataset.action;
1006 if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind; 502 if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind;
1007 - th.setData({ 503 +
  504 + th.setData({
1008 open_ind_store: ind 505 open_ind_store: ind
1009 }); 506 });
1010 - //如果是秒杀的话,要看redis够不够  
1011 - if (this.data.prom_type == 1) {  
1012 - this.getactLen(function(num) {  
1013 - if (num < th.data.goodsInputNum) {  
1014 - getApp().my_warnning("秒杀库存不足!", 0, th);  
1015 - return false;  
1016 - } else {  
1017 - th.add_cart_func(t);  
1018 - }  
1019 - });  
1020 - } else {  
1021 - th.add_cart_func(t);  
1022 - }  
1023 - },  
1024 -  
1025 -  
1026 -  
1027 - //-- 加入购物的函数 --  
1028 - add_cart_func_inte: function(t) {  
1029 - var i = getApp().request;  
1030 - if (oo.user_id == null) {  
1031 - return s.my_warnning("还未登录!", 0, this);  
1032 - }  
1033 - if(!getApp().globalData.userInfo){  
1034 - return s.my_warnning("还未登录!", 0, this);  
1035 - }  
1036 -  
1037 - var e = this,  
1038 - th = e,  
1039 - a = 0,  
1040 - o = this.data.data;  
1041 - a = o.goods_id;  
1042 -  
1043 - //----------添加到购物车时,要判断限购数量,--------  
1044 - e.get_buy_num(o, function(ee) {  
1045 - //---判断商品是否超出限购---  
1046 - if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {  
1047 - if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {  
1048 - wx.showModal({  
1049 - title: '提示',  
1050 - content: '超出商品限购'  
1051 - });  
1052 - return false;  
1053 - }  
1054 - }  
1055 - //---判断商品是否超出活动限购---  
1056 - if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {  
1057 - if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {  
1058 - wx.showModal({  
1059 - title: '提示',  
1060 - content: '超出商品活动限购'  
1061 - });  
1062 - return false;  
1063 - }  
1064 - }  
1065 -  
1066 - if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th);  
1067 - if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined)  
1068 - this.setData({  
1069 - sto_sele_name: ""  
1070 - });  
1071 - if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);  
1072 -  
1073 - //--------------此时操作的数据------------  
1074 - var newd = {  
1075 - goods_id: o.goods_id,  
1076 - goods_num: th.data.goodsInputNum,  
1077 - pick_id: th.data.sto_sele_id,  
1078 - user_id: oo.user_id,  
1079 - store_id: th.data.stoid,  
1080 - goods_price: th.data.prom_price,  
1081 - integral:th.data.prom_integral,  
1082 - member_goods_price: o.shop_price,  
1083 - goods_name: o.goods_name,  
1084 - goods_sn: o.goods_sn,  
1085 - sku: o.sku,  
1086 - };  
1087 -  
1088 - //---是不是从收藏夹出来的---  
1089 - if(th.data.c_guide_id){  
1090 - newd['guide_id'] = th.data.c_guide_id;  
1091 - newd['guide_type']=2;  
1092 - if ("add" == t.currentTarget.dataset.action) newd['guide_type']=3;  
1093 - }else{  
1094 - if(getApp().globalData.guide_id){  
1095 - newd['guide_id'] = getApp().globalData.guide_id;  
1096 - newd['guide_type']=0;  
1097 - if ("add" == t.currentTarget.dataset.action) newd['guide_type']=1;  
1098 - }  
1099 - }  
1100 -  
1101 - //让商品带上房间号  
1102 - //让商品带上房间号  
1103 - if(th.data.sys_switch.is_skuroom_id==1){  
1104 - if(th.data.data.goods_id==getApp().globalData.room_goods_id){  
1105 - newd.room_id=getApp().globalData.room_id;  
1106 - }  
1107 - }else{  
1108 - if(newd.goods_id==getApp().globalData.room_goods_id) newd.room_id=getApp().globalData.room_id;  
1109 - }  
1110 -  
1111 - //如果是积分够,is_integral_normal就要有积分购普通购买字段  
1112 - if(o.prom_type==4){  
1113 - newd.is_integral_normal=1;  
1114 - }  
1115 -  
1116 - //-----如果是秒杀,团购,积分购,拼团-----  
1117 - newd.prom_type = th.data.prom_type;  
1118 - newd.prom_id = th.data.prom_id;  
1119 - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);  
1120 - if (o.store_count <e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);  
1121 -  
1122 -  
1123 - th.add_cart_next(e,t,a,o,newd); //立即购买下一步  
1124 -  
1125 - })  
1126 - },  
1127 -  
1128 - //-- 加入购物的函数 --  
1129 - add_cart_func: function(t) {  
1130 - var i = getApp().request;  
1131 - if (oo.user_id == null) {  
1132 - return s.my_warnning("还未登录!", 0, this);  
1133 - }  
1134 507
1135 - if(!getApp().globalData.userInfo){  
1136 - return s.my_warnning("还未登录!", 0, this); 508 + if(action=="buy"){
  509 + //--------------此时操作的数据------------
  510 + var newd = {
  511 + id: th.data.data.id,
  512 + goods_num: th.data.goodsInputNum,
  513 + pick_id: th.data.sto_sele_id,
  514 + keyid: th.data.sto_sele_keyid,
  515 + };
  516 + newd['pick_name'] = th.data.sto_sele_name;
  517 + newd['guide_id'] = getApp().globalData.guide_id;
  518 + newd['guide_type']=0;
  519 +
  520 + th.buyNow(newd);
1137 } 521 }
1138 522
1139 - var e = this,  
1140 - th = e,  
1141 - a = 0,  
1142 - o = this.data.sele_g;  
1143 - a = o.goods_id;  
1144 -  
1145 - //----------添加到购物车时,要判断限购数量,--------  
1146 - e.get_buy_num(o, function(ee) {  
1147 - //---判断商品是否超出限购---  
1148 - if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {  
1149 - if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {  
1150 - wx.showModal({  
1151 - title: '提示',  
1152 - content: '超出商品限购'  
1153 - });  
1154 - return false;  
1155 - }  
1156 - }  
1157 - //---判断商品是否超出活动限购---  
1158 - if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {  
1159 - if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {  
1160 - wx.showModal({  
1161 - title: '提示',  
1162 - content: '超出商品活动限购'  
1163 - });  
1164 - return false;  
1165 - }  
1166 - }  
1167 -  
1168 - if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th);  
1169 - if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined)  
1170 - this.setData({  
1171 - sto_sele_name: ""  
1172 - });  
1173 - if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);  
1174 -  
1175 - //--------------此时操作的数据------------  
1176 - var newd = {  
1177 - goods_id: o.goods_id,  
1178 - goods_num: th.data.goodsInputNum,  
1179 - pick_id: th.data.sto_sele_id,  
1180 - user_id: oo.user_id,  
1181 - store_id: th.data.stoid,  
1182 - goods_price: o.shop_price,  
1183 - member_goods_price: o.shop_price,  
1184 - goods_name: o.goods_name,  
1185 - goods_sn: o.goods_sn,  
1186 - sku: o.sku,  
1187 - };  
1188 523
1189 - //---是不是从收藏夹出来的---  
1190 - if(th.data.c_guide_id){  
1191 - newd['guide_id'] = th.data.c_guide_id;  
1192 - newd['guide_type']=2;  
1193 - if ("add" == t.currentTarget.dataset.action) newd['guide_type']=3;  
1194 - }else{  
1195 - if(getApp().globalData.guide_id){  
1196 - newd['guide_id'] = getApp().globalData.guide_id;  
1197 - newd['guide_type']=0;  
1198 - if ("add" == t.currentTarget.dataset.action) newd['guide_type']=1;  
1199 - }  
1200 - }  
1201 -  
1202 - //让商品带上房间号  
1203 - //让商品带上房间号  
1204 - if(th.data.sys_switch.is_skuroom_id==1){  
1205 - if(th.data.data.goods_id==getApp().globalData.room_goods_id){  
1206 - newd.room_id=getApp().globalData.room_id;  
1207 - }  
1208 - }else{  
1209 - if(newd.goods_id==getApp().globalData.room_goods_id) newd.room_id=getApp().globalData.room_id;  
1210 - }  
1211 -  
1212 - //如果是积分够,is_integral_normal就要有积分购普通购买字段  
1213 - if(o.prom_type==4){  
1214 - newd.is_integral_normal=1;  
1215 - }  
1216 -  
1217 - //如果有线下取价  
1218 - if(o.offline_price){  
1219 - newd.offline_price=o.offline_price;  
1220 - newd.pricing_type=o.pricing_type;  
1221 - }  
1222 -  
1223 - //-----如果是秒杀,团购,积分购,拼团-----  
1224 - if (th.data.prom_type == 1) {  
1225 - newd.goods_price = th.data.prom_price;  
1226 - newd.member_goods_price = th.data.prom_price,  
1227 - newd.prom_type = th.data.prom_type;  
1228 - newd.prom_id = th.data.prom_id;  
1229 -  
1230 - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);  
1231 - if (o.store_count <e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th); 524 + },
  525 +
  526 + //----------立即购买-----------
  527 + buyNow: function(e) {
  528 + getApp().globalData.service_now=e;
  529 + wx.redirectTo({
  530 + url: "/packageA/pages/cart2_ser/cart2_ser",
  531 + });
  532 + },
  533 + //----------增加购买数量-----------
  534 + addCartNum: function(t) {
  535 + this.checkCartNum(this.data.goodsInputNum + 1);
  536 + },
  537 + //----------减少购买数量-----------
  538 + subCartNum: function(t) {
  539 + this.checkCartNum(this.data.goodsInputNum - 1);
  540 + },
  541 + //----------输入框输入购买数量-----------
  542 + inputCartNum: function(t) {
  543 + this.checkCartNum(Number(t.detail.value));
  544 + },
1232 545
1233 - th.add_cart_next(e,t,a,o,newd); //加入购物车下一步 546 + //------检查数量是不是超出限购------
  547 + checkCartNum: function(t) {
  548 + if(t<=0) return false;
  549 + var th = this;
  550 + th.setData({goodsInputNum:t})
  551 + },
1234 552
1235 - }  
1236 - else if ( th.data.prom_type == 0 || th.data.prom_type == 3 || th.data.prom_type == 2 || th.data.prom_type == 4 || th.data.prom_type == 5) {  
1237 - newd.prom_type = 0;  
1238 - newd.prom_id = 0;  
1239 553
1240 - //---如果是线下门店销售的时候---  
1241 - if(th.data.sales_rules==2){  
1242 - var pick=th.get_pick_from_list(th.data.sto_sele_id)  
1243 - //---通过接口获取门店的线下库存信息--  
1244 - getApp().request.get("/api/weshop/goods/getWareStorages",{  
1245 - data:{storageNos:pick.pickup_no,wareIds:encodeURIComponent(th.data.sele_g.erpwareid),storeId:os.stoid},  
1246 - success:function(res){  
1247 - if(res.data.code==0){  
1248 - if(res.data.data.pageData.length>0){  
1249 - var CanOutQty=res.data.data.pageData[0].CanOutQty;  
1250 - if(CanOutQty<e.data.goodsInputNum){  
1251 - return s.my_warnning("库存不足!", 0, th);  
1252 - }  
1253 - //在调一次接口,读取商品的预出库的数量,lock  
1254 - getApp().request.get("/api/weshop/order/ware/lock/page",{  
1255 - data:{store_id:os.stoid,wareId:th.data.sele_g.goods_id,storageId:pick.pickup_id,pageSize:1000},  
1256 - success:function(res_data){  
1257 - if(res_data.data.code==0 && res_data.data.data.total>0){ 554 + closeSpecModal: function() {
  555 + this.setData({
  556 + openSpecModal: !1,
  557 + openSpecModal_pt: !1
  558 + });
  559 + },
  560 +
  561 + openSpecModel: function(t) {
  562 + var th=this;
  563 + var open_store = t.currentTarget.dataset.ind;
  564 + this.setData({
  565 + store: 0,
  566 + choice_sort_store: 0,
  567 + sort_store: 0,
  568 + open_ind_store: open_store,
  569 + })
  570 + //--先判断会员状态--
  571 + var user_info = getApp().globalData.userInfo;
  572 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  573 + wx.navigateTo({
  574 + url: '/pages/togoin/togoin',
  575 + })
  576 + return false;
  577 + }
1258 578
1259 - var lock=0;  
1260 - for(var i in res_data.data.data.pageData){  
1261 - lock+=res_data.data.data.pageData[i].outQty;  
1262 - } 579 + var ind = t.currentTarget.dataset.ind;
  580 + this.setData({
  581 + openSpecModal: !0,
  582 + openSpecModal_ind: ind,
  583 + });
1263 584
1264 - if(CanOutQty<=lock){  
1265 - return s.my_warnning("库存不足!", 0, th);  
1266 - }  
1267 - th.add_cart_next(e,t,a,o,newd,CanOutQty-lock);  
1268 - }else{  
1269 - th.add_cart_next(e,t,a,o,newd,CanOutQty);  
1270 - }  
1271 - }  
1272 - })  
1273 - }else{  
1274 - return s.my_warnning("库存不足!", 0, th);  
1275 - }  
1276 -  
1277 - }  
1278 - }  
1279 - })  
1280 - }else{  
1281 - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);  
1282 - if (o.store_count <e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);  
1283 - th.add_cart_next(e,t,a,o,newd); //加入购物车下一步  
1284 - }  
1285 - }  
1286 - })  
1287 - },  
1288 -  
1289 - //---加入购物车的最后一步---  
1290 - add_cart_next(e,t,a,o,newd,CanOutQty){  
1291 - var th=this,i=getApp().request;  
1292 - //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------  
1293 - if(o.prom_type!=1 && ((o.prom_type!=6 && o.prom_type!=4) || th.data.is_normal)){  
1294 - var conf=th.data.bconfig;  
1295 - if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']){  
1296 - var s_list=JSON.parse(conf.switch_list);  
1297 - var now=ut.gettimestamp();  
1298 -  
1299 -  
1300 - var str = getApp().globalData.userInfo['card_expiredate'].replace(/-/g, '/');  
1301 - var end = new Date(str);  
1302 - end = Date.parse(end) / 1000;  
1303 -  
1304 - //--如果后台有开启等级价的功能,而且会员的等级没有过期的情况下--  
1305 - if(parseInt(s_list.rank_switch)==2 && end>now){  
1306 - var card_price=o[getApp().globalData.userInfo['card_field']];  
1307 - //如果会员有等级价  
1308 - if(getApp().globalData.userInfo['card_field']!=undefined && getApp().globalData.userInfo['card_field']!=null  
1309 - && getApp().globalData.userInfo['card_field']!="" && card_price>0){  
1310 - newd.goods_price=card_price;  
1311 - newd.member_goods_price=card_price;  
1312 - }  
1313 - }  
1314 - }  
1315 - }  
1316 -  
1317 - //if (this.data.data.goods.is_virtual) return this.buyVirtualGoods(d);  
1318 - if ("add" == t.currentTarget.dataset.action) {  
1319 -  
1320 - if(th.data.prom_goods){  
1321 - newd.prom_type = 3;  
1322 - newd.prom_id = th.data.prom_goods[0].prom_id;  
1323 - }  
1324 -  
1325 - //----先看会员在购物车中是否加入了该商品-----  
1326 - i.get("/api/weshop/cart/page", {  
1327 - data: {  
1328 - store_id: e.data.stoid,  
1329 - user_id: oo.user_id,  
1330 - goods_id: a,  
1331 - pick_id: e.data.sto_sele_id,  
1332 - },  
1333 - success: function(re) {  
1334 -  
1335 - //-------如果购物车中有相关的数据---------  
1336 - if (re.data.data.total > 0) {  
1337 -  
1338 - var item = re.data.data.pageData[0];  
1339 -  
1340 - //判断数量,要看下购物车中有没有该商品  
1341 - if(CanOutQty){  
1342 - if(item.goods_num+ th.data.goodsInputNum>CanOutQty){  
1343 - return s.my_warnning("库存不足!", 0, th);  
1344 - }  
1345 - }else{  
1346 - if(item.goods_num+ th.data.goodsInputNum>o.store_count){  
1347 - return s.my_warnning("库存不足!", 0, th);  
1348 - }  
1349 - }  
1350 -  
1351 - var updata = {  
1352 - id: item.id,  
1353 - goods_num: e.data.goodsInputNum + item.goods_num,  
1354 - goods_price: newd.goods_price,  
1355 - member_goods_price:newd.goods_price,  
1356 - store_id: th.data.stoid,  
1357 - };  
1358 -  
1359 - //---是不是从收藏夹出来的---  
1360 - if(th.data.c_guide_id){  
1361 - updata['guide_id'] = th.data.c_guide_id;  
1362 - updata['guide_type']=3; //加入购物车之后就变成了3  
1363 - }else {  
1364 - if (getApp().globalData.guide_id) {  
1365 - updata['guide_id'] = getApp().globalData.guide_id;  
1366 - updata['guide_type'] = 0;  
1367 - }  
1368 - }  
1369 -  
1370 - i.put("/api/weshop/cart/update", {  
1371 - data: updata,  
1372 - success: function(t) {  
1373 - getApp().my_warnning('加入购物车成功', 1, th, 450);  
1374 - var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;  
1375 - th.setData({  
1376 - cartGoodsNum: c_num  
1377 - });  
1378 - th.closeSpecModal();  
1379 - }  
1380 - });  
1381 - } else {  
1382 -  
1383 -  
1384 - i.post("/api/weshop/cart/save", {  
1385 - data: newd,  
1386 - success: function(t) {  
1387 - getApp().my_warnning('加入购物车成功', 1, th, 450);  
1388 - var c_num = th.data.cartGoodsNum + e.data.goodsInputNum;  
1389 - th.setData({  
1390 - cartGoodsNum: c_num  
1391 - });  
1392 - th.closeSpecModal();  
1393 - }  
1394 - });  
1395 - }  
1396 - }  
1397 - });  
1398 - }  
1399 - //else "exchange" == t.currentTarget.dataset.action ? this.exchange(d) : this.buyNow(d);  
1400 - else {  
1401 -  
1402 - if(th.data.prom_goods){  
1403 - var prom_d=th.data.prom_goods;  
1404 - for(var i in prom_d){  
1405 - //判断活动有俩种条件,0元 1件  
1406 - var condition_t=prom_d[i].prom_type;  
1407 - switch(condition_t) {  
1408 - case 0: //按钱  
1409 - if(newd.goods_price>=condition_t){  
1410 - newd.prom_type = 3;  
1411 - newd.prom_id = prom_d[i].prom_id;  
1412 - }  
1413 - break  
1414 - case 1://按购买数量  
1415 - if(newd.goods_num>=condition_t){  
1416 - newd.prom_type = 3;  
1417 - newd.prom_id = prom_d[i].prom_id;  
1418 - }  
1419 - break;  
1420 - }  
1421 - }  
1422 -  
1423 - }  
1424 -  
1425 - newd['pick_name'] = th.data.sto_sele_name;  
1426 - newd['pick_dis'] = th.data.sto_sele_distr;  
1427 - th.buyNow(newd);  
1428 - }  
1429 - },  
1430 -  
1431 -  
1432 - //----------购买虚拟商品------  
1433 - buyVirtualGoods: function(e) {  
1434 - Object.assign(e, {  
1435 - goods_name: this.data.data.goods.goods_name,  
1436 - spec_name: this.data.select.specName,  
1437 - price: this.data.select.price  
1438 - }), wx.navigateTo({  
1439 - url: "/pages/virtual/buy_step/buy_step?" + t.Obj2Str(e)  
1440 - });  
1441 - },  
1442 - //----------积分兑换---------  
1443 - exchange: function(e) {  
1444 - this.data.shippingCost < 0 || this.data.select.stock <= 0 || wx.navigateTo({  
1445 - url: "/pages/cart/integral/integral?" + t.Obj2Str(e)  
1446 - });  
1447 - },  
1448 -  
1449 -  
1450 - //----------立即购买-----------  
1451 - buyNow: function(e) {  
1452 - // this.data.shippingCost < 0 || this.data.select.stock <= 0 || (Object.assign(e, {  
1453 - // action: "buy_now"  
1454 - // }),  
1455 - s.set_b_now(e);  
1456 - if(e.prom_type==4){  
1457 - var url="/pages/cart/cart2_inte/cart2_inte?is_bnow=1&goods_id=" + e.goods_id;  
1458 - getApp().goto(url);  
1459 - }else{  
1460 - wx.redirectTo({  
1461 - url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id,  
1462 - });  
1463 - }  
1464 - },  
1465 -  
1466 - //----------增加购买数量-----------  
1467 - addCartNum: function(t) {  
1468 - this.checkCartNum(this.data.goodsInputNum + 1);  
1469 - },  
1470 - //----------减少购买数量-----------  
1471 - subCartNum: function(t) {  
1472 - this.checkCartNum(this.data.goodsInputNum - 1);  
1473 - },  
1474 - //----------输入框输入购买数量-----------  
1475 - inputCartNum: function(t) {  
1476 - this.checkCartNum(Number(t.detail.value));  
1477 - },  
1478 -  
1479 - //----------增加购买数量-----------  
1480 - addCartNum_inte: function(t) {  
1481 - this.checkCartNum_inte(this.data.goodsInputNum + 1);  
1482 - },  
1483 - //----------减少购买数量-----------  
1484 - subCartNum_inte: function(t) {  
1485 - this.checkCartNum_inte(this.data.goodsInputNum - 1);  
1486 - },  
1487 - //----------输入框输入购买数量-----------  
1488 - inputCartNum_inte: function(t) {  
1489 - this.checkCartNum_inte(Number(t.detail.value));  
1490 - },  
1491 -  
1492 -  
1493 - //------检查数量是不是超出限购------  
1494 - checkCartNum: function(t) {  
1495 - var th = this;  
1496 - this.data.sele_g = this.data.data;  
1497 - this.get_buy_num(this.data.sele_g, async function() {  
1498 - // this.get_buy_num(this.data.sele_g, async function() {  
1499 -  
1500 - //--判断商品是否超出限购--  
1501 - if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {  
1502 -  
1503 - var gd_buy_num=th.data.g_buy_num.get(th.data.sele_g.goods_id);  
1504 -  
1505 - if (t + gd_buy_num > th.data.sele_g.viplimited) {  
1506 - wx.showModal({  
1507 - title: '超出商品限购',  
1508 - });  
1509 -  
1510 - var num= th.data.sele_g.viplimited-gd_buy_num;  
1511 - if(num<0) num=0;  
1512 - th.setData({goodsInputNum:num})  
1513 - return false;  
1514 - }  
1515 - }  
1516 -  
1517 - //--判断商品是否超出活动限购--  
1518 - if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && !th.data.is_normal) {  
1519 - if (t + th.data.prom_buy_num > th.data.prom_buy_limit) {  
1520 - wx.showModal({  
1521 - title: '超出商品活动限购',  
1522 - });  
1523 -  
1524 - var num=th.data.prom_buy_limit- th.data.prom_buy_num ;  
1525 - if(num<0) num=0;  
1526 - th.setData({goodsInputNum:num})  
1527 - return false;  
1528 - }  
1529 - }  
1530 -  
1531 - if (th.data.sele_g.prom_type == 1 || th.data.sele_g.prom_type == 6) {  
1532 - var redis_num = 0;  
1533 - //------判断活动是否抢光-----  
1534 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +  
1535 - os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, {  
1536 - 1: 1  
1537 - }).then(res => {  
1538 - redis_num = res.data.data;  
1539 - });  
1540 -  
1541 - if (t > redis_num) {  
1542 - wx.showModal({  
1543 - title: '超出商品活动库存',  
1544 - });  
1545 - th.setData({goodsInputNum:redis_num})  
1546 - return false;  
1547 - }  
1548 -  
1549 - }  
1550 -  
1551 - var e = th.data.sele_g.store_count;  
1552 - if(th.data.sales_rules==2){  
1553 - if(!th.data.def_pick_store){  
1554 - wx.showModal({ title: '请选择门店', });  
1555 - return false;  
1556 - }else{  
1557 - e=th.data.def_pick_store.CanOutQty;  
1558 - }  
1559 - }  
1560 -  
1561 - //库存不足,不增加  
1562 - if(e<t){ wx.showModal({ title: '库存不足', });  
1563 - if(e<0) e=0;  
1564 - th.setData({ goodsInputNum: e }); return false;  
1565 - }  
1566 - t > e || 0 == e ? t = e : t < 1 && (t = 1);  
1567 - th.setData({ goodsInputNum: t });  
1568 - th.is_show_more_buy();  
1569 -  
1570 - })  
1571 - },  
1572 -  
1573 - //----- 检查一下积分购的限购之类的问题 -----  
1574 - checkCartNum_inte: function(t) {  
1575 - var th = this;  
1576 - this.get_buy_num(this.data.data, async function() {  
1577 -  
1578 - //--判断商品是否超出限购--  
1579 - if (th.data.g_buy_num != null && th.data.data.viplimited > 0) {  
1580 -  
1581 - var gd_buy_num=th.data.g_buy_num.get(th.data.sele_g.goods_id);  
1582 -  
1583 - if (t + gd_buy_num > th.data.sele_g.viplimited) {  
1584 - wx.showModal({  
1585 - title: '超出商品限购',  
1586 - });  
1587 -  
1588 - var num= th.data.sele_g.viplimited-gd_buy_num;  
1589 - if(num<0) num=0;  
1590 - th.setData({goodsInputNum:num})  
1591 - return false;  
1592 - }  
1593 - }  
1594 -  
1595 - //--判断商品是否超出活动限购--  
1596 - if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {  
1597 - if (t + th.data.prom_buy_num > th.data.prom_buy_limit) {  
1598 - wx.showModal({  
1599 - title: '超出商品活动限购',  
1600 - });  
1601 -  
1602 - var num=th.data.prom_buy_limit- th.data.prom_buy_num ;  
1603 - if(num<0) num=0;  
1604 - th.setData({goodsInputNum:num})  
1605 - return false;  
1606 - }  
1607 - }  
1608 -  
1609 - if (th.data.sele_g.prom_type == 1 || th.data.sele_g.prom_type == 6) {  
1610 - var redis_num = 0;  
1611 - //------判断活动是否抢光-----  
1612 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +  
1613 - os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, {  
1614 - 1: 1  
1615 - }).then(res => {  
1616 - redis_num = res.data.data;  
1617 - });  
1618 -  
1619 - if (t > redis_num) {  
1620 - wx.showModal({  
1621 - title: '超出商品活动库存',  
1622 - });  
1623 - th.setData({goodsInputNum:redis_num})  
1624 - return false;  
1625 - }  
1626 -  
1627 - }  
1628 -  
1629 - var e = th.data.sele_g.store_count;  
1630 - if(th.data.sales_rules==2){  
1631 - if(!th.data.def_pick_store){  
1632 - wx.showModal({ title: '请选择门店', });  
1633 - return false;  
1634 - }else{  
1635 - e=th.data.def_pick_store.CanOutQty;  
1636 - }  
1637 - }  
1638 -  
1639 - //库存不足,不增加  
1640 - if(e<t){ wx.showModal({ title: '库存不足', });  
1641 - if(e<0) e=0;  
1642 - th.setData({ goodsInputNum: e }); return false;  
1643 - }  
1644 - t > e || 0 == e ? t = e : t < 1 && (t = 1);  
1645 - th.setData({ goodsInputNum: t });  
1646 - })  
1647 - },  
1648 -  
1649 -  
1650 - closeSpecModal: function() {  
1651 - if(this.data.openSpecModal_pt && this.data.is_normal){  
1652 - this.get_sto();  
1653 - }  
1654 -  
1655 - this.setData({  
1656 - openSpecModal: !1,  
1657 - openSpecModal_pt: !1  
1658 - });  
1659 - },  
1660 -  
1661 - openSpecModel: function(t) {  
1662 - var th=this;  
1663 - var open_store = t.currentTarget.dataset.ind;  
1664 - this.setData({  
1665 - store: 0,  
1666 - choice_sort_store: 0,  
1667 - sort_store: 0,  
1668 - open_ind_store: open_store,  
1669 - })  
1670 - //--先判断会员状态--  
1671 - var user_info = getApp().globalData.userInfo;  
1672 - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {  
1673 - wx.navigateTo({  
1674 - url: '/pages/togoin/togoin',  
1675 - })  
1676 - return false;  
1677 - }  
1678 -  
1679 - var ind = t.currentTarget.dataset.ind;  
1680 - this.setData({  
1681 - openSpecModal: !0,  
1682 - openSpecModal_ind: ind,  
1683 - });  
1684 -  
1685 - var is_open=th.data.config  
1686 -  
1687 -  
1688 - this.get_off_price();  
1689 -  
1690 - },  
1691 -  
1692 - //----获取线下价格-------  
1693 - get_off_price(){  
1694 - var th=this;  
1695 - //没有开启就返回  
1696 - if(!th.data.is_open_offline) return false;  
1697 - //先看下购买的功能有没有到期  
1698 - getApp().request.promiseGet("/store/storemoduleendtime/page?store_id=" +os.stoid + "&type=6",{}).then(res=>{  
1699 - //未购买  
1700 - if(res.data.code!=0 || !res.data.data || !res.data.data.pageData || !res.data.data.pageData.length){  
1701 - return false;  
1702 - }else{  
1703 - //已经过期  
1704 - var item=res.data.data.pageData[0];  
1705 - if(item.end_time<ut.gettimestamp()){  
1706 - return false;  
1707 - }  
1708 - }  
1709 -  
1710 -  
1711 - var cur_goods=this.data.sele_g;  
1712 - var cur_price=cur_goods.shop_price;  
1713 - if(th.data.card_field && cur_goods[th.data.card_field]>0){  
1714 - cur_price=cur_goods[th.data.card_field];  
1715 - }  
1716 -  
1717 - var user_info = getApp().globalData.userInfo;  
1718 - //获取一下接口,判断是不是有线下接口,必须是普通商品,全局优惠活动也是不行  
1719 - if(cur_goods.prom_type==0 && !this.data.prom_goods){  
1720 - cur_goods.offline_price=null;  
1721 - //如果没有门店,不用计算线下价格  
1722 - var def_pick_store=this.data.def_pick_store;  
1723 - if(!def_pick_store) return false;  
1724 - getApp().request.get("/api/weshop/goods/listWarePrice", {  
1725 - data:{VIPId:encodeURIComponent(user_info.erpvipid),  
1726 - store_id:os.stoid,  
1727 - PickupId:def_pick_store.pickup_id,  
1728 - WareIds:encodeURIComponent(cur_goods.erpwareid)},  
1729 - success:function(res){  
1730 - if(res.data.code==0 && res.data.data && res.data.data.length>0){  
1731 - var datalist=res.data.data;  
1732 - if(datalist[0].WarePrice<cur_price){  
1733 - cur_goods.offline_price=datalist[0].WarePrice; //存储线下活动的价格  
1734 - cur_goods.pricing_type=datalist[0].PriceType; //存储线下活动的类型  
1735 - }  
1736 - }  
1737 - th.setData({sele_g:cur_goods});  
1738 - }  
1739 -  
1740 - })  
1741 - }  
1742 -  
1743 - })  
1744 -  
1745 -  
1746 }, 585 },
1747 586
1748 -  
1749 //---------点击收藏和不收藏------------ 587 //---------点击收藏和不收藏------------
1750 collectGoods: function() { 588 collectGoods: function() {
1751 - var t = this,  
1752 - i = getApp().request; 589 + var t = this,i = getApp().request;
1753 var user_id = s.globalData.user_id; 590 var user_id = s.globalData.user_id;
1754 if (user_id == '') { 591 if (user_id == '') {
1755 getApp().getUserFir(function() {}); 592 getApp().getUserFir(function() {});
@@ -1845,56 +682,10 @@ Page({ @@ -1845,56 +682,10 @@ Page({
1845 } 682 }
1846 }); 683 });
1847 }, 684 },
1848 -  
1849 - previewCommentImgs: function(t) {  
1850 - var e = this.data.comments[t.currentTarget.dataset.cidx].img;  
1851 - var b = e.slice()  
1852 - for(var i in b){  
1853 - b[i] = this.data.iurl + e[i];  
1854 - }  
1855 -  
1856 - wx.previewImage({  
1857 - current: b[t.currentTarget.dataset.id],  
1858 - urls: b  
1859 - });  
1860 - },  
1861 -  
1862 - previewCommentImgs_w: function(t) {  
1863 - var e = this.data.comments[t.currentTarget.dataset.cidx].weapp_img;  
1864 - var b = e.slice()  
1865 - for (var i in b) {  
1866 - b[i] = this.data.iurl + e[i];  
1867 - }  
1868 - wx.previewImage({  
1869 - current: b[t.currentTarget.dataset.id],  
1870 - urls: b  
1871 - });  
1872 - },  
1873 -  
1874 - previewGoodsCommentImgs: function(t) {  
1875 - var e = this,  
1876 - a = this.data.data.comment[t.currentTarget.dataset.cidx].img;  
1877 - a = a.map(function(t) {  
1878 - return e.data.url + t;  
1879 - }), wx.previewImage({  
1880 - current: a[t.currentTarget.dataset.id],  
1881 - urls: a  
1882 - });  
1883 - },  
1884 - closePromModal: function() {  
1885 - this.setData({  
1886 - openPromModal: !1  
1887 - });  
1888 - },  
1889 - openPromModal: function() {  
1890 - this.setData({  
1891 - openPromModal: !0  
1892 - });  
1893 - },  
1894 - 685 +
1895 //--点击分享事件--- 686 //--点击分享事件---
1896 onShareAppMessage: function(t) { 687 onShareAppMessage: function(t) {
1897 - 688 +
1898 var th = this; 689 var th = this;
1899 var price = th.data.data.shop_price; 690 var price = th.data.data.shop_price;
1900 if (th.data.prom_act) { 691 if (th.data.prom_act) {
@@ -1968,308 +759,90 @@ Page({ @@ -1968,308 +759,90 @@ Page({
1968 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; 759 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
1969 }, 760 },
1970 761
1971 - //----------装载同一条形码的商品----------  
1972 - async get_sku(stoid, sku, g_id, is_normal, func) {  
1973 - var tt = this,arrdata=null;  
1974 - var now=ut.gettimestamp();  
1975 -  
1976 - await getApp().request.promiseGet("/api/weshop/goods/page", {  
1977 - data: {  
1978 - store_id: o.stoid,  
1979 - sku: sku,  
1980 - isonsale: 1,  
1981 - is_on_sale: 1,  
1982 - pageSize:500 762 +
  763 + //---------拿出门店分类和门店------------
  764 + get_sto(e) {
  765 + var th = this,that=this;
  766 + var timer_get = setInterval(function() {
  767 + if (th.data.is_get_local_ok == 0) return false;
  768 + var i = getApp().request;
  769 + if (!th.data.data) return false;
  770 + var dd= {
  771 + store_id: o.stoid,
  772 + isstop: 0,
  773 + pageSize: 2000
  774 + }
  775 + //如果有距离的话
  776 + if (th.data.lat != null) {
  777 + dd.lat = th.data.lat;
  778 + dd.lon = th.data.lon;
1983 } 779 }
1984 - }).then(res => {  
1985 - var e = res;  
1986 - if (e.data.code == 0) arrdata = e.data.data.pageData;  
1987 - })  
1988 - if(!arrdata) return fasle; 780 + clearInterval(timer_get);
  781 +
  782 + //如果会员是有默认的门店话
  783 + if(!th.data.def_pick_store && th.data.fir_def_store){
  784 + th.setData({def_pick_store:th.data.fir_def_store});
  785 + }
  786 +
  787 + wx.showLoading({
  788 + title:'加载中.'
  789 + });
  790 + //----------获取门店----------------
  791 + getApp().request.promiseGet("/api/weshop/pickup/list", {
  792 + data: dd,
  793 + }).then(res => {
  794 + var e = res;
  795 + if (e.data.code == 0) {
  796 + //--普通门店排版--
  797 + setTimeout(function(){
  798 + var sto_list=th.data.data.storageId;
  799 + if(sto_list){
  800 + for (var k = 0; k < e.data.data.pageData.length; k++) {
  801 + var it=e.data.data.pageData[k];
  802 + if (sto_list.indexof(it.keyid)==-1) {
  803 + //删除
  804 + e.data.data.pageData.splice(k--, 1);
  805 + }
  806 + }
  807 + }
1989 808
1990 - var arrsku = new Array();  
1991 - var gitem = null;  
1992 - var gb = 1,gg = "";  
1993 - for (var i = 0; i < arrdata.length; i++) {  
1994 - var goodsinfo=arrdata[i],prom=null;  
1995 - if (goodsinfo.goods_id != g_id) {  
1996 - if(goodsinfo.prom_type==1){  
1997 - await getApp().request.promiseGet("/api/ms/flash_sale/get/"+os.stoid+"/"+goodsinfo.prom_id,{  
1998 - }).then(res=>{  
1999 - if(res.data.code==0) prom=res.data.data;  
2000 - })  
2001 - }  
2002 - if(goodsinfo.prom_type==6){  
2003 - await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+goodsinfo.prom_id,{  
2004 - }).then(res=>{  
2005 - if(res.data.code==0) prom=res.data.data;  
2006 - })  
2007 - }  
2008 - }  
2009 - //---如果有活动,不算在一起---  
2010 - if(prom){  
2011 - if(prom.is_end==0 && prom.end_time>now && prom.start_time<now){  
2012 - continue;  
2013 - }  
2014 - }  
2015 -  
2016 - var item = arrdata[i],gg = "";  
2017 - if(item.goods_spec=="null" || item.goods_spec==null) item.goods_spec="";  
2018 - if(item.goods_color=="null" || item.goods_color==null) item.goods_color="";  
2019 -  
2020 - if (item.goods_spec != "" && item.goods_color != "") {  
2021 - gg = item.goods_spec + "/" + item.goods_color;  
2022 - } else if (item.goods_spec != "" || item.goods_color != "") {  
2023 - gg = item.goods_spec + item.goods_color;  
2024 - } else {  
2025 - gg = "规格" + gb;  
2026 - gb++;  
2027 - }  
2028 - item.gg = gg;  
2029 -  
2030 - if(item.spec_img)  
2031 - item.original_img=os.imghost+item.spec_img;  
2032 - else  
2033 - item.original_img=os.imghost+item.original_img;  
2034 -  
2035 -  
2036 - if (item.goods_id == g_id) {  
2037 - gitem = item;  
2038 - } else {  
2039 - arrsku.push(item);  
2040 - }  
2041 - }  
2042 - //-----------排列在最前面-------------  
2043 - arrsku.splice(0, 0, gitem);  
2044 - if (is_normal == 1) {  
2045 - tt.setData({  
2046 - sku_g_pt: arrsku,  
2047 - sele_g: gitem  
2048 - });  
2049 - func();  
2050 - } else {  
2051 - tt.setData({  
2052 - sku_g: arrsku,  
2053 - sele_g: gitem  
2054 - });  
2055 - }  
2056 - },  
2057 -  
2058 - //-----------选择属性的按钮事件----------  
2059 - sele_spec: function(e) {  
2060 - var that=this,ee=this,th=this;  
2061 - var gid = e.currentTarget.dataset.gid;  
2062 - var sku_g = this.data.sku_g;  
2063 - var item = null;  
2064 - for (var i in sku_g) {  
2065 - if (sku_g[i].goods_id == gid) {  
2066 - item = sku_g[i];  
2067 - break  
2068 - }  
2069 - }  
2070 - if (item) this.setData({  
2071 - sele_g: item,  
2072 - gid: gid  
2073 - });  
2074 -  
2075 - that.check_is_youhui(gid)  
2076 -  
2077 - var ty=0;  
2078 -  
2079 - this.get_sto();  
2080 -  
2081 -  
2082 - //默认门店要拿下门店库存  
2083 - if(that.data.sales_rules==2 && that.data.def_pick_store){  
2084 - var lock=0,plist=null;  
2085 - //先读取门店的lock,采用链式写法,少用await  
2086 - getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{  
2087 - data:{store_id:os.stoid,wareId:ee.data.sele_g.goods_id,storageId:that.data.def_pick_store.pickup_id,pageSize:1000}  
2088 - }).then(res=>{  
2089 - if(res.data.code==0 && res.data.data.total>0){  
2090 - for(var i in res.data.data.pageData)  
2091 - lock+=res.data.data.pageData[i].outQty  
2092 - }  
2093 - //---通过接口获取门店的线下库存信息--  
2094 - return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{  
2095 - data:{storageNos:that.data.def_pick_store.pickup_no,wareIds:encodeURIComponent(th.data.sele_g.erpwareid),storeId:os.stoid}  
2096 - })  
2097 - }).then(res=>{  
2098 - if(res.data.code==0 && res.data.data.total>0){  
2099 - plist=res.data.data.pageData[0];  
2100 - }  
2101 - if(plist && plist.CanOutQty-lock>0){  
2102 - that.data.def_pick_store.CanOutQty=plist.CanOutQty-lock;  
2103 - }else{  
2104 - that.data.def_pick_store.CanOutQty=0;  
2105 - }  
2106 - //--给门店赋值线下库存--  
2107 - th.setData({def_pick_store:that.data.def_pick_store});  
2108 - })  
2109 - }  
2110 -  
2111 -  
2112 - this.sele_spec_chech_activity();  
2113 - },  
2114 -  
2115 - //选择了不同的规格的时候要判断是不是有活动正在进行中  
2116 - async sele_spec_chech_activity(){  
2117 - //---如果是活动的时候---  
2118 - var prom=null,goodsinfo=this.data.sele_g,th=this;  
2119 - if(goodsinfo.prom_type==1){  
2120 - await getApp().request.promiseGet("/api/ms/flash_sale/get/"+os.stoid+"/"+goodsinfo.prom_id,{  
2121 - }).then(res=>{  
2122 - if(res.data.code==0){  
2123 - prom=res.data.data;  
2124 - }  
2125 - })  
2126 - }  
2127 - if(goodsinfo.prom_type==6){  
2128 - await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+goodsinfo.prom_id,{  
2129 - }).then(res=>{  
2130 - if(res.data.code==0){  
2131 - prom=res.data.data;  
2132 - }  
2133 - })  
2134 - }  
2135 - //----------如果有活动,并且在进行中,就不计算线下库存---------------  
2136 - var now=ut.gettimestamp();  
2137 - if(prom){  
2138 - if(prom.is_end==0 && prom.end_time>now && prom.start_time<now){  
2139 - th.setData({  
2140 - prom_type:goodsinfo.prom_type,  
2141 - prom_price:prom.price,  
2142 - prom_buy_limit:prom.buy_limit,  
2143 - prom_end_time:prom.end_time,  
2144 - prom_start_time:prom.start_time,  
2145 - prom_st:1,  
2146 - })  
2147 - return false;  
2148 - }  
2149 - }  
2150 - //---设置普通商品---  
2151 - th.setData({  
2152 - prom_type:0,  
2153 - prom_price:null,  
2154 - prom_buy_limit:null,  
2155 - prom_end_time:null,  
2156 - prom_start_time:null,  
2157 - prom_st:null,  
2158 - })  
2159 -  
2160 - },  
2161 -  
2162 -  
2163 - //---------拿出门店分类和门店------------  
2164 - get_sto(e) {  
2165 - var th = this,that=this;  
2166 - var is_normal=e;  
2167 -  
2168 - if(e==1){  
2169 - th.setData({is_normal:1})  
2170 - }else{  
2171 - th.setData({is_normal:0})  
2172 - }  
2173 -  
2174 - var timer_get = setInterval(function() {  
2175 - if (th.data.is_get_local_ok == 0) return false;  
2176 - var dd = null,i = getApp().request;  
2177 - if (!th.data.sele_g) return false;  
2178 -  
2179 - var g_distr_type = th.data.sele_g.distr_type;  
2180 - if (g_distr_type != 0) {  
2181 - dd = {  
2182 - store_id: o.stoid,  
2183 - distr_type: g_distr_type,  
2184 - isstop: 0,  
2185 - pageSize: 2000  
2186 - }  
2187 - } else {  
2188 - dd = {  
2189 - store_id: o.stoid,  
2190 - isstop: 0,  
2191 - pageSize: 2000  
2192 - }  
2193 - }  
2194 - //如果有距离的话  
2195 - if (th.data.lat != null) {  
2196 - dd.lat = th.data.lat;  
2197 - dd.lon = th.data.lon;  
2198 - }  
2199 - clearInterval(timer_get);  
2200 -  
2201 - //如果会员是有默认的门店话  
2202 - if(!th.data.def_pick_store && th.data.fir_def_store){  
2203 - th.setData({def_pick_store:th.data.fir_def_store});  
2204 - }  
2205 -  
2206 - /*--最新的,不用这里筛选配送方式  
2207 - if(th.data.def_pick_store && g_distr_type!=0 && th.data.def_pick_store.distr_type!=0 && th.data.def_pick_store.distr_type!=g_distr_type ){  
2208 - th.setData({def_pick_store:null});  
2209 - }--*/  
2210 -  
2211 -  
2212 - wx.showLoading({  
2213 - title:'加载中.'  
2214 - });  
2215 - //----------获取门店----------------  
2216 - getApp().request.promiseGet("/api/weshop/pickup/list", {  
2217 - data: dd,  
2218 - }).then(res => {  
2219 - var e = res;  
2220 -  
2221 - if (e.data.code == 0) {  
2222 -  
2223 - //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店  
2224 - if(dd.lat && (!th.data.def_pick_store || JSON.stringify(th.data.def_pick_store)=='{}') && th.data.bconfig && th.data.bconfig.is_sort_storage){  
2225 - th.setData({  
2226 - def_pick_store:e.data.data.pageData[0],  
2227 - sto_sele_name: e.data.data.pageData[0].pickup_name,  
2228 - sto_sele_id: e.data.data.pageData[0].pickup_id,  
2229 - sto_sele_distr: e.data.data.pageData[0].distr_type  
2230 - });  
2231 - th.data.fir_def_store=e.data.data.pageData[0];  
2232 - }  
2233 -  
2234 - //-- 如果有默认选择门店的时候,要把默认门店放在第一位,修改不要配送方式的判断 --  
2235 - if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store)!='{}'){  
2236 - for (var k = 0; k < e.data.data.pageData.length; k++) {  
2237 - if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) {  
2238 - e.data.data.pageData.splice(k, 1); //删除  
2239 - break;  
2240 - }  
2241 - }  
2242 - e.data.data.pageData.splice(0, 0, th.data.def_pick_store); //添加  
2243 - }  
2244 -  
2245 -  
2246 - th.setData({all_pick_list:e.data.data.pageData}); 809 + //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店
  810 + if(dd.lat && (!th.data.def_pick_store || JSON.stringify(th.data.def_pick_store)=='{}') && th.data.bconfig && th.data.bconfig.is_sort_storage){
  811 + th.setData({
  812 + def_pick_store:e.data.data.pageData[0],
  813 + sto_sele_name: e.data.data.pageData[0].pickup_name,
  814 + sto_sele_id: e.data.data.pageData[0].pickup_id,
  815 + sto_sele_distr: e.data.data.pageData[0].distr_type
  816 + });
  817 + th.data.fir_def_store=e.data.data.pageData[0];
  818 + }
2247 819
2248 - //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购--  
2249 - if(th.data.sales_rules==2 && !th.data.is_newsales_rules && ((th.data.prom_type!=1 && th.data.prom_type!=6 && th.data.prom_type!=4) || is_normal==1)){  
2250 - setTimeout(function(){  
2251 - th.deal_pickup_dline(e);  
2252 - },800)  
2253 - }else{  
2254 - setTimeout(function(){  
2255 - th.deal_pickup(e); //--普通门店排版--  
2256 - },800)  
2257 - } 820 + //-- 如果有默认选择门店的时候,要把默认门店放在第一位,修改不要配送方式的判断 --
  821 + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store)!='{}'){
  822 + for (var k = 0; k < e.data.data.pageData.length; k++) {
  823 + if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) {
  824 + e.data.data.pageData.splice(k, 1); //删除
  825 + break;
  826 + }
  827 + }
  828 + e.data.data.pageData.splice(0, 0, th.data.def_pick_store); //添加
  829 + }
  830 +
  831 + th.setData({all_pick_list:e.data.data.pageData});
  832 + th.deal_pickup(e);
  833 + },800)
  834 +
2258 } 835 }
2259 }) 836 })
2260 }, 200) 837 }, 200)
2261 -  
2262 }, 838 },
2263 839
2264 840
2265 //------------处理门店--------------- 841 //------------处理门店---------------
2266 deal_pickup(e){ 842 deal_pickup(e){
2267 var th=this; 843 var th=this;
2268 - if(!th.data.sele_g) return false  
2269 -  
2270 - var g_distr_type=th.data.sele_g.distr_type; 844 + if(!th.data.data) return false
2271 wx.hideLoading(); 845 wx.hideLoading();
2272 -  
2273 //单总量超出5个的时候 846 //单总量超出5个的时候
2274 if (e.data.data.total > 5) { 847 if (e.data.data.total > 5) {
2275 getApp().request.get("/api/weshop/storagecategory/page", { 848 getApp().request.get("/api/weshop/storagecategory/page", {
@@ -2288,8 +861,8 @@ Page({ @@ -2288,8 +861,8 @@ Page({
2288 var ishas = 0; 861 var ishas = 0;
2289 //-- 开始就看5个门店 -- 862 //-- 开始就看5个门店 --
2290 for (var k = 0; k < 5; k++) { 863 for (var k = 0; k < 5; k++) {
2291 - if (k == e.data.data.pageData.length) break;  
2292 - def_arr.push(e.data.data.pageData[k]); 864 + if (k == e.data.data.pageData.length) break;
  865 + def_arr.push(e.data.data.pageData[k]);
2293 } 866 }
2294 867
2295 th.setData({ 868 th.setData({
@@ -2368,7 +941,6 @@ Page({ @@ -2368,7 +941,6 @@ Page({
2368 if(newarr.length>0) 941 if(newarr.length>0)
2369 newarr.sort(compare("sort")); 942 newarr.sort(compare("sort"));
2370 943
2371 -  
2372 //----安排其他的分类----- 944 //----安排其他的分类-----
2373 if (qita.length > 0) { 945 if (qita.length > 0) {
2374 var item = { 946 var item = {
@@ -2381,1394 +953,66 @@ Page({ @@ -2381,1394 +953,66 @@ Page({
2381 953
2382 th.setData({ 954 th.setData({
2383 is_show_sto_cat: 1, 955 is_show_sto_cat: 1,
2384 - all_sto: newarr  
2385 - });  
2386 -  
2387 - } else {  
2388 - th.setData({  
2389 - is_show_sto_cat: -1,  
2390 - only_pk: e.data.data.pageData  
2391 - });  
2392 - //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------  
2393 - if (!th.data.def_pick_store) {  
2394 - th.setData({def_pick_store:e.data.data.pageData[0]})  
2395 - }  
2396 - }  
2397 - } else {  
2398 - th.setData({  
2399 - is_show_sto_cat: -1,  
2400 - only_pk: e.data.data.pageData  
2401 - });  
2402 - //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------  
2403 - if (!th.data.def_pick_store) {  
2404 - th.setData({def_pick_store:e.data.data.pageData[0]})  
2405 - }  
2406 -  
2407 - }  
2408 - }  
2409 - });  
2410 - } else {  
2411 - th.setData({  
2412 - is_show_sto_cat: 0,  
2413 - only_pk: e.data.data.pageData  
2414 - });  
2415 - //-----如果没有默认门店,要取第一个门店作为默认店------  
2416 - if (!th.data.def_pick_store && th.data.bconfig && th.data.bconfig.is_sort_storage) {  
2417 - th.setData({  
2418 - def_pick_store:e.data.data.pageData[0],  
2419 - sto_sele_name: e.data.data.pageData[0].pickup_name,  
2420 - sto_sele_id: e.data.data.pageData[0].pickup_id,  
2421 - sto_sele_distr: e.data.data.pageData[0].distr_type  
2422 - })  
2423 - }  
2424 - }  
2425 - },  
2426 -  
2427 - //------------处理线下门店库存--------  
2428 - deal_pickup_dline(e){  
2429 - var pkno=[],th=this;  
2430 - if(!th.data.sele_g) return false;  
2431 -  
2432 - if(this.data.def_pick_store){  
2433 - pkno.push(this.data.def_pick_store.pickup_no);  
2434 - }  
2435 - for(var i in e.data.data.pageData){  
2436 - var item=e.data.data.pageData[i];  
2437 - if(pkno.indexOf(item.pickup_no)<0)  
2438 - pkno.push(item.pickup_no);  
2439 - }  
2440 - var pkno_str=pkno.join(",");  
2441 - var o_plist=e.data.data.pageData;  
2442 - var new_list=[];  
2443 - var is_find_def_store=0;  
2444 -  
2445 -  
2446 - var g_distr_type=th.data.sele_g.distr_type;  
2447 - var lock=[];  
2448 - //先读取门店的lock,采用链式写法,少用await  
2449 - getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{  
2450 - data:{store_id:os.stoid,wareId:th.data.sele_g.goods_id,pageSize:1000}  
2451 - }).then(res=>{  
2452 - if(res.data.code==0 && res.data.data.total>0){  
2453 - lock=res.data.data.pageData  
2454 - }  
2455 - //---通过接口获取门店的线下库存信息--  
2456 - return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{  
2457 - data:{storageNos:pkno_str,wareIds:encodeURIComponent(th.data.sele_g.erpwareid),storeId:os.stoid,pageSize:2000}  
2458 - })  
2459 - }).then(res=>{  
2460 -  
2461 - wx.hideLoading();  
2462 - if(res.data.code==0){  
2463 - if(res.data.data.pageData && res.data.data.pageData.length>0){  
2464 - var plist=res.data.data.pageData;  
2465 - var def_pick_store=th.data.def_pick_store;  
2466 - //以原来的数组为外循环,保证距离的顺序  
2467 - for(var kk in o_plist){  
2468 - for(var ii in plist){  
2469 - //线下的门店小心  
2470 - var n_item=plist[ii];  
2471 - if(n_item.StorageNo==o_plist[kk].pickup_no){  
2472 -  
2473 - //拿到锁库的数量  
2474 - var lock_num=th.find_lock_num(o_plist[kk].pickup_id,lock);  
2475 - //可出库数大于预出库库存的数量,可以判断为有库存  
2476 - if(n_item.CanOutQty>lock_num){  
2477 - o_plist[kk].CanOutQty=n_item.CanOutQty-lock_num;  
2478 - new_list.push(o_plist[kk]);  
2479 - //--如果找到默认门店,同时也应该判断配送方式对不对--  
2480 - if(th.data.fir_def_store && n_item.StorageNo==th.data.fir_def_store.pickup_no && (g_distr_type==0 || th.data.fir_def_store.distr_type==0 || th.data.def_pick_store.distr_type==g_distr_type ) ){  
2481 - th.data.fir_def_store.CanOutQty=n_item.CanOutQty-lock_num;  
2482 - if(def_pick_store.pickup_id==th.data.fir_def_store.pickup_id)  
2483 - th.setData({def_pick_store:th.data.fir_def_store})  
2484 - is_find_def_store=1;  
2485 - }  
2486 - }  
2487 - break;  
2488 - }  
2489 - }  
2490 - }  
2491 -  
2492 - //数据组装下  
2493 - var em={};em.data={};em.data.data={};  
2494 - em.data.data.total=new_list.length;  
2495 - em.data.data.pageData=new_list;  
2496 -  
2497 - //--如果找到默认门店,同时也应该判断配送方式对不对--  
2498 - if(th.data.fir_def_store && !is_find_def_store && th.data.fir_def_store.pickup_id && (g_distr_type==0 || th.data.fir_def_store.distr_type==0 || th.data.def_pick_store.distr_type==g_distr_type ) ){  
2499 - th.data.fir_def_store.CanOutQty=0;  
2500 - //--当选择的门店是客户默认的门店的时候--  
2501 - if(th.data.def_pick_store && th.data.fir_def_store.pickup_id==th.data.def_pick_store.pickup_id) {  
2502 - th.setData({def_pick_store:th.data.fir_def_store});  
2503 - em.data.data.pageData.unshift(th.data.def_pick_store);  
2504 - }else{  
2505 - em.data.data.pageData.splice(1,0,th.data.fir_def_store);  
2506 - }  
2507 - }  
2508 -  
2509 - //---把数组组装进去---  
2510 - th.deal_pickup(em);  
2511 - }else{  
2512 - th.setData({def_pick_store:null,all_sto:null,only_pk:null,def_pickpu_list:null})  
2513 - }  
2514 - }else{  
2515 - th.setData({def_pick_store:null,all_sto:null,only_pk:null,def_pickpu_list:null})  
2516 - }  
2517 - })  
2518 - },  
2519 -  
2520 - find_lock_num(pick_id,lock){  
2521 - var lock_num=0;  
2522 - if(!lock) return 0;  
2523 - if(lock.length<0) return 0;  
2524 - for(var i in lock){  
2525 - if(pick_id==lock[i].pickupId){  
2526 - lock_num+=lock[i].outQty;  
2527 - }  
2528 - }  
2529 - return lock_num;  
2530 - },  
2531 -  
2532 - //----------取货门店被点击的效果------  
2533 - getmendian: function(t) {  
2534 - this.setData({  
2535 - ismend: 1,  
2536 - });  
2537 - },  
2538 -  
2539 - //----------隐藏取货门店,选取门店----------  
2540 - hidemend: function(e) {  
2541 - var pid = e.target.dataset.p_id;  
2542 - var pname = e.target.dataset.p_name;  
2543 - var p_distr_t = e.target.dataset.p_dis;  
2544 - this.setData({  
2545 - ismend: 0,  
2546 - is_sec_mend: 0,  
2547 - sto_sele_id: pid,  
2548 - sto_sele_name: pname,  
2549 - sto_sele_distr: p_distr_t  
2550 - });  
2551 - },  
2552 -  
2553 - //------显示取货2级----------  
2554 - show_sec: function(t) {  
2555 - var index = t.target.dataset.index;  
2556 - var item = this.data.all_sto[index];  
2557 - this.setData({  
2558 - is_sec_mend: 1,  
2559 - sec_sto: item  
2560 - });  
2561 - },  
2562 -  
2563 - //------隐藏取货门店2级----  
2564 - hide_sec_mend: function() {  
2565 - this.setData({  
2566 - is_sec_mend: 0,  
2567 - });  
2568 - },  
2569 -  
2570 - //评论的调用  
2571 - requestComments_new: async function(){  
2572 - var e = this, th = e,ee=e; var tp = e.data.activeCategoryId3;  
2573 - var t = '/api/weshop/comment/pageComment?page=' + e.data.c_curr_p;  
2574 -  
2575 - wx.showLoading();  
2576 - var req_where = {  
2577 - store_id: o.stoid, pageSize: 5,is_show:1,  
2578 - parent_id: 0, goods_id: th.data.gid, commenttype: tp,  
2579 - }  
2580 - if (getApp().globalData.userInfo) {  
2581 - req_where.userId = getApp().globalData.userInfo.user_id;  
2582 - }  
2583 -  
2584 - var rs_data=null;  
2585 - await getApp().request.promiseGet(t, { data: req_where}).then(res=>{  
2586 - var tot = res.data.data.total;  
2587 - e.data.c_curr_p++;  
2588 - e.setData({  
2589 - com_num: tot, //已经有加载  
2590 - });  
2591 - if (res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){  
2592 - rs_data=res.data.data.pageData;  
2593 - }else{  
2594 - th.setData({comments_no_more:1,auto:1});  
2595 - }  
2596 - })  
2597 -  
2598 - if (rs_data){  
2599 - //var cda = th.data.comments;  
2600 - var cda = rs_data,com_data=th.data.comments;  
2601 - for (var ind in cda) {  
2602 - var ep = cda[ind];  
2603 - if (cda[ind].head_pic == '') {  
2604 - cda[ind].head_pic = th.data.iurl + "/miniapp/images/hui_hear_pic.png";  
2605 - }  
2606 - if (ep.weapp_img != "" && ut.isString(ep.weapp_img)) {  
2607 - cda[ind].weapp_img = JSON.parse(ep.weapp_img);  
2608 - }  
2609 - if (ep.img != "" && ut.isString(ep.img)) {  
2610 - cda[ind].img = ut.unserialize(ep.img);  
2611 - }  
2612 -  
2613 - //--测量多有字的宽带,计算有多少行--  
2614 - var widh=ut.measureText(ep.content,30);  
2615 - var lines=widh/712;  
2616 - cda[ind].seeMore=false;  
2617 - if(lines>3) cda[ind].seeMore=true;  
2618 -  
2619 - await getApp().request.promiseGet("/api/weshop/comment/pageComment", {  
2620 - data: {store_id: o.stoid, parent_id: ep.comment_id }  
2621 - }).then(res => {  
2622 - if (res.data.data.pageData && res.data.data.pageData.length > 0) {  
2623 - cda[ind].replay_list = res.data.data.pageData;  
2624 - }  
2625 - })  
2626 - }  
2627 -  
2628 - if (!com_data) com_data = cda;  
2629 - else com_data = com_data.concat(cda);  
2630 -  
2631 - th.setData({ comments: com_data});  
2632 - }  
2633 - th.setData({get_c: 1});  
2634 - wx.hideLoading();  
2635 - },  
2636 -  
2637 - //加载更多是靠这个函数  
2638 - onReachBottom: function() {  
2639 - if (this.data.activeCategoryId == 2){  
2640 - if(!this.data.comments_no_more) this.requestComments_new();  
2641 - }  
2642 -  
2643 - var goods_list = this.selectComponent("#goods_list"); //组件的id  
2644 - if (goods_list) goods_list.get_list();  
2645 - },  
2646 -  
2647 - //--------检查是否活动,活动是否开始,或者是否结束-------  
2648 - async check_prom(gid, prom_type, prom_id) {  
2649 - var ee = this,  
2650 - th = ee;  
2651 - if (prom_type == 3 || prom_type == 0 || prom_type == 2 || prom_type == 5) {  
2652 - this.setData({  
2653 - prom_type: 0,  
2654 - isshow: 1,  
2655 - });  
2656 - return false;  
2657 - }  
2658 -  
2659 -  
2660 -  
2661 - //if (prom_type != 3 && prom_type!=0){  
2662 - //---判断秒杀----  
2663 - if (prom_type == 1) {  
2664 - //-------判断活动是否抢光---------  
2665 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {  
2666 - 1: 1  
2667 - }).then(res => {  
2668 - var em = res;  
2669 - if (em.data.code == 0) {  
2670 -  
2671 - if (em.data.data <= 0) ee.setData({  
2672 - prom_r_null: 1  
2673 - });  
2674 - //拿取价格并且判断时间--  
2675 - getApp().request.get("/api/ms/flash_sale/get/" +  
2676 - os.stoid + "/" + prom_id, {  
2677 - success: function(t) {  
2678 - if (t.data.code != 0) {  
2679 - ee.setData({  
2680 - prom_type: 0,  
2681 - isshow: 1,  
2682 - });  
2683 - ee.get_sku(os.stoid, ee.data.data.sku, gid);  
2684 - return false;  
2685 - }  
2686 - //----已经结束-----  
2687 - if (t.data.data.is_end == 1) {  
2688 - ee.setData({  
2689 - prom_type: 0,  
2690 - isshow: 1,  
2691 - });  
2692 - ee.get_sku(os.stoid, ee.data.data.sku, gid);  
2693 - ee.get_sto();  
2694 - return false;  
2695 - }  
2696 - //----已经过期-----  
2697 - var now = ut.gettimestamp();  
2698 - if (t.data.data.end_time < now) {  
2699 - ee.setData({  
2700 - prom_type: 0,  
2701 - isshow: 1,  
2702 - });  
2703 - ee.get_sku(os.stoid, ee.data.data.sku, gid);  
2704 - return false;  
2705 - }  
2706 -  
2707 - /*-- 还没有开始预热的也不显示 --*/  
2708 - if (t.data.data.show_time > now) {  
2709 - ee.setData({  
2710 - prom_type: 0,  
2711 - isshow: 1,  
2712 - });  
2713 - ee.get_sku(os.stoid, ee.data.data.sku, gid);  
2714 - ee.get_sto();  
2715 - return false;  
2716 - }  
2717 -  
2718 - var t_gd = ee.data.data;  
2719 - var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss");  
2720 - var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss");  
2721 -  
2722 - ee.setData({  
2723 - prom_price: t.data.data.price,  
2724 - prom_type: 1,  
2725 - prom_id: prom_id,  
2726 - prom_buy_limit: t.data.data.buy_limit,  
2727 - prom_act: t.data.data,  
2728 - prom_end_time: prom_end_time,  
2729 - prom_start_time: prom_start_time,  
2730 - isshow: 1,  
2731 - });  
2732 -  
2733 - ee.get_sto();  
2734 -  
2735 -  
2736 - var newTime = ut.gettimestamp();  
2737 - var endTime2 = t.data.data.end_time;  
2738 - var endTime1 = t.data.data.start_time;  
2739 -  
2740 - //---苹果机不兼容---  
2741 - /*----  
2742 - var endTime2 = new Date(prom_end_time).getTime();  
2743 - var endTime1 = new Date(prom_start_time).getTime();----*/  
2744 -  
2745 - if (endTime1 > newTime) {  
2746 - ee.setData({  
2747 - prom_time_text: '距秒杀开始还有'  
2748 - })  
2749 - ee.countDown(endTime1, 0);  
2750 - } else {  
2751 - if (endTime2 > newTime) {  
2752 - ee.setData({  
2753 - prom_time_text: '距秒杀结束还有',  
2754 - prom_st: 1  
2755 - })  
2756 - ee.countDown(endTime2);  
2757 - }  
2758 - }  
2759 - }  
2760 - });  
2761 - }  
2762 - })  
2763 - }  
2764 -  
2765 - if(prom_type==4){  
2766 - //th.setData({is_integral_normal:1});  
2767 - var rdata={  
2768 - store_id:o.stoid,stype:1,stypeup:1,goods_id:gid  
2769 - }  
2770 -  
2771 - var integrals=0;  
2772 - var get_datas= {  
2773 - user_id:getApp().globalData.user_id, store_id:o.stoid,  
2774 - };  
2775 - await getApp().request.promiseGet("/api/weshop/users/getAllPoints", {  
2776 - data: get_datas  
2777 - }).then(res => {  
2778 - if(res.data.code==0){  
2779 - integrals=res.data.data.Integral;  
2780 - }  
2781 - })  
2782 -  
2783 - //获取一下积分活动  
2784 - await getApp().request.promiseGet("/api/weshop/integralbuy/pageIntegralBuyGoodsList", {  
2785 - data: rdata  
2786 - }).then(res => {  
2787 - //调用接口有数据的时候  
2788 - if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0) {  
2789 - var inte_data=res.data.data.pageData[0];  
2790 - var can_integral=(parseFloat(integrals)>=parseFloat(inte_data.integral));  
2791 - ee.setData({  
2792 - prom_price:parseFloat(inte_data.addmoney),  
2793 - prom_integral:parseFloat(inte_data.integral),  
2794 - prom_type: 4,  
2795 - prom_id: inte_data.id,  
2796 - prom_buy_limit: inte_data.limitvipqty,  
2797 - prom_act: inte_data,  
2798 - isshow: 1,  
2799 - can_integral:can_integral,  
2800 - is_shopbuy: parseInt(inte_data.is_shopbuy?inte_data.is_shopbuy:0)  
2801 - });  
2802 - ee.get_sto();  
2803 -  
2804 - }else{  
2805 - ee.setData({prom_type: 0, isshow: 1,});  
2806 - ee.get_sku(os.stoid, ee.data.data.sku, gid);  
2807 - ee.get_sto();  
2808 - return false;  
2809 - }  
2810 - })  
2811 -  
2812 - }  
2813 -  
2814 -  
2815 - //---判断拼单----  
2816 - if (prom_type == 6) {  
2817 - //-------判断活动是否抢光---------  
2818 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {  
2819 - 1: 1  
2820 - }).then(res => {  
2821 - var em = res;  
2822 - if (em.data.code == 0) {  
2823 -  
2824 -  
2825 - if (em.data.data <= 0) ee.setData({  
2826 - prom_r_null: 1  
2827 - });  
2828 - //拿取价格并且判断时间--  
2829 - getApp().request.get("/api/weshop/teamlist/get/" +  
2830 - os.stoid + "/" + prom_id, {  
2831 - success: function(t) {  
2832 - if (t.data.code != 0) {  
2833 - ee.setData({  
2834 - prom_type: 0,  
2835 - isshow: 1,  
2836 - });  
2837 - ee.get_sku(os.stoid, ee.data.data.sku, gid);  
2838 - ee.get_sto();  
2839 - return false;  
2840 - }  
2841 - //----已经结束-----  
2842 - if (t.data.data.is_end == 1) {  
2843 - ee.setData({  
2844 - prom_type: 0,  
2845 - isshow: 1,  
2846 - });  
2847 - ee.get_sku(os.stoid, ee.data.data.sku, gid);  
2848 - return false;  
2849 - }  
2850 - //----已经过期-----  
2851 - var now = ut.gettimestamp();  
2852 - if (t.data.data.end_time < now) {  
2853 - ee.setData({  
2854 - prom_type: 0,  
2855 - isshow: 1,  
2856 - });  
2857 - ee.get_sku(os.stoid, ee.data.data.sku, gid);  
2858 - ee.get_sto();  
2859 - return false;  
2860 - }  
2861 -  
2862 - /*-- 还没有开始预热的也不显示 --*/  
2863 - if (t.data.data.show_time > now) {  
2864 - ee.setData({  
2865 - prom_type: 0,  
2866 - isshow: 1,  
2867 - });  
2868 - ee.get_sku(os.stoid, ee.data.data.sku, gid);  
2869 - ee.get_sto();  
2870 - return false;  
2871 - }  
2872 -  
2873 - //-------查看自己是不是有买过该团的商品,并还为支付,或者在进行中-------  
2874 - getApp().request.get("/api/weshop/order/page", {  
2875 - data: {  
2876 - pt_prom_id: prom_id,  
2877 - user_id: oo.user_id,  
2878 - store_id: os.stoid,  
2879 - pageSize: 1,  
2880 - page: 1  
2881 - },  
2882 - success: function(e) {  
2883 - if (e.data.code == 0 && e.data.data.pageData.length > 0) {  
2884 - var odr = e.data.data.pageData[0];  
2885 - th.data.buy_order = odr;  
2886 - if (odr.pt_status == 0 && odr.order_status == 1) {  
2887 - th.setData({  
2888 - user_order_pt_state: 1  
2889 - });  
2890 - }  
2891 - if (odr.pt_status == 1 && odr.order_status == 1) {  
2892 - if (odr.is_zsorder == 4) {  
2893 - getApp().request.promiseGet("/api/weshop/teamgroup/page/", {  
2894 - data: {  
2895 - store_id: os.stoid,  
2896 - team_id: odr.pt_prom_id,  
2897 - listno: odr.pt_listno  
2898 - }  
2899 - }).then(res => {  
2900 - var now = ut.gettimestamp();  
2901 - if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){  
2902 - var tgr = res.data.data.pageData[0];  
2903 - //如果团的时间已经到了  
2904 - if (now >= tgr.kt_end_time) {  
2905 - th.update_jiti(tgr.id);  
2906 - } else {  
2907 - th.setData({  
2908 - user_order_pt_state: 2  
2909 - });  
2910 - }  
2911 - }  
2912 - })  
2913 -  
2914 - } else {  
2915 - th.setData({  
2916 - user_order_pt_state: 2  
2917 - });  
2918 - }  
2919 - }  
2920 -  
2921 - if (odr.pt_status == 2 && odr.is_zsorder == 4) {  
2922 - th.setData({  
2923 - user_order_pt_state: 3,  
2924 - });  
2925 - th.data.wk_order_id = odr.order_id;  
2926 - }  
2927 - }  
2928 - },  
2929 - });  
2930 -  
2931 - //----------查看阶梯团------------  
2932 - if (t.data.data.ct_rylist != "" && t.data.data.ct_rylist != null && t.data.data.ct_rylist != undefined) {  
2933 - t.data.data.ct_rylist = JSON.parse(t.data.data.ct_rylist);  
2934 - var max_num = 0;  
2935 - t.data.data.ct_rylist.forEach(function(val, ind) {  
2936 - if (parseInt(val.rynum) > max_num) max_num = parseInt(val.rynum);  
2937 - })  
2938 - t.data.data.max_ct_num = max_num;  
2939 - }  
2940 -  
2941 - var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss");  
2942 - var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss");  
2943 - ee.setData({  
2944 - prom_price: t.data.data.price,  
2945 - prom_type: 6,  
2946 - prom_id: prom_id,  
2947 - prom_buy_limit: t.data.data.buy_limit,  
2948 - prom_act: t.data.data,  
2949 - prom_end_time: prom_end_time,  
2950 - prom_start_time: prom_start_time,  
2951 - isshow: 1,  
2952 - });  
2953 -  
2954 - ee.get_sto();  
2955 -  
2956 - var newTime = now;  
2957 - var endTime2 = t.data.data.end_time;  
2958 - var endTime1 = t.data.data.start_time;  
2959 -  
2960 - if (endTime1 > newTime) {  
2961 - ee.setData({  
2962 - prom_time_text: '距拼单开始还剩:'  
2963 - })  
2964 - ee.countDown(endTime1, 0);  
2965 - } else {  
2966 - if (endTime2 > newTime) {  
2967 - ee.setData({  
2968 - prom_time_text: '距拼单结束还剩:',  
2969 - prom_st: 1  
2970 - })  
2971 - ee.countDown(endTime2);  
2972 - }  
2973 - }  
2974 - //-------查看有多少人在开这个团-------  
2975 - th.get_team_group(prom_id);  
2976 - }  
2977 - });  
2978 - }  
2979 - })  
2980 - }  
2981 -  
2982 - },  
2983 -  
2984 - //--获取有多少人在开团--  
2985 - async get_team_group(prom_id) {  
2986 - var teamgroup = [],  
2987 - th = this,  
2988 - grounp_tatal = 0;  
2989 - //如果活动是开团不是商家团  
2990 - if (this.data.prom_act.kttype > 1) {  
2991 - //获取活动从表信息team_id  
2992 - await getApp().request.promiseGet("/api/weshop/teamgroup/page", {  
2993 - data: {  
2994 - store_id: os.stoid,  
2995 - pageSize: 3,  
2996 - page: 1,  
2997 - state: 2,  
2998 - team_id: prom_id  
2999 - }  
3000 - }).then(res => {  
3001 - teamgroup = res.data.data.pageData;  
3002 - grounp_tatal = res.data.data.total;  
3003 - })  
3004 - //获取订单的总数这个接口不能用  
3005 - for (i = 0; i < teamgroup.length; i++) {  
3006 - await getApp().request.promiseGet("/api/weshop/order/page", {  
3007 - data: {  
3008 - store_id: os.stoid,  
3009 - pt_status: 1,  
3010 - pt_listno: teamgroup[i].listno  
3011 - }  
3012 - }).then(res => {  
3013 - var order = res.data.data.pageData;  
3014 - teamgroup[i].open_num = order.length;  
3015 - })  
3016 - await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + teamgroup[i].openvipid, {}).then(res => {  
3017 - var user = res.data.data;  
3018 - teamgroup[i].user = user;  
3019 - })  
3020 - }  
3021 -  
3022 - if (teamgroup.length > 0) {  
3023 - th.setData({  
3024 - teamgroup: teamgroup,  
3025 - grounp_tatal: grounp_tatal  
3026 - });  
3027 - th.countDown2();  
3028 - }  
3029 - }  
3030 - },  
3031 -  
3032 - //---小于10的格式化函数----  
3033 - timeFormat(param) {  
3034 - return param < 10 ? '0' + param : param;  
3035 - },  
3036 -  
3037 - //----倒计时函数-----  
3038 - countDown(time, prom_st) {  
3039 - if (!this.data.is_timer) return false;  
3040 - var th = this;  
3041 - // 获取当前时间,同时得到活动结束时间数组  
3042 - var endTime = time;  
3043 - var newTime = ut.gettimestamp();  
3044 - // 对结束时间进行处理渲染到页面  
3045 - var obj = null;  
3046 - // 如果活动未结束,对时间进行处理  
3047 - if (endTime - newTime > 0) {  
3048 - var time = (endTime - newTime);  
3049 - // 获取天、时、分、秒  
3050 - var day = parseInt(time / (60 * 60 * 24));  
3051 - var hou = parseInt(time % (60 * 60 * 24) / 3600);  
3052 - var min = parseInt(time % (60 * 60 * 24) % 3600 / 60);  
3053 - var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);  
3054 - obj = {  
3055 - day: this.timeFormat(day),  
3056 - hou: this.timeFormat(hou),  
3057 - min: this.timeFormat(min),  
3058 - sec: this.timeFormat(sec)  
3059 - }  
3060 - } else {  
3061 - if (th.data.prom_st == 0) {  
3062 - //var endTime2 = new Date(th.data.prom_end_time).getTime();  
3063 - var endTime2 = th.data.prom_act.end_time;  
3064 - th.setData({  
3065 - prom_time_text: '距结束还剩:',  
3066 - prom_st: 1  
3067 - })  
3068 - setTimeout(function() {  
3069 - th.countDown(endTime2)  
3070 - }, 1000);  
3071 - return false;  
3072 -  
3073 - } else {  
3074 - //活动已结束,全部设置为'00'  
3075 - obj = {  
3076 - day: '00',  
3077 - hou: '00',  
3078 - min: '00',  
3079 - sec: '00'  
3080 - }  
3081 - th.setData({  
3082 - prom_time_text: '活动已经结束:',  
3083 - prom_st: 3  
3084 - })  
3085 - th.setData({  
3086 - djs: obj  
3087 - });  
3088 - return false;  
3089 - }  
3090 - }  
3091 -  
3092 - th.setData({  
3093 - djs: obj  
3094 - });  
3095 - setTimeout(function() {  
3096 - th.countDown(endTime)  
3097 - }, 1000);  
3098 - },  
3099 -  
3100 -  
3101 - //-------------获取购买数量的总函数----------------  
3102 - get_buy_num: function(gd, func) {  
3103 - var map = this.data.g_buy_num,  
3104 - th = this,  
3105 - user_id = getApp().globalData.user_id;  
3106 - if (user_id == null) {  
3107 - map.set(gd.goods_id, 0);  
3108 - th.setData({  
3109 - g_buy_num: map,  
3110 - prom_buy_num: 0,  
3111 - });  
3112 - "function" == typeof func && func();  
3113 - return false;  
3114 - }  
3115 -  
3116 - if (map.has(gd.goods_id)) {  
3117 - "function" == typeof func && func();  
3118 - } else {  
3119 - //----获取商品购买数----  
3120 - getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", {  
3121 - data: {  
3122 - store_id: os.stoid,  
3123 - user_id: user_id,  
3124 - goods_id: gd.goods_id  
3125 - },  
3126 - success: function(t) {  
3127 - if (t.data.code == 0) {  
3128 - var g_buy_num = t.data.data.goodsbuynum;  
3129 - if (gd.prom_type == 1 || gd.prom_type == 2 || gd.prom_type == 4 || gd.prom_type == 6) {  
3130 - //----获取活动购买数----  
3131 - getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", {  
3132 - data: {  
3133 - store_id: os.stoid,  
3134 - user_id: user_id,  
3135 - goods_id: gd.goods_id,  
3136 - prom_type: gd.prom_type,  
3137 - prom_id: gd.prom_id  
3138 - },  
3139 - //-----获取-----  
3140 - success: function(tt) {  
3141 - if (tt.data.code == 0) {  
3142 - map.set(gd.goods_id, g_buy_num);  
3143 - th.setData({  
3144 - g_buy_num: map,  
3145 - prom_buy_num: tt.data.data.goodsbuynum,  
3146 - });  
3147 - "function" == typeof func && func();  
3148 - }  
3149 - }  
3150 - });  
3151 - } else {  
3152 - map.set(gd.goods_id, g_buy_num);  
3153 - th.setData({  
3154 - g_buy_num: map  
3155 - });  
3156 - "function" == typeof func && func();  
3157 - }  
3158 - }  
3159 - }  
3160 - });  
3161 - }  
3162 - },  
3163 -  
3164 - //--拼单推荐的显示---  
3165 - tj_Click: function(e) {  
3166 - var ind = parseInt(e.target.dataset.ind);  
3167 - this.setData({  
3168 - is_show_gz: ind  
3169 - });  
3170 - },  
3171 -  
3172 - //--------拼团玩法显示详情--------  
3173 - show_pt_xx: function(e) {  
3174 - this.setData({  
3175 - pd_xx: 1,  
3176 - })  
3177 - },  
3178 - close_pt_xx: function() {  
3179 - this.setData({  
3180 - pd_xx: 0,  
3181 - })  
3182 - },  
3183 -  
3184 - //--点击弹起拼单--  
3185 - openSpecModel_pt: function(e) {  
3186 -  
3187 -  
3188 - this.setData({ open_ind_store: 4});//拼团直接给4  
3189 -  
3190 -  
3191 - //--先判断会员状态--  
3192 - var user_info = getApp().globalData.userInfo;  
3193 - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {  
3194 - wx.navigateTo({  
3195 - url: '/pages/togoin/togoin',  
3196 - })  
3197 - return false;  
3198 - }  
3199 -  
3200 - var th = this;  
3201 - var ind = parseInt(e.currentTarget.dataset.it);  
3202 - //如果是拼单活动的普通购买  
3203 - if (ind == 1) {  
3204 - //如果拼单的sku data是空的,就要先获取一下  
3205 - if (th.data.sku_g_pt) {  
3206 - th.get_sto(1);  
3207 - th.setData({  
3208 - is_normal: ind,  
3209 - openSpecModal_pt: 1  
3210 - });  
3211 - } else {  
3212 - th.get_sto(1);  
3213 - th.get_sku(o.stoid, th.data.data.sku, th.data.gid, 1, function() {  
3214 - th.setData({  
3215 - is_normal: ind,  
3216 - openSpecModal_pt: 1  
3217 - });  
3218 - });  
3219 - }  
3220 - } else {  
3221 -  
3222 - //拼单商品从这里进,先判断有没有买过商品,  
3223 - getApp().request.get("/api/weshop/order/page", {  
3224 - data: {  
3225 - pt_prom_id: th.data.prom_act.id,  
3226 - user_id: oo.user_id,  
3227 - store_id: os.stoid,  
3228 - pageSize: 1,  
3229 - page: 1  
3230 - },  
3231 - success: function(e) {  
3232 - //--跳转到已经购买的情况--  
3233 - if (e.data.data.pageData.length > 0) {  
3234 - var odr = e.data.data.pageData[0];  
3235 - //还未支付  
3236 - if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) {  
3237 - wx.showModal({  
3238 - title: "您已经购买了该商品待支付中",  
3239 - success: function(a) {  
3240 - if (a.confirm) {  
3241 - wx.navigateTo({  
3242 - url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,  
3243 - });  
3244 - }  
3245 - }  
3246 - });  
3247 - } else if (odr.pt_status == 1 && odr.order_status == 1) {  
3248 -  
3249 - if(this.data.is_go_to_team_show) return false;  
3250 - this.data.is_go_to_team_show=1;  
3251 - wx.showLoading();  
3252 -  
3253 - wx.redirectTo({  
3254 - url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,  
3255 - });  
3256 - } else {  
3257 - th.setData({  
3258 - is_normal: ind,  
3259 - openSpecModal_pt: 1  
3260 - });  
3261 - }  
3262 -  
3263 - } else {  
3264 - th.setData({  
3265 - is_normal: ind,  
3266 - openSpecModal_pt: 1  
3267 - });  
3268 - }  
3269 - }  
3270 - });  
3271 - }  
3272 - },  
3273 -  
3274 - //-----------------拼单生成方法---------------------  
3275 - addCart_pt: function() {  
3276 - var th = this;  
3277 - if (this.data.is_normal == 0) {  
3278 - //看一下有没有起购数,如果有起购数,要计算起购数  
3279 - var qnum = parseFloat(th.data.prom_act.minbuynum);  
3280 - if (qnum > 0 && th.data.goodsInputNum < qnum) {  
3281 - getApp().confirmBox("拼团商品至少要买" + qnum + "件!");  
3282 - return false;  
3283 - }  
3284 -  
3285 - th.addcart_pt_func();  
3286 - } else {  
3287 - th.addcart_pt_func();  
3288 - }  
3289 - },  
3290 -  
3291 - addcart_pt_func: function() {  
3292 - if (oo.user_id == null) {  
3293 - s.my_warnning("还未登录!", 0, this);  
3294 - return;  
3295 - }  
3296 - var e = this,  
3297 - th = e,  
3298 - o = this.data.sele_g;  
3299 - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);  
3300 -  
3301 - //----------添加到购物车时,要判断限购数量,--------  
3302 - e.get_buy_num(o, async function(ee) {  
3303 -  
3304 - //---判断商品是否超出限购---  
3305 - if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {  
3306 - if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {  
3307 - wx.showModal({  
3308 - title: '提示',  
3309 - content: '超出商品限购'  
3310 - });  
3311 -  
3312 - var num=th.data.prom_buy_limit-th.data.prom_buy_num;  
3313 - if(num<0) num=0;  
3314 - th.setData({goodsInputNum:num})  
3315 - return false;  
3316 - }  
3317 - }  
3318 - //---判断商品是否超出活动限购,拼团的普通购买不计算活动的限购---  
3319 - if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && th.data.is_normal!=1) {  
3320 - if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {  
3321 - wx.showModal({  
3322 - title: '提示',  
3323 - content: '超出商品活动限购'  
3324 - });  
3325 -  
3326 - var num=th.data.prom_buy_limit-th.data.prom_buy_num;  
3327 - if(num<0) num=0;  
3328 - th.setData({goodsInputNum:num})  
3329 - return false;  
3330 - }  
3331 - }  
3332 -  
3333 - var redis_num = 0  
3334 - //不是普通购买的时候  
3335 - if(th.data.is_normal!=1){  
3336 - //-------判断活动是否抢光---------  
3337 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/6/" + th.data.sele_g.prom_id, {  
3338 - 1: 1  
3339 - }).then(res => {  
3340 - redis_num = res.data.data;  
3341 - })  
3342 -  
3343 - if (th.data.goodsInputNum > redis_num) {  
3344 - wx.showModal({  
3345 - title: '提示',  
3346 - content: '超出商品活动库存'  
3347 - });  
3348 -  
3349 - th.setData({goodsInputNum:redis_num})  
3350 -  
3351 - return false;  
3352 - }  
3353 - }  
3354 -  
3355 - if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th);  
3356 - if (th.data.goodsInputNum > o.store_count) {  
3357 - th.setData({goodsInputNum:o.store_count})  
3358 - return s.my_warnning("超出商品库存", 0, th);  
3359 - }  
3360 -  
3361 - if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined)  
3362 - this.setData({  
3363 - sto_sele_name: ""  
3364 - });  
3365 - if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);  
3366 - //--------------此时操作的数据------------  
3367 - var newd = {  
3368 - goods_id: o.goods_id,  
3369 - goods_num: th.data.goodsInputNum,  
3370 - pick_id: th.data.sto_sele_id,  
3371 - user_id: oo.user_id,  
3372 - store_id: th.data.stoid,  
3373 - goods_price: o.shop_price,  
3374 - goods_name: o.goods_name,  
3375 - goods_sn: o.goods_sn,  
3376 - sku: o.sku,  
3377 - };  
3378 -  
3379 - //---是不是从收藏夹出来的---  
3380 - if(th.data.c_guide_id){  
3381 - newd['guide_id'] = th.data.c_guide_id;  
3382 - newd['guide_type']=2;  
3383 -  
3384 - }else{  
3385 - if(getApp().globalData.guide_id){  
3386 - newd['guide_id'] = getApp().globalData.guide_id;  
3387 - newd['guide_type']=0;  
3388 -  
3389 - }  
3390 - }  
3391 -  
3392 - //让商品带上房间号  
3393 - if(th.data.sys_switch.is_skuroom_id==1){  
3394 - if(th.data.data.goods_id==getApp().globalData.room_goods_id){  
3395 - newd.room_id=getApp().globalData.room_id;  
3396 - }  
3397 - }else{  
3398 - if(newd.goods_id==getApp().globalData.room_goods_id){  
3399 - newd.room_id=getApp().globalData.room_id;  
3400 - }  
3401 - }  
3402 -  
3403 - //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------  
3404 -  
3405 - if(th.data.is_normal == 1){  
3406 - var conf=th.data.bconfig;  
3407 - if(conf.switch_list){  
3408 - var s_list=JSON.parse(conf.switch_list);  
3409 - //如果后台有开启等级价的功能  
3410 - if(parseInt(s_list.rank_switch)==2){  
3411 - var card_price=o[getApp().globalData.userInfo['card_field']];  
3412 - //如果会员有等级价  
3413 - if(getApp().globalData.userInfo['card_field']!=undefined && getApp().globalData.userInfo['card_field']!=null  
3414 - && getApp().globalData.userInfo['card_field']!="" && card_price>0){  
3415 - newd.goods_price=card_price;  
3416 - }  
3417 - }  
3418 - }  
3419 - }  
3420 -  
3421 -  
3422 - //-----如果是秒杀,团购,积分购,拼团,且不是普通购买-----  
3423 - if (th.data.prom_type == 6 && th.data.is_normal!= 1) {  
3424 - newd.goods_price = th.data.prom_price;  
3425 - newd.prom_type = th.data.prom_type;  
3426 - newd.prom_id = th.data.prom_id;  
3427 - newd.kt_type = th.data.prom_act.kttype; //开团类型  
3428 - newd.is_pt_tz = 0;  
3429 - //th.data.sto_sele_distr=1; //直接用自提的方式提交  
3430 - if (newd.kt_type > 1) {  
3431 - newd.is_pt_tz = 1; //开团类型  
3432 - }  
3433 - if (newd.kt_type == 3) {  
3434 - th.data.sto_sele_distr = 1;  
3435 - }  
3436 -  
3437 - } else if (th.data.prom_type == 3) {  
3438 - newd.prom_type = 0;  
3439 - newd.prom_id = 0;  
3440 - }  
3441 -  
3442 - newd['pick_name'] = th.data.sto_sele_name;  
3443 - newd['pick_dis'] = th.data.sto_sele_distr;  
3444 - newd['is_normal'] = th.data.is_normal;  
3445 -  
3446 - th.buyNow_pt(newd);  
3447 - })  
3448 - },  
3449 - //----------立即购买_pt-----------  
3450 - buyNow_pt: function(e) {  
3451 - s.set_b_now(e);  
3452 - wx.navigateTo({  
3453 - url: "/pages/cart/cart2_pt/cart2_pt?is_bnow=1&goods_id=" + e.goods_id,  
3454 - });  
3455 - },  
3456 -  
3457 - //-------跳转pt商品-------  
3458 - go_to_nopay: function() {  
3459 - var th = this;  
3460 - url="/pages/user/order_detail/order_detail?order_id=" + th.data.buy_order.order_id;  
3461 - getApp().goto(url);  
3462 -  
3463 - },  
3464 - //-------跳转pt teamshow-------  
3465 - go_to_team_show: function() {  
3466 -  
3467 - if(this.data.is_go_to_team_show) return false;  
3468 - this.data.is_go_to_team_show=1;  
3469 - wx.showLoading();  
3470 -  
3471 - var th = this;  
3472 - var url="/pages/team/team_success/team_success?ordersn=" + th.data.buy_order.order_sn;  
3473 - wx.redirectTo({  
3474 - url:url,  
3475 - })  
3476 -  
3477 - },  
3478 -  
3479 - //---拼团倒计时---  
3480 - countDown2() {  
3481 - if (!this.data.is_timer) return false;  
3482 - var th = this;  
3483 - // 获取当前时间,同时得到活动结束时间数组  
3484 - var newTime = ut.gettimestamp();  
3485 - var List = th.data.teamgroup;  
3486 - for (var j = 0; j < List.length; j++) {  
3487 - // 对结束时间进行处理渲染到页面  
3488 - var endTime = List[j].kt_end_time;  
3489 - let obj = null;  
3490 - // 如果活动未结束,对时间进行处理  
3491 - if (endTime - newTime > 0) {  
3492 - let time = (endTime - newTime);  
3493 - // 获取天、时、分、秒  
3494 - let day = parseInt(time / (60 * 60 * 24));  
3495 - let hou = parseInt(time % (60 * 60 * 24) / 3600);  
3496 - let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);  
3497 - let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);  
3498 - obj = {  
3499 - day: this.timeFormat(day),  
3500 - hou: this.timeFormat(hou),  
3501 - min: this.timeFormat(min),  
3502 - sec: this.timeFormat(sec)  
3503 - }  
3504 - } else {  
3505 - //活动已结束,全部设置为'00'  
3506 - obj = {  
3507 - day: '00',  
3508 - hou: '00',  
3509 - min: '00',  
3510 - sec: '00'  
3511 - }  
3512 - }  
3513 - var txt = "timer[" + j + "]";  
3514 - th.setData({  
3515 - [txt]: obj  
3516 - });  
3517 - }  
3518 - setTimeout(th.countDown2, 1000);  
3519 - },  
3520 - //跳转参加团  
3521 - go_cj_team: function(e) {  
3522 - var ind = e.currentTarget.dataset.ind;  
3523 - var item = this.data.teamgroup[ind];  
3524 - var id = item.id;  
3525 - var th = this;  
3526 -  
3527 - getApp().request.get("/api/weshop/order/page", {  
3528 - data: {  
3529 - pt_prom_id: item.team_id,  
3530 - user_id: oo.user_id,  
3531 - store_id: os.stoid,  
3532 - pageSize: 1,  
3533 - page: 1  
3534 - },  
3535 - success: function(e) {  
3536 - if (e.data.code != 0) {  
3537 - getApp().my_warnning("读取订单失败", 0, th);  
3538 - return fasle;  
3539 - }  
3540 - //--跳转到已经购买的情况--  
3541 - if (e.data.data.pageData.length > 0) {  
3542 - var odr = e.data.data.pageData[0];  
3543 - //还未支付  
3544 - if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) {  
3545 - wx.showModal({  
3546 - title: "您已经购买了该商品待支付中",  
3547 - success: function(a) {  
3548 - if (a.confirm) {  
3549 - wx.navigateTo({  
3550 - url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,  
3551 - });  
3552 - } 956 + all_sto: newarr
  957 + });
  958 +
  959 + } else {
  960 + th.setData({
  961 + is_show_sto_cat: -1,
  962 + only_pk: e.data.data.pageData
  963 + });
  964 + //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------
  965 + if (!th.data.def_pick_store) {
  966 + th.setData({def_pick_store:e.data.data.pageData[0]})
3553 } 967 }
3554 - });  
3555 - } else if (odr.pt_status == 1 && odr.order_status == 1) {  
3556 -  
3557 - if(this.data.is_go_to_team_show) return false;  
3558 - this.data.is_go_to_team_show=1;  
3559 - wx.showLoading();  
3560 -  
3561 - wx.redirectTo({  
3562 - url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,  
3563 - }); 968 + }
3564 } else { 969 } else {
3565 - wx.navigateTo({  
3566 - url: "/pages/team/team_show/team_show?tg_id=" + id, 970 + th.setData({
  971 + is_show_sto_cat: -1,
  972 + only_pk: e.data.data.pageData
3567 }); 973 });
3568 - }  
3569 - }  
3570 - //--跳转到参团--  
3571 - else {  
3572 - wx.navigateTo({  
3573 - url: "/pages/team/team_show/team_show?tg_id=" + id,  
3574 - });  
3575 - }  
3576 - }  
3577 - })  
3578 -  
3579 - },  
3580 -  
3581 - //跳到团更多  
3582 - go_t_more: function() {  
3583 - var team_id = this.data.prom_id;  
3584 - wx.navigateTo({  
3585 - url: "/pages/team/team_more/team_more?team_id=" + team_id,  
3586 - });  
3587 - },  
3588 -  
3589 - //--点赞功能--  
3590 - click_zan: function(e) {  
3591 - var com_id = e.currentTarget.dataset.com_id;  
3592 - var item_id = e.currentTarget.dataset.item_id;  
3593 - var app = getApp(),  
3594 - th = this;  
3595 -  
3596 - if (app.globalData.userInfo == null || app.globalData.userInfo == undefined) {  
3597 - app.confirmBox("您还未登录");  
3598 - return false;  
3599 - }  
3600 -  
3601 - var iszan = th.data.comments[item_id].userZanNum;  
3602 - if (this.data.iszaning) return false;  
3603 - this.data.iszaning = 1;  
3604 -  
3605 -  
3606 - app.request.post("/api/weshop/commentZan/save", {  
3607 - data: {  
3608 - store_id: o.stoid,  
3609 - user_id: app.globalData.user_id,  
3610 - goods_id: th.data.gid,  
3611 - comment_id: com_id  
3612 - },  
3613 - success: function(ee) {  
3614 -  
3615 - if (ee.data.code == "-1") {  
3616 - app.my_warnning("不能给自己点赞", 0, th);  
3617 - th.data.iszaning = 0;  
3618 - return;  
3619 - }  
3620 -  
3621 - if (ee.data.code == 0 && iszan != 1) {  
3622 - var num = th.data.comments[item_id].zan_num;  
3623 - num++;  
3624 - var text = "comments[" + item_id + "].zan_num";  
3625 - var text1 = "comments[" + item_id + "].userZanNum";  
3626 - var _errObj = {};  
3627 - _errObj[text] = num;  
3628 - _errObj[text1] = 1;  
3629 - th.setData(_errObj);  
3630 -  
3631 - } else {  
3632 - var num = th.data.comments[item_id].zan_num;  
3633 - num--;  
3634 - var text = "comments[" + item_id + "].zan_num";  
3635 - var text1 = "comments[" + item_id + "].userZanNum";  
3636 - var _errObj = {};  
3637 - _errObj[text] = num;  
3638 - _errObj[text1] = 0;  
3639 - th.setData(_errObj);  
3640 - }  
3641 -  
3642 - setTimeout(function() {  
3643 - th.data.iszaning = 0;  
3644 - }, 500)  
3645 -  
3646 - }  
3647 - })  
3648 - },  
3649 -  
3650 - /*----券的开关---*/  
3651 - switchCoupon: async function(event) {  
3652 - var coupon = event.currentTarget.dataset.coupon;  
3653 - var app = getApp();  
3654 - var url = "/api/weshop/prom/coupon/pageCouponList";  
3655 - var quan_list = this.data.quan_list;  
3656 - var th = this;  
3657 -  
3658 - //当开启,且列表为空的情况下要  
3659 - if (!quan_list && coupon == "1") {  
3660 - wx.showLoading();  
3661 - await app.request.promiseGet(url, {  
3662 - data: {  
3663 - store_id: os.stoid,  
3664 - type: 1,  
3665 - pageSize: 100,  
3666 - page: 1,  
3667 - user_id: app.globalData.user_id,  
3668 - is_share:0  
3669 - }  
3670 - }).then(res => {  
3671 - wx.hideLoading();  
3672 - quan_list = res.data.data.pageData;  
3673 - }) 974 + //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------
  975 + if (!th.data.def_pick_store) {
  976 + th.setData({def_pick_store:e.data.data.pageData[0]})
  977 + }
3674 978
3675 - if (quan_list) {  
3676 - for (var ind in quan_list) {  
3677 - var ep = quan_list[ind];  
3678 - var start = ut.formatTime(ep.use_start_time, "yyyy-MM-dd");  
3679 - var end = ut.formatTime(ep.use_end_time, "yyyy-MM-dd");  
3680 - start = start.replace("00:00:00", "");  
3681 - end = end.replace("00:00:00", "");  
3682 - quan_list[ind].start = start;  
3683 - quan_list[ind].end = end; 979 + }
3684 } 980 }
3685 - }  
3686 -  
3687 - th.setData({  
3688 - coupon: coupon,  
3689 - quan_list: quan_list  
3690 }); 981 });
3691 - } else { 982 + } else {
3692 th.setData({ 983 th.setData({
3693 - coupon: coupon 984 + is_show_sto_cat: 0,
  985 + only_pk: e.data.data.pageData
3694 }); 986 });
  987 + //-----如果没有默认门店,要取第一个门店作为默认店------
  988 + if (!th.data.def_pick_store && th.data.bconfig && th.data.bconfig.is_sort_storage) {
  989 + th.setData({
  990 + def_pick_store:e.data.data.pageData[0],
  991 + sto_sele_name: e.data.data.pageData[0].pickup_name,
  992 + sto_sele_id: e.data.data.pageData[0].pickup_id,
  993 + sto_sele_distr: e.data.data.pageData[0].distr_type
  994 + })
  995 + }
3695 } 996 }
3696 }, 997 },
3697 -  
3698 - //--查看评价--  
3699 - look_pj: function() {  
3700 - this.tabComment();  
3701 - this.doScrollTop();  
3702 - },  
3703 -  
3704 - //-----领取券-----  
3705 - get_quan: function(e) {  
3706 - var cid = e.currentTarget.dataset.cid;  
3707 - var index = e.currentTarget.dataset.ind;  
3708 - var item = this.data.quan_list[index];  
3709 -  
3710 -  
3711 - //--先判断会员状态--  
3712 - var user_info = getApp().globalData.userInfo;  
3713 - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {  
3714 - wx.navigateTo({  
3715 - url: '/pages/togoin/togoin',  
3716 - })  
3717 - return false;  
3718 - }  
3719 -  
3720 -  
3721 - //如果券还在领取中,不能再点  
3722 - if (item.linging == 1) {  
3723 - getApp().my_warnning('领取中..', 0, this);  
3724 - return false; 998 +
  999 + //加载更多是靠这个函数
  1000 + onReachBottom: function() {
  1001 + if (this.data.activeCategoryId == 2){
  1002 + if(!this.data.comments_no_more) this.requestComments_new();
3725 } 1003 }
3726 1004
3727 - //如果领取的次数到了  
3728 - if (item.everyone_num > 0 && item.lqnum >= item.everyone_num) {  
3729 - getApp().my_warnning('领取失败,您已领完该券', 0, this);  
3730 - return false;  
3731 - } 1005 + var goods_list = this.selectComponent("#goods_list"); //组件的id
  1006 + if (goods_list) goods_list.get_list();
  1007 + },
3732 1008
3733 - var lq_num = item.lqnum;  
3734 1009
3735 - var pdata = {  
3736 - 'uid': oo.user_id,  
3737 - 'cid': cid,  
3738 - 'store_id': os.stoid,  
3739 - 'type': 5  
3740 - };  
3741 -  
3742 - //-- 导购ID --  
3743 - if(getApp().globalData.guide_id){  
3744 - pdata.guide_id=getApp().globalData.guide_id;  
3745 - }  
3746 -  
3747 - var app = getApp(),  
3748 - th = this;  
3749 - app.request.post("/api/weshop/couponList/saveCouponList", {  
3750 - data: pdata,  
3751 - success: function(res) {  
3752 - if (res.data.code == 0) {  
3753 - app.my_warnning("领取成功", 1, th);  
3754 - lq_num++;  
3755 - var text = "quan_list[" + index + "].lqnum";  
3756 - var text2 = "quan_list[" + index + "].linging";  
3757 - var obj = {};  
3758 - obj[text] = lq_num;  
3759 - obj[text2] = 0;  
3760 - th.setData(obj);  
3761 - } else {  
3762 - app.confirmBox(res.data.msg);  
3763 - var text2 = "quan_list[" + index + "].linging";  
3764 - var obj = {};  
3765 - obj[text2] = 0;  
3766 - th.setData(obj);  
3767 - }  
3768 - }  
3769 - }) 1010 + //---小于10的格式化函数----
  1011 + timeFormat(param) {
  1012 + return param < 10 ? '0' + param : param;
3770 }, 1013 },
3771 - 1014 +
  1015 +
3772 //--定义的保存图片方法,分享团--- 1016 //--定义的保存图片方法,分享团---
3773 saveImageToPhotosAlbum: function() { 1017 saveImageToPhotosAlbum: function() {
3774 //--先判断会员状态-- 1018 //--先判断会员状态--
@@ -4279,33 +1523,6 @@ Page({ @@ -4279,33 +1523,6 @@ Page({
4279 } 1523 }
4280 }, 1524 },
4281 1525
4282 - /*---视频相关--*/  
4283 - videopicture: function(e) {  
4284 - var vipi = e.currentTarget.dataset.vipi;  
4285 - this.setData({  
4286 - videopicture: vipi,  
4287 - swiperCurrent: vipi,  
4288 - noon: 0,  
4289 - current: 1  
4290 - });  
4291 - },  
4292 -  
4293 - videoPlay: function(e) {  
4294 - var _index = e.currentTarget.id  
4295 - this.setData({  
4296 - _index: _index,  
4297 - noon: 1  
4298 - })  
4299 -  
4300 - setTimeout(function() {  
4301 - //将点击视频进行播放  
4302 - var videoContext = wx.createVideoContext(_index)  
4303 - videoContext.play();  
4304 - }, 500)  
4305 - },  
4306 -  
4307 -  
4308 -  
4309 //--获取头像的本地缓存,回调写法-- 1526 //--获取头像的本地缓存,回调写法--
4310 get_head_temp: function(tt, func) { 1527 get_head_temp: function(tt, func) {
4311 var ee = this; 1528 var ee = this;
@@ -4358,16 +1575,6 @@ Page({ @@ -4358,16 +1575,6 @@ Page({
4358 }); 1575 });
4359 }, 1576 },
4360 1577
4361 - //--外侧评价的点击效果---  
4362 - clik_evaluate: function(e) {  
4363 - var val = e.currentTarget.dataset.val;  
4364 - this.setData({  
4365 - activeCategoryId: 2,  
4366 - activeCategoryId3: val,  
4367 - comments: null  
4368 - });  
4369 - this.requestComments_new();  
4370 - },  
4371 1578
4372 //--跳转到商品详情页面-- 1579 //--跳转到商品详情页面--
4373 go_goods: function(e) { 1580 go_goods: function(e) {
@@ -4376,11 +1583,6 @@ Page({ @@ -4376,11 +1583,6 @@ Page({
4376 getApp().goto(url); 1583 getApp().goto(url);
4377 }, 1584 },
4378 1585
4379 - //--跳转到支付尾款界面--  
4380 - go_pay_wk: function() {  
4381 - var url = "/pages/cart/cart_wk/cart_wk?order_id=" + this.data.wk_order_id;  
4382 - getApp().goto(url);  
4383 - },  
4384 1586
4385 pop_err_img: function(e) { 1587 pop_err_img: function(e) {
4386 var txt = e.currentTarget.dataset.errorimg; 1588 var txt = e.currentTarget.dataset.errorimg;
@@ -4389,25 +1591,6 @@ Page({ @@ -4389,25 +1591,6 @@ Page({
4389 this.setData(ob); 1591 this.setData(ob);
4390 }, 1592 },
4391 1593
4392 - //--调用更新阶梯团的接口--  
4393 - update_jiti: function(id) {  
4394 - var th = this;  
4395 - //--更新阶梯团--  
4396 - getApp().request.put("/api/weshop/teamgroup/updateTeamOrder/" + os.stoid + "/" + id, {  
4397 - success: function(ee) {  
4398 - //--等于0是要去支付尾款,接口调用失败,就要去查看参团详情--  
4399 - if (ee.data.code == 0) {  
4400 - th.setData({  
4401 - user_order_pt_state: 3,  
4402 - });  
4403 - } else if (ee.data.code == -1) {  
4404 - th.setData({  
4405 - user_order_pt_state: 2,  
4406 - });  
4407 - }  
4408 - }  
4409 - })  
4410 - },  
4411 // 选择门店 1594 // 选择门店
4412 choice_store: function(ee) { 1595 choice_store: function(ee) {
4413 var th = this; 1596 var th = this;
@@ -4437,27 +1620,20 @@ Page({ @@ -4437,27 +1620,20 @@ Page({
4437 th.data.lat = res.latitude; 1620 th.data.lat = res.latitude;
4438 th.data.lon = res.longitude; 1621 th.data.lon = res.longitude;
4439 th.data.is_get_local_ok = 1; 1622 th.data.is_get_local_ok = 1;
4440 - th.setData({  
4441 - is_gps: 1  
4442 - });  
4443 - //th.onShow(); 1623 + th.setData({ is_gps: 1 });
4444 th.get_sto(th.data.is_normal); 1624 th.get_sto(th.data.is_normal);
4445 }, 1625 },
4446 fail: function(res) { 1626 fail: function(res) {
4447 - //th.onShow(); 1627 +
4448 th.data.is_get_local_ok = 1; 1628 th.data.is_get_local_ok = 1;
4449 th.get_sto(th.data.is_normal); 1629 th.get_sto(th.data.is_normal);
4450 if (res.errCode == 2) { 1630 if (res.errCode == 2) {
4451 - th.setData({  
4452 - is_gps: 0  
4453 - }); 1631 + th.setData({is_gps: 0});
4454 if (th.data.is_gps == 0) { 1632 if (th.data.is_gps == 0) {
4455 getApp().confirmBox("请开启GPS定位", null, 25000, !1); 1633 getApp().confirmBox("请开启GPS定位", null, 25000, !1);
4456 } 1634 }
4457 } else { 1635 } else {
4458 - th.setData({  
4459 - is_gps: "3"  
4460 - }); 1636 + th.setData({ is_gps: "3" });
4461 } 1637 }
4462 1638
4463 } 1639 }
@@ -4520,8 +1696,6 @@ Page({ @@ -4520,8 +1696,6 @@ Page({
4520 sort_store: 0 1696 sort_store: 0
4521 }) 1697 })
4522 } 1698 }
4523 -  
4524 -  
4525 }, 1699 },
4526 1700
4527 //选择更多门店 1701 //选择更多门店
@@ -4530,9 +1704,8 @@ Page({ @@ -4530,9 +1704,8 @@ Page({
4530 sort_store: 1 1704 sort_store: 1
4531 }); 1705 });
4532 }, 1706 },
4533 - sort_store: function() {  
4534 -  
4535 - }, 1707 +
  1708 + sort_store: function() { },
4536 // 返回按钮 1709 // 返回按钮
4537 returns: function() { 1710 returns: function() {
4538 this.setData({ 1711 this.setData({
@@ -4563,52 +1736,6 @@ Page({ @@ -4563,52 +1736,6 @@ Page({
4563 1736
4564 }, 1737 },
4565 1738
4566 - //如果开启线下库存,已经急速库存才会使用  
4567 - async check_the_pick(item,func){  
4568 - var th=this;  
4569 - var goodsinfo=th.data.sele_g;  
4570 - var erpwareid=goodsinfo.erpwareid;  
4571 - var plist=null;  
4572 - var lock=0;  
4573 -  
4574 - //---如果是活动的时候,同时不是普通购买---  
4575 - if((th.data.prom_type==1 || th.data.prom_type==6 || th.data.prom_type==4) && !th.data.is_normal ) {  
4576 - func(); return false;  
4577 - }  
4578 -  
4579 - if(this.data.sales_rules!=2){  
4580 - func();  
4581 - }else{  
4582 -  
4583 - //先读取门店的lock  
4584 - await getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{  
4585 - data:{store_id:os.stoid,wareId:goodsinfo.goods_id,storageId:item.pickup_id,pageSize:1000}  
4586 - }).then(res=>{  
4587 - if(res.data.code==0 && res.data.data.total>0){  
4588 - for(var i in res.data.data.pageData )  
4589 - lock+=res.data.data.pageData[i].outQty;  
4590 - }  
4591 - })  
4592 - //读取线下的门店库存  
4593 - await getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{  
4594 - data:{storageNos:item.pickup_no,wareIds:encodeURIComponent(erpwareid),storeId:os.stoid}  
4595 - }).then(res=>{  
4596 - if(res.data.code==0 && res.data.data.total>0){  
4597 - plist=res.data.data.pageData[0];  
4598 - }  
4599 - })  
4600 -  
4601 - if(plist && plist.CanOutQty-lock>0){  
4602 - item.CanOutQty=plist.CanOutQty-lock;  
4603 - func();  
4604 - return false;  
4605 - }  
4606 - getApp().my_warnning(item.pickup_name+"库存不足!", 0, th);  
4607 -  
4608 - }  
4609 - },  
4610 -  
4611 -  
4612 //确定def_pick为选择的门店 1739 //确定def_pick为选择的门店
4613 sure_pick: function(e) { 1740 sure_pick: function(e) {
4614 var th = this; 1741 var th = this;
@@ -4629,8 +1756,7 @@ Page({ @@ -4629,8 +1756,7 @@ Page({
4629 } 1756 }
4630 1757
4631 //判断门店的配送方式是不是匹配 1758 //判断门店的配送方式是不是匹配
4632 - var g_distr_type = th.data.sele_g.distr_type;  
4633 - if(item.distr_type!=0 && g_distr_type!=0 && item.distr_type!=g_distr_type){ 1759 + if(th.data.storageId!=null && th.data.storageId!="" && th.data.storageId.indexOf(item.keyid)==-1){
4634 wx.showToast({ 1760 wx.showToast({
4635 title: "门店配送方式不匹配", 1761 title: "门店配送方式不匹配",
4636 icon: 'none', 1762 icon: 'none',
@@ -4639,18 +1765,18 @@ Page({ @@ -4639,18 +1765,18 @@ Page({
4639 return false; 1765 return false;
4640 } 1766 }
4641 1767
4642 - //--回调函数的用法--  
4643 - th.check_the_pick(item,function(){ 1768 +
4644 th.setData({ 1769 th.setData({
4645 def_pick_store: item, 1770 def_pick_store: item,
4646 sto_sele_name: item.pickup_name, 1771 sto_sele_name: item.pickup_name,
4647 sto_sele_id: item.pickup_id, 1772 sto_sele_id: item.pickup_id,
  1773 + sto_sele_keyid: item.keyid,
4648 sto_sele_distr: item.distr_type, 1774 sto_sele_distr: item.distr_type,
4649 store: 0, 1775 store: 0,
4650 choice_sort_store: 0, 1776 choice_sort_store: 0,
4651 fir_pick_index: 0 1777 fir_pick_index: 0
4652 }); 1778 });
4653 - 1779 +
4654 if (openindstore == 1) { 1780 if (openindstore == 1) {
4655 th.setData({ 1781 th.setData({
4656 openSpecModal: !0, 1782 openSpecModal: !0,
@@ -4662,7 +1788,7 @@ Page({ @@ -4662,7 +1788,7 @@ Page({
4662 openSpecModal_ind: openindstore, 1788 openSpecModal_ind: openindstore,
4663 }); 1789 });
4664 } 1790 }
4665 - else if (openindstore == 4) { //4就是拼团 1791 + else if(openindstore == 4) { //4就是拼团
4666 th.setData({ 1792 th.setData({
4667 openSpecModal_pt: 1, //打开拼团购买界面 1793 openSpecModal_pt: 1, //打开拼团购买界面
4668 store: 0, //关闭门店 1794 store: 0, //关闭门店
@@ -4676,11 +1802,9 @@ Page({ @@ -4676,11 +1802,9 @@ Page({
4676 choice_sort_store: 0, 1802 choice_sort_store: 0,
4677 sort_store: 0 1803 sort_store: 0
4678 }) 1804 })
4679 - }  
4680 - //如果商品没有其他活动,要取一下线下价格  
4681 - th.get_off_price();  
4682 - }) 1805 + }
4683 }, 1806 },
  1807 +
4684 //---点击二级之后的选择--- 1808 //---点击二级之后的选择---
4685 choose_for_store: function(e) { 1809 choose_for_store: function(e) {
4686 var index_c = e.currentTarget.dataset.ind; 1810 var index_c = e.currentTarget.dataset.ind;
@@ -4718,13 +1842,13 @@ Page({ @@ -4718,13 +1842,13 @@ Page({
4718 return false; 1842 return false;
4719 } 1843 }
4720 1844
4721 - //先设置之前,要判断是不是有库存  
4722 - th.check_the_pick(item,function(){  
4723 - var store_id = o.stoid;  
4724 - var user_id = getApp().globalData.user_id;  
4725 - var def_pickup_id = item.pickup_id; 1845 +
  1846 +
  1847 + var store_id = o.stoid;
  1848 + var user_id = getApp().globalData.user_id;
  1849 + var def_pickup_id = item.pickup_id;
4726 1850
4727 - getApp().request.put('/api/weshop/users/update', { 1851 + getApp().request.put('/api/weshop/users/update', {
4728 data: { 1852 data: {
4729 user_id:user_id, 1853 user_id:user_id,
4730 def_pickup_id:def_pickup_id 1854 def_pickup_id:def_pickup_id
@@ -4747,6 +1871,7 @@ Page({ @@ -4747,6 +1871,7 @@ Page({
4747 def_pick_store: item, 1871 def_pick_store: item,
4748 sto_sele_name: item.pickup_name, 1872 sto_sele_name: item.pickup_name,
4749 sto_sele_id: item.pickup_id, 1873 sto_sele_id: item.pickup_id,
  1874 + sto_sele_keyid: item.keyid,
4750 sto_sele_distr: item.distr_type, 1875 sto_sele_distr: item.distr_type,
4751 store: 0, 1876 store: 0,
4752 choice_sort_store: 0 1877 choice_sort_store: 0
@@ -4787,10 +1912,6 @@ Page({ @@ -4787,10 +1912,6 @@ Page({
4787 }) 1912 })
4788 } 1913 }
4789 1914
4790 - //如果商品没有其他活动,要取一下线下价格  
4791 - th.get_off_price();  
4792 -  
4793 - })  
4794 }, 1915 },
4795 1916
4796 wait_for_store_config: function() { 1917 wait_for_store_config: function() {
@@ -4830,135 +1951,26 @@ Page({ @@ -4830,135 +1951,26 @@ Page({
4830 clearInterval(t_time); 1951 clearInterval(t_time);
4831 }, 500) 1952 }, 500)
4832 }, 1953 },
4833 - //显示全部  
4834 - toggleHandler: function(e) {  
4835 - var that = this,  
4836 - index = e.currentTarget.dataset.index;  
4837 - for (var i = 0; i < that.data.comments.length; i++) {  
4838 - if (index == i) {  
4839 - for (var i = 0; i < that.data.comments.length; i++) {  
4840 - that.data.comments[index].auto = true;  
4841 - that.data.comments[index].seeMore = false;  
4842 - }  
4843 - }  
4844 - }  
4845 - that.setData({  
4846 - comments: that.data.comments  
4847 - })  
4848 - },  
4849 -  
4850 - //收起更多  
4851 - toggleContent: function(e) {  
4852 - var that = this,  
4853 - index = e.currentTarget.dataset.index;  
4854 - for (var i = 0; i < that.data.comments.length; i++) {  
4855 - if (index == i) {  
4856 - that.data.comments[index].auto = true;  
4857 - that.data.comments[index].seeMore = true;  
4858 - }  
4859 - }  
4860 - that.setData({  
4861 - comments: that.data.comments  
4862 - })  
4863 - },  
4864 -  
4865 - //--- 获取卡类列表 ---  
4866 - getPlusCardType: function (func) {  
4867 - var storid = os.stoid;  
4868 - var th = this;  
4869 - var user=getApp().globalData.userInfo;  
4870 - if(!user) return false;  
4871 - getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => {  
4872 - var plusCard = res.data.data;  
4873 - var arr = [1219, 2089, 3031];  
4874 - var new_arr = new Array();  
4875 - var card_name_map=new Map();  
4876 - for (var i = 0; i < plusCard.length; i++) {  
4877 - if((user.card_field==null || user.card_field=="") && plusCard[i].IsStopBuy==true) continue;  
4878 - var name="card"+plusCard[i].CorrPrice.toLowerCase();  
4879 - card_name_map.set(name,plusCard[i].CardName);  
4880 - }  
4881 -  
4882 - var ob={"card_list":plusCard,"name_map":card_name_map};  
4883 - func(ob);  
4884 - })  
4885 - },  
4886 -  
4887 - go_plus:function(){  
4888 - getApp().goto("/pages/user/plus/plus");  
4889 - },  
4890 - go_card_info:function(){  
4891 - getApp().goto("/pages/user/cardinfo/cardinfo");  
4892 - }, 1954 +
  1955 +
4893 //-- 根据ID拿出门店 -- 1956 //-- 根据ID拿出门店 --
4894 get_pick_from_list(pid){ 1957 get_pick_from_list(pid){
4895 var all_pick_list=this.data.all_pick_list; 1958 var all_pick_list=this.data.all_pick_list;
4896 for(var i in all_pick_list){ 1959 for(var i in all_pick_list){
4897 var item=all_pick_list[i]; 1960 var item=all_pick_list[i];
4898 - if(item.pickup_id==pid){  
4899 - return item;  
4900 - }  
4901 - }  
4902 - },  
4903 - //-----显示优惠券的时候情况-----  
4904 - show_more_cx:function () {  
4905 - if(this.data.is_more_cx){  
4906 - this.setData({is_more_cx:0});  
4907 - }else{  
4908 - this.setData({is_more_cx:1}); 1961 + if(item.pickup_id==pid){ return item;}
4909 } 1962 }
4910 }, 1963 },
4911 -  
4912 - //----跳转到搭配购买----  
4913 - go_prom_list:function () {  
4914 -  
4915 - var url= "../../../packageA/pages/prom_list/prom_list?goods_id="+this.data.gid;  
4916 - var room_id= getApp().globalData.room_id;  
4917 - if(room_id && this.data.gid==getApp().globalData.room_goods_id){  
4918 - url+="&room_id="+room_id;  
4919 - }  
4920 - wx.navigateTo({ url: url,})  
4921 - },  
4922 -  
4923 - //---检查有没有优惠活动---  
4924 - check_is_youhui:function(gid){  
4925 - var th=this;  
4926 - //调用接口判断订单优惠,  
4927 - getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+gid+"/0", {}).then(res => {  
4928 - if(res.data.code==0){  
4929 - var r_data=res.data.data;  
4930 - var max=0,min=0;  
4931 - if(r_data.collocationList){  
4932 - for(var i in r_data.collocationList){  
4933 - if(max==0) max=r_data.collocationList[i].price;  
4934 - if(min==0) min=r_data.collocationList[i].price;  
4935 -  
4936 - if(max<parseFloat(r_data.collocationList[i].price)) max=r_data.collocationList[i].price;  
4937 - if(min>parseFloat(r_data.collocationList[i].price)) min=r_data.collocationList[i].price;  
4938 - }  
4939 - r_data.collocationPromList.max=(max+th.data.data.shop_price).toFixed(2);  
4940 - r_data.collocationPromList.min=(min+th.data.data.shop_price).toFixed(2);  
4941 - }  
4942 - th.setData({  
4943 - order_prom:r_data.promOrder,  
4944 - collocationGoods:r_data.collocationPromList,  
4945 - prom_goods:r_data.promGoodsLists,  
4946 - })  
4947 -  
4948 - th.is_show_more_buy();  
4949 - }  
4950 - })  
4951 - },  
4952 -  
4953 - closePoster() { 1964 +
  1965 + closePoster() {
4954 this.setData({ 1966 this.setData({
4955 showPoster: false, 1967 showPoster: false,
4956 }); 1968 });
4957 - }, 1969 + },
4958 1970
4959 // 保存图片到手机 1971 // 保存图片到手机
4960 - savePic() {  
4961 - console.log('保存图片'); 1972 + savePic() {
  1973 + console.log('保存图片');
4962 var self = this; 1974 var self = this;
4963 // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限 1975 // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限
4964 this.getSetting().then((res) => { 1976 this.getSetting().then((res) => {
@@ -4977,9 +1989,7 @@ Page({ @@ -4977,9 +1989,7 @@ Page({
4977 // 如果已经授权,保存下载文件 1989 // 如果已经授权,保存下载文件
4978 this.saveImage(self.data.shareImgPath) 1990 this.saveImage(self.data.shareImgPath)
4979 .then(() => { 1991 .then(() => {
4980 - self.setData({  
4981 - showPoster: false  
4982 - }); 1992 + self.setData({ showPoster: false });
4983 }); 1993 });
4984 } 1994 }
4985 1995
@@ -5027,8 +2037,7 @@ Page({ @@ -5027,8 +2037,7 @@ Page({
5027 }) 2037 })
5028 }) 2038 })
5029 }, 2039 },
5030 -  
5031 - 2040 +
5032 // 保存图片到系统相册 2041 // 保存图片到系统相册
5033 saveImage(saveUrl) { 2042 saveImage(saveUrl) {
5034 var self = this; 2043 var self = this;
@@ -5061,61 +2070,7 @@ Page({ @@ -5061,61 +2070,7 @@ Page({
5061 urls: [this.data.shareImgPath] 2070 urls: [this.data.shareImgPath]
5062 }); 2071 });
5063 }, 2072 },
5064 -  
5065 - is_show_more_buy:function(){  
5066 - var prom_goods=this.data.prom_goods;  
5067 - var per_price=this.data.sele_g.shop_price  
5068 - if(this.data.card_field && this.data.sele_g[this.data.card_field]>0){  
5069 - per_price=this.data.sele_g[this.data.card_field];  
5070 - }  
5071 - var all_price=per_price*this.data.goodsInputNum;  
5072 - var con=null;  
5073 - for(var i in prom_goods){  
5074 - var item=prom_goods[i];  
5075 - if(item.prom_type==1){  
5076 - if(item.condition>this.data.goodsInputNum) {  
5077 - con=item;  
5078 - con.need=(item.condition-this.data.goodsInputNum)+"件";  
5079 - break;  
5080 - }  
5081 - }else{  
5082 - if(item.condition>all_price){  
5083 - con=item;  
5084 - con.need=(item.condition-all_price)+"元";  
5085 - break;  
5086 - }  
5087 - }  
5088 - }  
5089 -  
5090 - this.setData({hui_condition:con});  
5091 -  
5092 - },  
5093 -  
5094 - //-- 积分购 --  
5095 - go_pay_integral:function(){  
5096 - this.get_sto(0)  
5097 - this.setData({openSpecModal_inte:1});  
5098 - },  
5099 - //-- 积分购普通购买 --  
5100 - go_pay_integral_normal:function(){  
5101 - this.get_sto(1)  
5102 - this.setData({openSpecModal_inte_normal:1});  
5103 - },  
5104 -  
5105 - closeSpecModal_inte:function(){  
5106 - this.setData({openSpecModal_inte:0});  
5107 - } ,  
5108 - closeSpecModal_inte_normal:function(){  
5109 - this.setData({openSpecModal_inte_normal:0});  
5110 - },  
5111 -  
5112 - addCart_inte:function(t){  
5113 - this.add_cart_func_inte(t);  
5114 - },  
5115 -  
5116 -  
5117 -  
5118 - 2073 +
5119 onShareTimeline() { 2074 onShareTimeline() {
5120 return { 2075 return {
5121 title:this.data.data.goods_name + '-' + getApp().globalData.config.store_name, 2076 title:this.data.data.goods_name + '-' + getApp().globalData.config.store_name,
packageA/pages/goodsInfo/goodsInfo.wxml
@@ -14,419 +14,46 @@ @@ -14,419 +14,46 @@
14 </view> 14 </view>
15 </view> 15 </view>
16 </view> --> 16 </view> -->
17 -  
18 <view class="goods-detail"> 17 <view class="goods-detail">
19 - <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}">  
20 - <!-- 视频 -->  
21 - <!-- <swiper bindchange="swiperChange"class="xc-pictures swiperContainer rel" current="{{swiperCurrent}}"  
22 - indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}"> --> 18 + <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}">
23 <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove"> 19 <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove">
24 -  
25 <view class="xc-videos-picture rel"> 20 <view class="xc-videos-picture rel">
26 - <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}" indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange">  
27 - <!-- <swiper-item> -->  
28 - <!-- <swiper-item wx:if="{{mapurl}}"> -->  
29 - <!-- <view wx:if="{{noon == 0}}">  
30 - <image class="xc-picturess" src="{{iurl+mapurl_f_img}}" mode="aspectFit">  
31 - <image id="{{index}}" class="xc-play" src="{{iurl}}/miniapp/images/pofang.png" bindtap="videoPlay"></image>  
32 - </image>  
33 - </view>  
34 - <view wx:else>  
35 - <video class="xc-videos" src="{{iurl+mapurl}}" id="{{index}}" wx:if="{{_index == index}}"> </video>  
36 - </view>  
37 - </swiper-item> -->  
38 -  
39 - <!-- <swiper-item wx:for="{{gallery}}" wx:key="gallery"> -->  
40 - <swiper-item>  
41 - <image class="wh100" src="{{iurl + data.image_url}}" mode="aspectFit" binderror="bind_bnerr" lazy-load="true" data-errorimg="gallery[{{index}}].image_url"></image>  
42 - </swiper-item>  
43 - </swiper>  
44 - <!-- <block wx:if="{{mapurl}}">  
45 - <view wx:if="{{hiddenn==1}}">  
46 - <view class="xc-imageCount">{{current}}/{{gallery.length}}</view>  
47 - </view>  
48 - <view class="xc-video-picture abs">  
49 - <view class="xc-video" data-vipi="0" bindtap="videopicture">  
50 - <view class="{{videopicture==0 ? 'xc-video-button':'xc-video-buttons'}} {{videopicture==0 ? 'xc-sn':''}}">  
51 - 视频  
52 - </view>  
53 - </view>  
54 - <view class="xc-picture {{videopicture==1 ? 'xc-sn':''}}" data-vipi="1" bindtap="videopicture">  
55 - <view>  
56 - 图片  
57 - </view>  
58 - </view>  
59 - </view>  
60 - </block> --> 21 + <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}" indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange">
  22 + <swiper-item>
  23 + <image class="wh100" src="{{iurl + data.image_url}}" mode="aspectFit" binderror="bind_bnerr" lazy-load="true" data-errorimg="gallery[{{index}}].image_url"></image>
  24 + </swiper-item>
  25 + </swiper>
61 </view> 26 </view>
62 </view> 27 </view>
63 28
64 -  
65 - <!----显示秒杀价,团购,积分购---->  
66 - <!-- <view class="prom_show rel" wx:if="{{prom_type==1}}">  
67 -  
68 - <image class="secondkill-img" src='{{prom_st==1? iurl+"/miniapp/images/red_jx.png":iurl+"/miniapp/images/blue_ks.png"}}'></image>  
69 - <image class="abs spike-img" src="{{iurl}}/miniapp/images/xsmiaosha.png"></image>  
70 -  
71 - <view class="stop fs26 abs" wx:if="{{prom_st==1}}">距活动结束还有</view>  
72 - <view class="start fs26 abs" wx:if="{{prom_st==2}}">距活动开始还有</view>  
73 - <view class="secview flex abs fs24 xc-miaosha-time">  
74 - <block wx:if="djs.day">  
75 - <view class='day-val' style="color:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.day}}</view>  
76 - <view class="day white" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">天</view>  
77 - </block>  
78 - <view class='time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.hou}}</view>  
79 - <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">时</view>  
80 - <view class='time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.min}}</view>  
81 - <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}"> 分</view>  
82 - <view class='time-val white t-c' style=";background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.sec}}</view>  
83 - <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view>  
84 - </view>  
85 - </view> -->  
86 -  
87 - <!----拼单---->  
88 - <!-- <view class="pt_show " wx:if="{{prom_type==6}}">  
89 - <view class="pt_view rel"> -->  
90 - <!--许程 7. 24 -->  
91 - <!-- <image class="secondkill-img" src="{{prom_st==1? iurl+'/miniapp/images/red_jx.png':iurl+'/miniapp/images/blue_ks.png'}}"></image>  
92 - <view class="abs xc-qt-price">  
93 - <view class="flex" style='height:40rpx; margin-top:5rpx'>  
94 - <view class="flex fs35 xc-qtsign">¥</view>  
95 - <view class="fs50 val">{{prom_price}}</view>  
96 - </view>  
97 - <view class="word-line fs20 xc-qtunit-price">零售价¥{{data.market_price}}</view>  
98 - </view>  
99 - <view class="abs white xc-nanber">  
100 - <text class="fs22">已拼{{prom_act.buy_num}}件</text>  
101 - <view class="flex" style='margin-top:-34rpx'>  
102 - <view class="xc-people-img">  
103 - <image class="imgs" src="{{prom_st==1? iurl+'/miniapp/images/r_logo_red.png':iurl+'/miniapp/images/r_logo.png'}}"></image>  
104 - </view>  
105 - <view class="t-s fs20 xc-people-val">  
106 - {{prom_act.ct_num}}人拼  
107 - </view>  
108 - </view>  
109 - </view>  
110 - <view class="hy-stop word-color fs26 abs" wx:if="{{prom_st==1}}">距活动结束还有</view>  
111 - <view class="hy-stop word-color-lan fs26 abs" wx:if="{{prom_st==0}}">距活动开始还有</view>  
112 - <view class="secview flex abs fs24 " style="color: black;right: 3px; top:46rpx;">  
113 - <block wx:if="djs.day">  
114 - <view class='day-val' style="color:{{prom_st==1?'#d40022':'#0097e0'}};margin-top:-34rpx;">{{djs.day}}</view>  
115 - <view class="day white" style="margin-top:-34rpx;margin-right:10rpx;color: {{prom_st==1?'#d40022':'#0097e0'}}">天</view>  
116 - </block>  
117 - <view class='xc-time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.hou}}</view>  
118 - <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">时</view>  
119 - <view class='xc-time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.min}}</view>  
120 - <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}"> 分</view>  
121 - <view class='xc-time-val white t-c' style=";background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.sec}}</view>  
122 - <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view>  
123 - </view>  
124 - </view>  
125 -  
126 - <view class="pt_fir"> -->  
127 - <!----显示团类型和团价格---->  
128 - <!-- <view class="pt_fir_title "> -->  
129 - <!-- 许程 商家团主页 -->  
130 - <!-- <view class="xc-goods-explain flex-vertical-between">  
131 - <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 }}">  
132 - {{data.goods_name}}  
133 - </view>  
134 -  
135 - <view class="xc-share-frame-jieti flex" bindtap="saveImageToPhotosAlbum" style="top:0">  
136 - <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image>  
137 - <view class="share-font">分享</view>  
138 - </view>  
139 - </view>  
140 - </view> -->  
141 -  
142 - <!----显示价格,阶梯团---->  
143 - <!-- <block wx:if="{{prom_act.kttype==3}}">  
144 - <view class="jie_price flex">  
145 - <view style='margin-right:26rpx' wx:for="{{prom_act.ct_rylist}}">  
146 - <view class="fs35 word-color">  
147 - <text class="fs24">¥</text>{{item.price}}</view>  
148 - <view class="fs24 t-c xc-person-number ">满{{item.rynum}}人</view>  
149 - </view>  
150 - </view>  
151 - </block>  
152 - </view>  
153 -  
154 - <view class="t_gz" wx:if="{{is_show_gz==1}}">  
155 - {{prom_act.remark}}  
156 - </view> -->  
157 -  
158 - <!----------正有多少人在开团---------->  
159 - <!-- <view class="pt_fir se2" wx:if="{{teamgroup}}">  
160 - <view class="xc-partner-frame">  
161 - <view class="zzk-1" bindtap="go_t_more">以下小伙伴正在拼单,可直接参与  
162 - <view class="ckgd flex">查看详细  
163 - <view class="bg_right arrow-one"></view>  
164 - </view>  
165 - </view>  
166 - </view>  
167 - <view class='group' wx:for="{{teamgroup}}" wx:for-index="t_ind" wx:key="teamgroup" style='padding-left:28rpx;'>  
168 - <view class='group-list' bindtap="go_cj_team" data-ind="{{t_ind}}"> -->  
169 - <!--//选项框头像-->  
170 - <!-- <view class='gtou'>  
171 - <image src='{{item.user.head_pic}}'></image>  
172 - </view> -->  
173 - <!--//等你来拼-->  
174 - <!-- <view class='gdn ellipsis-1'>{{item.user.nickname}}</view> -->  
175 - <!--//还差几人,剩余时间-->  
176 - <!-- <view class="rel">  
177 - <view class='ghaicha ellipsis-2 abs'>  
178 - <text class='gred' wx:if="{{prom_act.max_ct_num >0}}"><text class="flex" wx:if="{{prom_act.max_ct_num - item.open_num>0}}">还差<text class="word-color">{{prom_act.max_ct_num - item.open_num}}</text>人享最低优惠</text><text wx:else>您已经享最低优惠</text></text>  
179 - <text class='gred' wx:else>还差<text style='color:#ff2753'>{{prom_act.ct_num - item.open_num}}</text>人成团 </text>  
180 - <view class="t_show">  
181 - 剩余  
182 - <text wx:if="{{timer[t_ind].day}}">{{timer[t_ind].day}}天:</text>  
183 - <text>{{timer[t_ind].hou}}</text>:  
184 - <text>{{timer[t_ind].min}}</text>:  
185 - <text>{{timer[t_ind].sec}}</text>  
186 - </view>  
187 - </view>  
188 - </view> -->  
189 - <!--//参加团-->  
190 - <!-- <view class='cjt t-c'>  
191 - 去参团  
192 - </view>  
193 - <view class="clear"></view>  
194 - </view>  
195 - </view>  
196 - </view>  
197 -  
198 - <view class="pt_fir se1">  
199 - <view class="pt_hb">  
200 - 拼团玩法  
201 - <view class="ptgz_an xq flex" bindtap="show_pt_xx">查看详细  
202 - <view class="bg_right arrow-two"></view>  
203 - </view>  
204 - </view>  
205 - <view class="flex-level" style='height:198rpx; width:100%;'>  
206 - <view class="flex-vertical-between rel" style='width:94%;margin-left:10rpx;'> -->  
207 - <!-- 许程 7: 24 -->  
208 - <!-- <view class="xc-item t-c">  
209 - <view class="circle yuan t-c circle-color">1</view>  
210 - <view class="word">选择商品完成下单</view>  
211 - </view>  
212 - <view class="abs link {{color_type==0?'link-color-red':'link-color'}}"></view>  
213 -  
214 - <view class="xc-item t-c">  
215 - <view class="circle yuan t-c circle-color">2</view>  
216 - <view class="word">支付开团或参团</view>  
217 - </view>  
218 - <view class="abs link1 {{color_type_one==0?'link-color-red':'link-color'}}"></view>  
219 -  
220 - <view class="xc-item t-c">  
221 - <view class="circle yuan t-c circle-color">3</view>  
222 - <view class="word">邀请好友参团支付</view>  
223 - </view>  
224 - <view class="abs link2 {{color_type_two==0?'link-color-red':'link-color'}}"></view>  
225 -  
226 -  
227 - <view class="xc-item t-c">  
228 - <view class="circle yuan t-c circle-color1">4</view>  
229 - <view class="word">人满发货失败退款</view>  
230 - </view>  
231 - </view>  
232 - </view>  
233 - </view>  
234 - </view> -->  
235 -  
236 - <!-- 积分购 -->  
237 - <!-- <view wx:if="{{prom_type==4}}">  
238 - <view class="goods-price rel"> -->  
239 - <!-- 价格显示 -->  
240 - <!-- <view class="co-red" style="overflow: hidden" >  
241 - <view class="market-price" style="overflow: hidden; height: 66rpx;">  
242 - <image class="rel_img" src="{{iurl}}/miniapp/images/integral/integral_red.png"></image>  
243 - <block wx:if="{{prom_integral}}">{{prom_integral}}  
244 - <text class="rel_txt">积分</text></block>  
245 - <text class="rel_txt" wx:if="{{prom_integral && prom_price}}">+</text>  
246 - <text class="rel_txt" wx:if="{{prom_price}}" >{{filters.toFix(prom_price,2)}}元</text>  
247 - <text class="rel_txt" wx:if="{{!prom_integral && !prom_price}}">0积分</text>  
248 - <text class="rel_txt" decode="{{true}}" space="{{true}}" style="color: #999; text-decoration: line-through;">&nbsp;&nbsp;&nbsp;零售价:¥{{data.market_price}}</text>  
249 - </view>  
250 - </view> -->  
251 -  
252 - <!-- 这个是分享按钮 -->  
253 - <!-- <view class="xc-share-frame flex {{prom_type==1?'s_ms_bth':''}} " bindtap="saveImageToPhotosAlbum">  
254 - <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image>  
255 - <view class="share-font">分享</view>  
256 - </view>  
257 -  
258 - <view class="goods-title">  
259 - <view class="goods-name elli">{{data.goods_name}}</view>  
260 - </view>  
261 -  
262 - <view class="goods-num">  
263 - <view class="sales">销量:{{prom_act.buy_num}}件</view> -->  
264 - <!-- <view class="stock">折扣:{{data.disc}}折</view> -->  
265 - <!-- <view class="stock">折扣:{{g_filters.num((prom_price?prom_price:0)*100/data.shop_price)}}折</view>  
266 - <view class="stock">{{categories3[0].num}}人评价</view>  
267 - </view>  
268 - </view>  
269 - </view> -->  
270 -  
271 - <!-- 不是拼团,不是积分购 -->  
272 <block> 29 <block>
273 - <!-- <block wx:if="{{prom_type!=6 && prom_type!=4}}"> --> 30 +
274 <view class="goods-price rel"> 31 <view class="goods-price rel">
275 - <view class="co-red" style="overflow: hidden" wx:if="{{prom_type==0 || prom_type==3}}">  
276 - <view class="market-price" style="overflow: hidden">  
277 - <!-- <block wx:if="{{card_field && data[card_field]>0}}">  
278 - <view class="flex ai-center grade-card-frame" style="margin-left:12rpx;">  
279 - <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>  
280 - <view class="fs24 white view card-name ellipsis-1">{{card_name}}</view>  
281 - </view>  
282 - <text class="rel yuan">¥</text>{{filters.toFix(data[card_field],2)}}  
283 - <view class='yj' style="top:35rpx">  
284 - <text>零售价:¥{{data.market_price}}</text>  
285 - </view>  
286 - </block> -->  
287 - <!-- <block wx:else>  
288 - <text class="rel yuan">¥</text>{{filters.toFix(data.shop_price,2)}}  
289 - <view class='yj'><text>零售价:¥{{data.market_price}}</text></view>  
290 - </block> -->  
291 - </view>  
292 - 32 + <view class="co-red" style="overflow: hidden">
  33 + <view class="market-price" style="overflow: hidden"></view>
293 </view> 34 </view>
294 -  
295 - <!-- 这个是分享按钮 -->  
296 - <!-- <view class="xc-share-frame flex {{prom_type==1?'s_ms_bth':''}} " bindtap="saveImageToPhotosAlbum">  
297 - <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image>  
298 - <view class="share-font">分享</view>  
299 - </view> -->  
300 -  
301 - <!-- 不是秒杀 -->  
302 - <!-- 等级卡的价格,不是等级卡会员,且商品又有设置等级级价,商家后台有开通升级卡同能 -->  
303 - <!-- <view class="flex ai_and" wx:if="{{!card_field && g_filters.is_has_rank(rank_switch,data) && prom_type!=1 }}">  
304 -  
305 - <view class="flex ai-center grade-card-frame card-frame" >  
306 - <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>  
307 - <view class="fs24 white view card-name ellipsis-1">{{g_filters.get_card_price(data,card_list,1)}}</view>  
308 - </view>  
309 - <view class="fs32 xc-black3 ai_and carde_frame">  
310 - <text class="fs26">  
311 - ¥</text>{{g_filters.get_card_price(data,card_list,0)}}  
312 - </view>  
313 - </view> -->  
314 -  
315 - <!-- 等级卡的显示,购买, 等级卡近30天要显示续费-->  
316 -  
317 - <!-- <block wx:if="{{g_filters.is_has_rank(rank_switch,data)}}"> -->  
318 -  
319 - <!-- 不是秒杀,且会员不是等级会员 -->  
320 - <!-- <view wx:if="{{!card_field && prom_type!=1 }}">  
321 - <view class="beauty-makeup-frame flex ai-center">  
322 - <view class="left flex ai-center">  
323 - <view class="flex ai-center grade-card-frame card-frame advert-card">  
324 - <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>  
325 - <view class="fs24 white view card-name ellipsis-1">{{g_filters.get_card_price(data,card_list,1)}}</view>  
326 - </view>  
327 - <view class="card-effect">  
328 - <view class="fs24 xc-black3">成为{{g_filters.get_card_price(data,card_list,1)}}立<text class="co-red">省{{filters.toFix(data.shop_price-g_filters.get_card_price(data,card_list,0),2)}}</text>元</view>  
329 - <view class="fs22 xc-ash"> 开通会员 尽享更多优惠 </view>  
330 - </view>  
331 - </view>  
332 - <view class="right flex jc-center ai-center" bindtap="go_plus">  
333 - <view class="at_once_carde xc-black3 fs28">立即开卡</view>  
334 - <view class="bg_right"></view>  
335 - </view>  
336 -  
337 - </view>  
338 - </view> -->  
339 - <!-- 立即续费的显示 -->  
340 - <!-- <view wx:elif="{{is_near_date && data[card_field]>0 && prom_type!=1}}">  
341 - <view class="beauty-makeup-frame flex ai-center">  
342 - <view class="left flex ai-center">  
343 - <view class="flex ai-center grade-card-frame card-frame advert-card">  
344 - <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>  
345 - <view class="fs24 white view card-name ellipsis-1">{{card_name}}</view>  
346 - </view>  
347 - <view class="card-effect">  
348 - <view class="fs24 xc-black3">成为{{card_name}}立<text class="co-red">省{{filters.toFix(data.shop_price[card_field],2)}}</text>元</view>  
349 - <view class="fs22 xc-ash"> 开通会员 尽享更多优惠 </view>  
350 - </view>  
351 - </view>  
352 - <view class="right flex jc-center ai-center" bindtap="go_card_info">  
353 - <view class="at_once_carde xc-black3 fs28">立即续费</view>  
354 - <view class="bg_right"></view>  
355 - </view>  
356 -  
357 - </view>  
358 -  
359 - </view> -->  
360 -  
361 - <!-- </block> -->  
362 - <!--许程商品名字-->  
363 -  
364 - <!-- <view wx:if="{{prom_type!=1}}"> --> 35 +
365 <view> 36 <view>
366 - <view class="co-red"><text class="rel yuan">¥</text>{{filters.toFix(data.shop_price,2)}}</view>  
367 - <view class="goods-title">  
368 - <view class="goods-name elli">{{data.goods_name}}</view>  
369 - </view> 37 + <view class="co-red"><text class="rel yuan">¥</text>{{filters.toFix(data.shop_price,2)}}</view>
  38 + <view class="goods-title"> <view class="goods-name elli">{{data.goods_name}}</view></view>
370 </view> 39 </view>
371 40
372 - <view class="goods-num" wx:if="{{prom_type!=1}}">  
373 - <view class="sales">耗时:{{data.sales_sum}}</view>  
374 - <view class="stock">次数:{{data.disc}}</view>  
375 - <!-- <view class="stock">折扣:{{filters.pInt((prom_price?prom_price:0)*100/data.shop_price)}}折</view> -->  
376 - <view class="stock">有效天数:{{data.validDays}}</view>  
377 - <!-- <view class="stock">有效天数:1234{{categories3[0].num}}</view> --> 41 + <view wx:if="{{service_list}}">
  42 + <view class="fs32 c-5" style="margin-bottom: 10rpx;">服务项目信息</view>
  43 + <block wx:for="{{service_list}}">
  44 + <view class="goods-num" style="margin-bottom: 10rpx;">
  45 + <view class="sales">耗时:{{item.timeConsuming}}</view>
  46 + <view class="stock">次数:{{item.frequency}}</view>
  47 + <view class="stock">有效天数:{{data.validDays}}</view>
  48 + </view>
  49 + </block>
378 </view> 50 </view>
379 - <!-- <view wx:if="{{prom_type==1}}">  
380 - <view class="flex">  
381 - <view>  
382 - <view class="flex xc-price-frame">  
383 - <view class="flex fs45 sign">¥</view>  
384 - <view class="fs60 val">{{prom_price}}</view>  
385 - </view>  
386 - <view class="word-line fs24 xc-unit-price">零售价¥{{data.market_price}}</view>  
387 - </view>  
388 - <view class="xc-val-price">  
389 - <view class="fs30" style='padding-left:13rpx;' wx:if="{{prom_st==1}}" >已抢:{{prom_act.buy_num+prom_act.virtual}}件</view>  
390 - <view class="fs30" style='padding-left:13rpx;' wx:else >已抢:0件</view>  
391 - <view class="fs30 save t-c">秒杀立省¥{{filters.toFix(data.market_price-prom_price,2)}}</view>  
392 - </view>  
393 - </view>  
394 - </view> -->  
395 -  
396 - <!-- <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 && prom_type!=4}}">  
397 - {{data.goods_name}}  
398 - </view> -->  
399 -  
400 - <!-- <view wx:if="{{prom_type==1}}" style='height:58rpx'></view> -->  
401 - <!-- 许程 7.24 暂时注释 -->  
402 - <!-- <view wx:if="{{prom_type==1}}">  
403 - <view class="goods-num" wx:if="{{prom_type==1}}">  
404 -  
405 - <block wx:if="prom_st>0" >  
406 - <view class="stock">总数量:{{prom_act.goods_num+prom_act.virtual}}件</view>  
407 - <view class="stock">限购:{{prom_act.buy_limit}}件</view>  
408 - <block wx:if="{{prom_st==0}}">  
409 - <view class="sales">已购:0件</view>  
410 - </block>  
411 - <block wx:else>  
412 - <view class="sales">已购:{{prom_act.buy_num+prom_act.virtual}}件</view>  
413 - </block>  
414 - </block>  
415 -  
416 - <block wx:else>  
417 - <view class="stock">总数量:{{prom_act.goods_num}}件</view>  
418 - <view class="stock">限购:{{prom_act.buy_limit}}件</view>  
419 - <view class="sales">已购:{{prom_act.buy_num}}件</view>  
420 - </block>  
421 -  
422 - </view>  
423 - </view> -->  
424 - 51 +
425 </view> 52 </view>
426 </block> 53 </block>
427 54
428 <!-- 门店收货地址 --> 55 <!-- 门店收货地址 -->
429 - <!-- <view class="xc-address_frame bdt16 flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}" > 56 + <view class="xc-address_frame bdt16 flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}" >
430 <view class="address_frame" bindtap="choice_store" data-ind="0"> 57 <view class="address_frame" bindtap="choice_store" data-ind="0">
431 <view class="flex-vertical-between "> 58 <view class="flex-vertical-between ">
432 <view class="flex-vertical select_store_height"> 59 <view class="flex-vertical select_store_height">
@@ -449,14 +76,12 @@ @@ -449,14 +76,12 @@
449 76
450 </view> 77 </view>
451 </view> 78 </view>
452 -  
453 -  
454 - <view class="no_store" wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view> 79 +
  80 + <view class="no_store" wx:if="{{only_pk && !only_pk.length}}">(未找到门店)</view>
455 <block wx:else> 81 <block wx:else>
456 - <view class="no_store" wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> 82 + <view class="no_store" wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(未找到门店)</view>
457 <block wx:else> 83 <block wx:else>
458 <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">(配送不匹配)</view> 84 <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">(配送不匹配)</view>
459 - <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view>  
460 </block> 85 </block>
461 </block> 86 </block>
462 87
@@ -464,226 +89,21 @@ @@ -464,226 +89,21 @@
464 </view> 89 </view>
465 </view> 90 </view>
466 91
467 - </view> -->  
468 -  
469 - <!--许程 7.24暂时注释 -->  
470 - <!-- <view class="bdt16" wx:if="{{prom_type!=1&&prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1}}">  
471 - <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}">  
472 - <view class="cx-sizs fs30">领券</view>  
473 - <view class="xc-coupon-fram" wx:for="{{fir_quan}}" wx:key="{{index}}">  
474 - <view class="circle xc-circular xc-one"></view>  
475 - <view class="xc-coupon t-c four-level-word">满{{item.condition}}减{{item.money}}</view>  
476 - <view class="circle xc-circular xc-two"></view>  
477 - </view>  
478 -  
479 - <view data-coupon="1" bindtap="switchCoupon" class="cx-obtain-coupon wsize">  
480 - <text class="bg_jj"></text>  
481 - </view>  
482 - </view>  
483 - </view> -->  
484 -  
485 - <!-- 要判断是不是有促销活动 -->  
486 - <!-- <block wx:if="{{prom_goods}}">  
487 - <view class="cx-frame flex" style="position: relative; height: auto" >  
488 - <view class="cx-sizs wsize">促销</view> -->  
489 - <!-- 中间显示层 -->  
490 - <!-- <view style="margin-top: 36rpx">  
491 - <view class="cx_show_view flex fs28" wx:for="{{prom_goods}}">  
492 - <view class="prom_condition">消费满{{item.condition}}<text wx:if="{{item.prom_type==1}}">件</text><text wx:else>元</text></view>  
493 - <view class="word {{is_more_cx?'':'ellipsis-1'}}">  
494 - <text wx:if="{{item.money>0}}">减价{{item.money}}元;</text>  
495 - <text wx:if="{{item.sale>0}}">打{{item.sale}}折;</text>  
496 - <text wx:if="{{item.past==1}}">包邮;</text>  
497 - <text wx:if="{{item.intValue>0}}">送{{tem.intValue}}积分;</text>  
498 - <text wx:if="{{item.couponId>0}}">送{{item.couponMoney}}元优惠券;</text>  
499 - <text wx:if="{{item.gift_id>0}}">送商品{{item.goods_name}};</text>  
500 - <text wx:if="{{item.lb_id>0}}">送{{item.lbtitle}};</text>  
501 - </view>  
502 - </view>  
503 -  
504 - </view>  
505 - <view data-coupon="1" bindtap="show_more_cx" class="cx-obtain-coupon wsize">  
506 - <text class="bg_jj {{is_more_cx?'down1':''}}"></text>  
507 - </view>  
508 - </view>  
509 - </block> -->  
510 -  
511 - <!-- 要判断是不是有订单优惠 -->  
512 - <!-- <block wx:if="{{order_prom}}">  
513 - <view class="cx-frame flex" style="position: relative; height: auto" >  
514 - <view class="cx-sizs wsize" style="width: 144rpx">订单优惠</view> -->  
515 - <!-- 中间显示层 -->  
516 - <!-- <view class="flex ai-center">  
517 - <image class="hui_img" src="{{iurl}}/miniapp//images/hui.png"></image>  
518 - <view class="order_hui">  
519 - <view class="fs28 ellipsis-1">{{order_prom.name}}</view>  
520 - <view class="fs26" >(活动时间:{{tool.format_tt(order_prom.start_time)}} - {{tool.format_tt(order_prom.end_time)}})</view>  
521 - </view>  
522 - </view>  
523 - </view>  
524 - </block> -->  
525 -  
526 -  
527 - <!-- <view class="bz_view flex ai-center bdt16" wx:if="{{bconfig}}" style="line-height: 36rpx">  
528 - <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image>  
529 - <view class="bz-content">{{bconfig.service_bz}}</view>  
530 - </view> -->  
531 -  
532 -  
533 - <!--- 搭配促销 ---->  
534 - <!-- <view class="dp_cx_view" wx:if="{{collocationGoods}}">  
535 - <view class="bb_view">  
536 - <view>优惠热配</view>  
537 - <view class="red_bb" bindtap="go_prom_list">查看全部  
538 - <text class="bg_jj"></text>  
539 - </view>  
540 - </view> -->  
541 -  
542 - <!-- 搭配的显示 -->  
543 - <!-- <view class="flex" bindtap="go_prom_list">  
544 - <image class="dp_img" src="{{iurl+collocationGoods.img_url}}"></image>  
545 - <view class="act_content">  
546 - <view class="fs32">{{collocationGoods.title}}</view>  
547 - <view class="fs30 color_b" wx:if="{{collocationGoods.max!=collocationGoods.min}}">搭配价¥{{collocationGoods.min}}-{{collocationGoods.max}}</view>  
548 - <view class="fs30 color_b" wx:else>搭配价¥{{collocationGoods.min}}</view>  
549 - <view class="fs30 color-gray">活动至{{filters.format_time(collocationGoods.end_time,1)}}</view>  
550 - </view>  
551 - </view> -->  
552 - <!-- </view> -->  
553 -  
554 -  
555 - <!--- 宝贝评价 ---->  
556 - <!-- <view class="bdt16" style="overflow: hidden">  
557 - <view class="bb_view">  
558 - <view>宝贝评价({{categories3[0].num}})</view>  
559 - <view class="red_bb" bindtap="look_pj">查看全部  
560 - <text class="bg_jj"></text>  
561 - </view>  
562 - </view>  
563 -  
564 - <view class="xc_comment">  
565 - <view class="xc_comment-have-pictures" data-val="5" bindtap="clik_evaluate">有图({{categories3[1].num}}) </view>  
566 - <view class="xc_comment-discuss" data-val="2" bindtap="clik_evaluate">好评({{categories3[2].num}}) </view>  
567 - <view class="xc_comment-discuss" data-val="3" bindtap="clik_evaluate">中评({{categories3[3].num}}) </view>  
568 - <view class="xc_comment-discuss" data-val="4"bindtap="clik_evaluate">差评({{categories3[4].num}}) </view>  
569 - </view>  
570 -  
571 - <scroll-view scroll-x="true" class="pj_scroll">  
572 -  
573 - <view class="xc_comment-detail" style="display: inline-block" wx:for="{{fir_comments}}" wx:key="fir_comments">  
574 - <view class="xc_comment-left">  
575 - <view class="xc_comment-user">  
576 - <view class="xc_user-img">  
577 - <image class="xc_imgs" src='{{item.is_anonymous!=1?item.head_pic:iurl+"/miniapp/images/hui_hear_pic.png"}}' binderror="bind_bnerr2" data-errorimg="fir_comments[{{index}}].head_pic"></image>  
578 - </view>  
579 -  
580 - <view class="xc_user">  
581 - <view class="xc_user-name five-level-word">{{item.is_anonymous!=1?item.username:'匿名'}}</view>  
582 - <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image>  
583 - </view>  
584 - </view>  
585 - <view class="xc_comment-font pj_word_size ellipsis-2">  
586 - {{item.content?item.content:''}}  
587 - </view>  
588 - <view class="xc_comment-val">  
589 - <view class="xc_comment-time">{{item.add_time}}</view>  
590 -  
591 - </view>  
592 - </view>  
593 - <view class="xc_goods-img-frame">  
594 - <image wx:if="{{item.img[0]!=undefined && item.img[0]!=null}}" class="xc_goods-img" src='{{iurl+item.img[0]}}'></image>  
595 - <image wx:elif="{{item.weapp_img[0]!=undefined && item.weapp_img[0]!=null}}" class="xc_goods-img" src='{{item.weapp_img[0]}}'></image>  
596 - <image wx:else class="xc_goods-img" src='{{gallery[0].image_url}}'></image>  
597 - </view>  
598 - </view>  
599 -  
600 - </scroll-view>  
601 - </view> --> 92 + </view>
602 93
  94 +
603 <!-- 图文详情 --> 95 <!-- 图文详情 -->
604 <view> 96 <view>
605 - <view class="tuwen_title"> 97 + <view class="tuwen_title">
606 <view class="g_line"></view> 98 <view class="g_line"></view>
607 <view class="center_s"> 99 <view class="center_s">
608 - <image src="{{iurl}}/miniapp/images/tuwen_c.png"></image>  
609 - <text>详情</text>  
610 - </view>  
611 - </view>  
612 - <view>{{data.serviceContent}}</view>  
613 - <!-- <view class="t_g_info">  
614 - <view class="red_shu"></view>  
615 - <view class="fs30">商品信息</view>  
616 - </view> -->  
617 - <!-- <view class="table_s">  
618 - <view class="tb_item tb-l">  
619 - <view class="item_left">  
620 - <text>商品名称</text>  
621 - </view>  
622 - <view class="item_right">  
623 - <text>{{data.goods_name}}</text>  
624 - </view>  
625 - </view>  
626 - <view class="tb_item tb-l">  
627 - <view class="item_left">  
628 - <text>商品编号</text>  
629 - </view>  
630 - <view class="item_right">  
631 - <text>{{data.goods_sn}}</text>  
632 - </view>  
633 - </view>  
634 - <view class="tb_item tb-l">  
635 - <view class="item_left">  
636 - <text>商品条码</text>  
637 - </view>  
638 - <view class="item_right">  
639 - <text>{{data.sku}}</text>  
640 - </view>  
641 - </view>  
642 - <view class="tb_item tb-l" wx:if="{{cat_name && is_show_pl}}">  
643 - <view class="item_left">  
644 - <text>品类</text>  
645 - </view>  
646 - <view class="item_right">  
647 - <text>{{cat_name}}</text>  
648 - </view>  
649 - </view>  
650 - <view class="tb_item tb-l" wx:if="{{brand_name && is_show_pp}}">  
651 - <view class="item_left">  
652 - <text>品牌</text>  
653 - </view>  
654 - <view class="item_right">  
655 - <text>{{brand_name}}</text>  
656 - </view>  
657 - </view>  
658 - <view class="tb_item tb-l" wx:if="{{nation_name && is_show_gb}}">  
659 - <view class="item_left">  
660 - <text>国别</text>  
661 - </view>  
662 - <view class="item_right">  
663 - <text>{{nation_name}}</text>  
664 - </view>  
665 - </view>  
666 - <view class="tb_item tb-l">  
667 - <view class="item_left">  
668 - <text>规格</text>  
669 - </view>  
670 - <view class="item_right">  
671 - <text>{{filters.show_gui_ge(data.goods_spec,data.goods_color)}}</text>  
672 - </view>  
673 - </view>  
674 - <view class="tb_item tb-l">  
675 - <view class="item_left">  
676 - <text>上架时间</text>  
677 - </view>  
678 - <view class="item_right">  
679 - <text>{{data.on_time}}</text>  
680 - </view> 100 + <image src="{{iurl}}/miniapp/images/tuwen_c.png"></image><text>详情</text>
681 </view> 101 </view>
682 - </view> -->  
683 - <!--详情图片-->  
684 - <!-- <view class="wxParse">  
685 - <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>  
686 - </view> --> 102 + </view>
  103 + <view class="wxParse">
  104 + <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>
  105 + </view>
  106 +
687 </view> 107 </view>
688 108
689 <!-- 推荐商品 --> 109 <!-- 推荐商品 -->
@@ -694,168 +114,19 @@ @@ -694,168 +114,19 @@
694 </image> 114 </image>
695 <view class="xc-recommend-word">推荐</view> 115 <view class="xc-recommend-word">推荐</view>
696 </view> 116 </view>
697 - </view>  
698 - 117 + </view>
699 <goods_recommend id="goods_list"></goods_recommend> --> 118 <goods_recommend id="goods_list"></goods_recommend> -->
700 119
701 </view> 120 </view>
702 121
703 - <!------------商品详情图片页面---------------->  
704 - <!-- <view class="goods-norms" hidden="{{activeCategoryId==1?false:true}}">  
705 - <view class="table_s">  
706 - <view class="tb_item tb-l">  
707 - <view class="item_left">  
708 - <text>商品名称</text>  
709 - </view>  
710 - <view class="item_right">  
711 - <text>{{data.goods_name}}</text>  
712 - </view>  
713 - </view>  
714 - <view class="tb_item tb-l">  
715 - <view class="item_left">  
716 - <text>商品编号</text>  
717 - </view>  
718 - <view class="item_right">  
719 - <text>{{data.goods_sn}}</text>  
720 - </view>  
721 - </view>  
722 - <view class="tb_item tb-l">  
723 - <view class="item_left">  
724 - <text>商品条码</text>  
725 - </view>  
726 - <view class="item_right">  
727 - <text>{{data.sku}}</text>  
728 - </view>  
729 - </view>  
730 - <view class="tb_item tb-l" wx:if="{{cat_name && is_show_pl}}">  
731 - <view class="item_left">  
732 - <text>品类</text>  
733 - </view>  
734 - <view class="item_right">  
735 - <text>{{cat_name}}</text>  
736 - </view>  
737 - </view>  
738 - <view class="tb_item tb-l" wx:if="{{brand_name && is_show_pp}}">  
739 - <view class="item_left">  
740 - <text>品牌</text>  
741 - </view>  
742 - <view class="item_right">  
743 - <text>{{brand_name}}</text>  
744 - </view>  
745 - </view>  
746 - <view class="tb_item tb-l" wx:if="{{nation_name && is_show_gb}}">  
747 - <view class="item_left">  
748 - <text>国别</text>  
749 - </view>  
750 - <view class="item_right">  
751 - <text>{{nation_name}}</text>  
752 - </view>  
753 - </view>  
754 - <view class="tb_item tb-l">  
755 - <view class="item_left">  
756 - <text>规格</text>  
757 - </view>  
758 - <view class="item_right">  
759 - <text>{{data.goods_spec==""?"规格1":data.goods_spec}}</text>  
760 - </view>  
761 - </view>  
762 - <view class="tb_item tb-l">  
763 - <view class="item_left">  
764 - <text>上架时间</text>  
765 - </view>  
766 - <view class="item_right">  
767 - <text>{{data.on_time}}</text>  
768 - </view>  
769 - </view>  
770 - </view>  
771 -  
772 - <view class="wxParse">  
773 - <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>  
774 - </view>  
775 - </view> -->  
776 - <!---------------评价页面-------------->  
777 - <!-- <view class="goods-comment" hidden="{{activeCategoryId==2?false:true}}">  
778 - <view class="topframe">  
779 - <view class="topframe-top">  
780 - <view class="topframe-top-content">  
781 - <view>宝贝评价</view>  
782 - <view class="topframe-top-val">({{categories3[0].num}})</view>  
783 - </view>  
784 - <view class="topframe-praise" wx:if="{{categories3[0].num}}">好评{{ filters.toFix(categories3[2].num/categories3[0].num*100,2) }}%</view>  
785 - <view wx:else>好评 0%</view>  
786 - </view>  
787 - <view class="buttem-list">  
788 - <view bindtap="tabClick3" id="{{item.id}}" wx:for="{{categories3}}" wx:key="categories3" class="item {{activeCategoryId3==item.id?'red':''}}">{{item.name}}({{item.num}})</view>  
789 - </view>  
790 - </view>  
791 -  
792 - <block wx:for="{{comments}}" wx:for-index="cIdx" wx:key="{{cIdx}}">  
793 - <view style='border-bottom:4rpx solid #eee;'>  
794 - <view class="middle">  
795 - <view class="middle-img-frame">  
796 - <image class="middle-img" src="{{item.is_anonymous!=1?item.head_pic:iurl+'/miniapp/images/hui_hear_pic.png'}}" binderror="bind_bnerr2" data-errorimg="comments[{{cIdx}}].head_pic"></image>  
797 - <view class="middle-user-frame">  
798 - <view class="middle-user">{{item.username==''||item.is_anonymous==1 ?'匿名用户':item.username}}</view>  
799 - <image class="star" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image>  
800 - </view>  
801 - </view>  
802 - <view class="xc-pirces">  
803 - <view class="middle-font {{item.seeMore==true?'ellipsis-3':''}}" >  
804 - {{item.content?item.content:''}}  
805 - </view>  
806 - </view>  
807 - <view wx:if='{{item.seeMore}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleHandler'>全部显示</view>  
808 - <view wx:if='{{!item.seeMore && item.auto}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleContent'>收起</view>  
809 - <view class="img-ul">  
810 -  
811 - <block wx:if="{{item.source_type==0}}">  
812 - <view class="img-li" wx:for="{{item.img}}" wx:key="{{index}}">  
813 - <image bindtap="previewCommentImgs" class="wh100" data-cidx="{{cIdx}}" data-img="{{iurl}}{{item}}"  
814 - data-id="{{index}}" src="{{iurl}}{{item}}"></image>  
815 - </view>  
816 - </block>  
817 - <block wx:if="{{item.source_type==1}}">  
818 - <view class="img-li" wx:for="{{item.weapp_img}}" wx:if="{{aitem.length>10}}" wx:key="{{index}}" wx:for-item="aitem">  
819 - <image bindtap="previewCommentImgs_w" class="wh100" data-cidx="{{cIdx}}" data-img="{{aitem}}"  
820 - data-id="{{index}}" src="{{aitem}}"></image>  
821 - </view>  
822 - </block>  
823 - </view>  
824 -  
825 - <view class="z_parameter">  
826 - <view class="parameter-font">{{item.add_time}}</view>  
827 - <view class="parameter-dian" bindtap="click_zan" data-com_id="{{item.comment_id}}" data-item_id="{{cIdx}}">  
828 - <image wx:if="{{item.userZanNum==1}}" class="parameter-img" src="{{iurl}}/miniapp/images/zan_red.png"></image>  
829 - <image wx:else class="parameter-img" src="{{iurl}}/miniapp/images/dianzan.png"></image>  
830 - <view class="parameter-val" style='color:{{item.userZanNum==1? "#d60022":"#999" }}' >{{item.zan_num}}</view>  
831 - </view>  
832 - </view>  
833 -  
834 - </view>  
835 - <view class="reply rel" wx:if="{{item.replay_list}}">  
836 - <view class="line_bulge"></view>  
837 - <view class="shop-reply">店家回复: </view>  
838 - <view class="shop-font" wx:for="{{item.replay_list}}" wx:for-item="r_item" wx:key="{{index}}">  
839 - {{r_item.content}}  
840 - </view>  
841 - </view>  
842 - </view>  
843 - </block>  
844 - <block wx:if="{{(!comments || comments.length==0) && get_c }}">  
845 - <text class="no_pj_list">暂无评价</text>  
846 - </block>  
847 - <block wx:if="{{comments.length>10 && comments_no_more}}">  
848 - <text class="no_pj_list">已经加载到底部</text>  
849 - </block>  
850 - </view> -->  
851 - </view> 122 + </view>
852 </view> 123 </view>
853 <!---滚动到顶部----> 124 <!---滚动到顶部---->
854 <view bindtap="doScrollTop" class="toTop" wx:if="{{supportPageScroll}}"> 125 <view bindtap="doScrollTop" class="toTop" wx:if="{{supportPageScroll}}">
855 <image class="wh100" src="{{iurl}}/miniapp/images/topup.png"></image> 126 <image class="wh100" src="{{iurl}}/miniapp/images/topup.png"></image>
856 </view> 127 </view>
857 128
858 - <!-------------------底部按钮--------------------> 129 + <!-- 底部按钮 -->
859 <view class="join-cart"> 130 <view class="join-cart">
860 <!-- bindtap="contactService" --> 131 <!-- bindtap="contactService" -->
861 <button wx:if="{{sys_switch.weapp_customertype}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> 132 <button wx:if="{{sys_switch.weapp_customertype}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
@@ -867,11 +138,6 @@ @@ -867,11 +138,6 @@
867 <view>客服</view> 138 <view>客服</view>
868 </view> 139 </view>
869 140
870 - <view bindtap="collectGoods" class="custom-service cart-ico new_split">  
871 - <image hidden="{{is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart.png"></image>  
872 - <image hidden="{{!is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart-h.png"></image>  
873 - <view>收藏</view>  
874 - </view>  
875 <view class="shopping-cart cart-ico new_split"> 141 <view class="shopping-cart cart-ico new_split">
876 <navigator open-type="switchTab" url="/pages/cart/cart/cart"> 142 <navigator open-type="switchTab" url="/pages/cart/cart/cart">
877 <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image> 143 <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image>
@@ -879,128 +145,19 @@ @@ -879,128 +145,19 @@
879 <view>购物车</view> 145 <view>购物车</view>
880 </navigator> 146 </navigator>
881 </view> 147 </view>
882 - <view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:if="{{data.goods.is_virtual}}">立即购买</view>  
883 -  
884 - <!-- 普通商品购买 -->  
885 - <block wx:if="{{prom_type==0 || prom_type==2 || prom_type==3}}">  
886 -  
887 - <!-- 线上销售的时候,要判断库存量, 线下库存的时候不用判断 -->  
888 - <!-- <block wx:if="{{(sele_g.store_count>0 && sales_rules==1) || sales_rules==2 }}"> --> 148 +
889 <block> 149 <block>
890 - <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view>  
891 - <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view> 150 + <!-- <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> -->
  151 + <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn" style="width: 64%; border-radius: 56rpx;">立即购买</view>
892 </block> 152 </block>
893 - <!-- <block wx:else>  
894 - <view class="is_stock cart-btn is_stock xc-ash-b " style="width:55.5%">库存不足</view>  
895 - </block> -->  
896 -  
897 - </block>  
898 -  
899 - <!-------秒杀-------->  
900 - <!-- <block wx:if="{{prom_type==1}}">  
901 - <block wx:if="{{prom_st==1 && !prom_r_null}}">  
902 - <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view>  
903 - <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即抢购</view>  
904 - </block>  
905 - <block wx:if="{{prom_st==0 && !prom_r_null}}">  
906 - <view class="buy-btn cart-btn cart-btn-lg lanse set_width">即将开始</view>  
907 - </block>  
908 - <block wx:if="{{prom_r_null}}">  
909 - <view class="buy-btn cart-btn cart-btn-lg huise set_width">已抢光</view>  
910 - </block>  
911 - <block wx:if="{{prom_st==3 && !prom_r_null}}">  
912 - <view class="buy-btn cart-btn cart-btn-lg lanse set_width">活动已经结束</view>  
913 - </block>  
914 - </block> -->  
915 -  
916 - <!-------拼单-------->  
917 - <!-- <block wx:if="{{prom_type==6}}"> -->  
918 - <!-- <view bindtap="openSpecModel_pt" data-it="1" data-ind="1" class="join-btn cart-btn line-h">  
919 - <view class="fir-v"> -->  
920 - <!-- ¥{{data.shop_price,2)}} -->  
921 - <!-- <block wx:if="{{card_field && sele_g[card_field]>0}}">  
922 - {{filters.toFix(sele_g[card_field],2)}}  
923 - </block>  
924 - <block wx:else>  
925 - {{filters.toFix(sele_g.shop_price,2)}}  
926 - </block>  
927 - </view>  
928 - <view>单独购买</view>  
929 - </view> -->  
930 -  
931 - <!-- <block wx:if="{{user_order_pt_state==0}}"> -->  
932 - <!----商家团---->  
933 - <!-- <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==1}}" class="buy-btn cart-btn line-h">  
934 - <view class="fir-v">¥{{prom_act.price}}</view>  
935 - <view>去参团</view>  
936 - </view> -->  
937 - <!----会员团---->  
938 - <!-- <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==2}}" class="buy-btn cart-btn line-h"> -->  
939 - <!--<view class="fir-v">¥{{prom_act.price}}</view>-->  
940 - <!-- <view class="pd_top1" wx:if="{{prom_act.tz_yhjgtype>1}}">  
941 - <view>一键开团</view>  
942 - <view wx:if="{{prom_act.tz_yhjgtype==3}}">佣金<text style="font-size: 23rpx">¥</text>{{filters.toFix(prom_act.tz_yyhjg,2)}}</view>  
943 - <view wx:if="{{prom_act.tz_yhjgtype==2}}">团长免单</view>  
944 - </view>  
945 - <view wx:else>  
946 - <view class="fir-v">¥{{ filters.toFix(prom_act.price,2)}}</view>  
947 - <view>一键开团</view>  
948 - </view> -->  
949 -  
950 - <!-- </view> -->  
951 - <!---阶梯团---->  
952 - <!-- <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==3 && user_order_pt_state!=3 }}" class="buy-btn cart-btn line-h">  
953 - <view class="fir-v">¥{{filters.toFix(prom_act.yf_price,2)}}</view>  
954 - <view>支付定金</view>  
955 - </view>  
956 -  
957 - <view wx:if="{{prom_st==0}}" class="buy-btn cart-btn lanse">即将开始</view>  
958 - <view wx:if="{{prom_r_null}}" class="buy-btn cart-btn huise">已抢光</view>  
959 - <view wx:if="{{prom_st==3 && !prom_r_null}}" class="buy-btn cart-btn lanse">活动已经结束</view>  
960 - </block>  
961 - <block wx:else>  
962 - <view bindtap="go_to_nopay" wx:if="{{user_order_pt_state==1}}" class="buy-btn cart-btn huise">您还未支付</view>  
963 - <view bindtap="go_to_team_show" wx:if="{{user_order_pt_state==2}}" class="buy-btn cart-btn">查看支付详情</view>  
964 - <view wx:if="{{user_order_pt_state==3}}" bindtap="go_pay_wk" class="buy-btn cart-btn">支付尾款</view>  
965 - </block> -->  
966 - <!-- </block> -->  
967 -  
968 -  
969 - <!-------积分购-------->  
970 - <!-- <block wx:if="{{prom_type==4}}">  
971 -  
972 - <block wx:if="{{is_shopbuy}}">  
973 - <view bindtap="go_pay_integral_normal" class="join-btn cart-btn line-h">  
974 - <view class="fir-v">  
975 - <block wx:if="{{card_field && sele_g[card_field]>0}}">  
976 - {{filters.toFix(sele_g[card_field],2)}}  
977 - </block>  
978 - <block wx:else>  
979 - {{filters.toFix(sele_g.shop_price,2)}}  
980 - </block>  
981 - </view>  
982 - <view>单独购买</view>  
983 - </view>  
984 - <view bindtap="go_pay_integral" class="buy-btn cart-btn" wx:if="{{can_integral}}" >立即兑换</view>  
985 - <view class="buy-btn cart-btn" style="background-color: #aaa;" wx:else >积分不足</view>  
986 - </block>  
987 -  
988 - <block wx:else>  
989 - <view bindtap="go_pay_integral" class="buy-btn-all cart-btn" style="width: 58%; margin-left:1%;" wx:if="{{can_integral}}" >立即兑换</view>  
990 - <view class="buy-btn-all cart-btn" style="background-color: #aaa; width: 58%;margin-left:1%" wx:else >积分不足</view>  
991 - </block>  
992 -  
993 - </block> -->  
994 -  
995 - <!---<view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:else>立即兑换</view>--> 153 +
996 </view> 154 </view>
997 155
998 <!-- 制作一个圆球导航 --> 156 <!-- 制作一个圆球导航 -->
999 <nav_box></nav_box> 157 <nav_box></nav_box>
1000 -  
1001 </block> 158 </block>
1002 159
1003 -<!----弹起来,选择规格数量,普通商品购买和秒杀------> 160 +<!-- 弹起来,选择规格数量,普通商品购买和秒杀 -->
1004 <view hidden="{{!openSpecModal}}"> 161 <view hidden="{{!openSpecModal}}">
1005 <view bindtap="closeSpecModal" class="cover-layer"></view> 162 <view bindtap="closeSpecModal" class="cover-layer"></view>
1006 <view class="spec-model"> 163 <view class="spec-model">
@@ -1009,299 +166,127 @@ @@ -1009,299 +166,127 @@
1009 <view class="spec-goods"> 166 <view class="spec-goods">
1010 <image class="wh100 spec-img" src="{{iurl + data.image_url}}" binderror="pop_err_img" data-errorimg="sele_g.original_img"/> 167 <image class="wh100 spec-img" src="{{iurl + data.image_url}}" binderror="pop_err_img" data-errorimg="sele_g.original_img"/>
1011 <view class="spec-goods-info"> 168 <view class="spec-goods-info">
1012 - <view class="spec-goods-name ellipsis-2">{{data.goods_name}}</view>  
1013 - <!-- <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view> -->  
1014 - <view class="flex ai_end xc-val-money" >  
1015 - <view class="spec-goods-price" wx:if="{{prom_price==null}}" >  
1016 - <text class="fs20">¥</text>  
1017 - <!-- 如果是等级会员,且有等级价 -->  
1018 - <block wx:if="{{card_field && sele_g[card_field]>0}}">{{sele_g[card_field]}} </block>  
1019 - <!-- <block wx:else>{{sele_g.shop_price}}</block> -->  
1020 - <block wx:else>{{data.shop_price}}</block>  
1021 - </view>  
1022 - <view class="spec-goods-price" wx:else><text class="fs20">¥</text>{{prom_price}}</view>  
1023 - <!-- 显示线下价格 -->  
1024 - <!-- <view wx:if="{{sele_g.offline_price}}" class="quan_price flex ai-center jc-center">  
1025 - 券后¥<text class="fs32">{{sele_g.offline_price}}</text>  
1026 - </view> -->  
1027 - </view>  
1028 -  
1029 - <!-- <block wx:if="{{prom_type==0}}">  
1030 - <view class="flex">  
1031 - <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>  
1032 - <block wx:if="{{sales_rules==2}}">  
1033 - <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view>  
1034 - <view class="spec-goods-stock" wx:else>可售:0</view>  
1035 - </block>  
1036 - <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block>  
1037 - </view>  
1038 - </block> -->  
1039 - <!-- <block wx:if="{{prom_type==1}}">  
1040 - <view class="flex">  
1041 - <view class="spec-goods-stock" wx:if="{{prom_st>0}}">已售:{{prom_act.buy_num+prom_act.virtual}}</view>  
1042 - <view class="spec-goods-stock" wx:else >已售:{{prom_act.buy_num}}</view>  
1043 - <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view>  
1044 - </view>  
1045 - </block> -->  
1046 - </view>  
1047 -  
1048 - <!-- 选择门店模块 -->  
1049 - <!-- <view class="flex-space-between address ai_end xc-width ">  
1050 -  
1051 - <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}">  
1052 - <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>  
1053 - <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">  
1054 - 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}  
1055 -  
1056 - </view>  
1057 - </view> -->  
1058 -  
1059 - <!-- 没有门店的时候 -->  
1060 - <!-- <view class="flex" bindtap="choice_store" wx:else>  
1061 - <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>  
1062 - <view class="fs30" style="color:black;">选择门店</view>  
1063 - </view>  
1064 -  
1065 - <view class="red-co fs28" bindtap="choice_store" >  
1066 - 更多门店  
1067 - <text class="right-arrow"></text>  
1068 - </view>  
1069 - </view> -->  
1070 - <!-- <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>  
1071 - <block wx:else>  
1072 - <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>  
1073 - <block wx:else>  
1074 - <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view>  
1075 - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view>  
1076 - </block>  
1077 - </block> -->  
1078 -  
1079 - <!-- <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view> -->  
1080 - </view> 169 + <view class="spec-goods-name ellipsis-2">{{data.goods_name}}</view>
  170 + <view class="flex ai_end xc-val-money" >
  171 + <view class="spec-goods-price"><text class="fs20">¥</text><block wx>{{data.shop_price}}</block></view>
  172 + </view>
  173 + </view>
  174 + </view>
  175 +
  176 + <!-- 选择门店模块 -->
  177 + <view class="flex-space-between address ai_end xc-width" style="margin-top: 30rpx;">
  178 + <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}">
  179 + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
  180 + <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
  181 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
  182 +
  183 + </view>
  184 + </view>
  185 +
  186 + <!-- 没有门店的时候 -->
  187 + <view class="flex" bindtap="choice_store" wx:else>
  188 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  189 + <view class="fs30" style="color:black;">选择门店</view>
  190 + </view>
  191 +
  192 + <view class="red-co fs28" bindtap="choice_store" >
  193 + 更多门店
  194 + <text class="right-arrow"></text>
  195 + </view>
  196 + </view>
  197 + <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>
  198 + <block wx:else>
  199 + <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
  200 + <block wx:else>
  201 + <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view>
  202 + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view>
  203 + </block>
  204 + </block>
  205 +
  206 + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view>
  207 + </view>
1081 208
1082 - <!--商品的属性项目-->  
1083 - <!-- <view class="xc-goods-attribute">  
1084 - <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>  
1085 - <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">  
1086 - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">  
1087 - {{item.gg}}  
1088 - </view>  
1089 - </view>  
1090 - </view> -->  
1091 - 209 +
1092 210
1093 - <view class="b_num"> 211 + <view class="b_num">
1094 <view>购买数量</view> 212 <view>购买数量</view>
1095 <view class="count"> 213 <view class="count">
1096 - <view bindtap="subCartNum" class="sub">-</view>  
1097 - <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input>  
1098 - <view bindtap="addCartNum" class="add">+</view> 214 + <view bindtap="subCartNum" class="sub">-</view>
  215 + <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input>
  216 + <view bindtap="addCartNum" class="add">+</view>
1099 </view> 217 </view>
1100 - </view>  
1101 -  
1102 - <!-- 提示再买多少优惠 -->  
1103 - <!-- <view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition && openSpecModal_ind==2}}">  
1104 - 再买{{hui_condition.need}}  
1105 - <text wx:if="{{hui_condition.money}}">,免{{hui_condition.money}}元</text>  
1106 - <text wx:if="{{hui_condition.sale}}">,打{{hui_condition.sale}}折</text>  
1107 - <text wx:if="{{hui_condition.past==1}}">,包邮</text>  
1108 - <text wx:if="{{hui_condition.intValue>0}}">,送{{hui_condition.intValue}}积分</text>  
1109 - <text wx:if="{{hui_condition.couponId>0}}">,送优惠券</text>  
1110 - <text wx:if="{{hui_condition.gift_id>0}}">,送赠品</text>  
1111 - <text wx:if="{{hui_condition.lb_id>0}}">,送礼包</text>  
1112 - </view> -->  
1113 -  
1114 -  
1115 - </view>  
1116 - <!-- <view class="spec-cart-btns"> -->  
1117 - <!-- <view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">配送不匹配</view> -->  
1118 - <!-- <block wx:else> --> 218 + </view>
  219 +
  220 +
1119 221
1120 - <!-- 根本就找不到门店 -->  
1121 - <!-- <block wx:if="{{!only_pk && !def_pickpu_list}}">  
1122 - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>  
1123 - </block> -->  
1124 - <!-- <block wx:else>  
1125 -  
1126 -  
1127 - <block wx:if="{{only_pk.length && !only_pk.length}}">  
1128 - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>  
1129 - </block>  
1130 - <block wx:else>  
1131 - <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">  
1132 - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>  
1133 - </block>  
1134 - <block wx:else>  
1135 - <block wx:if="{{!def_pick_store}}">  
1136 - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view>  
1137 - </block>  
1138 - <block wx:else> -->  
1139 - <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 -->  
1140 - <!-- <block wx:if="{{sales_rules==2 && prom_type==0}}">  
1141 - <block wx:if="{{!def_pick_store.CanOutQty}}">  
1142 - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>  
1143 - </block>  
1144 - <block wx:else>  
1145 - <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"  
1146 - class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view>  
1147 - <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"  
1148 - class="spec-cart-btn spec-buy" data-action="buy">  
1149 - {{sele_g.offline_price?"券后购买":"立即购买"}}  
1150 - </view>  
1151 - </block>  
1152 - </block> -->  
1153 - <!-- 线上销售 -->  
1154 - <!-- <block wx:else>  
1155 - <block wx:if="{{sele_g.store_count<=0}}">  
1156 - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>  
1157 - </block>  
1158 - <block wx:else>  
1159 - <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"  
1160 - class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view>  
1161 - <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"  
1162 - class="spec-cart-btn spec-buy" data-action="buy">  
1163 - {{sele_g.offline_price?"券后购买":"立即购买"}}  
1164 - </view>  
1165 - </block>  
1166 - </block> -->  
1167 - <!-- </block> -->  
1168 - <!-- </block>  
1169 - </block>  
1170 - </block>  
1171 -  
1172 - </block>  
1173 - </view> --> 222 + <view class="spec-cart-btns">
  223 + <view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn fs32" data-action="add"
  224 + style="background-color: #dcdcdc;color: #999;">配送不匹配</view>
  225 + <block wx:else>
  226 +
  227 + <!-- 根本就找不到门店 -->
  228 + <block wx:if="{{!only_pk && !def_pickpu_list}}">
  229 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  230 + </block>
  231 + <block wx:else>
  232 +
  233 +
  234 + <block wx:if="{{only_pk.length && !only_pk.length}}">
  235 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  236 + </block>
  237 + <block wx:else>
  238 + <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">
  239 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  240 + </block>
  241 + <block wx:else>
  242 + <block wx:if="{{!def_pick_store}}">
  243 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view>
  244 + </block>
  245 + <block wx:else>
  246 + <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 -->
  247 + <block wx:if="{{sales_rules==2 && prom_type==0}}">
  248 + <block wx:if="{{!def_pick_store.CanOutQty}}">
  249 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  250 + </block>
  251 + <block wx:else>
  252 + <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"
  253 + class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view>
  254 + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"
  255 + class="spec-cart-btn spec-buy" data-action="buy">
  256 + {{sele_g.offline_price?"券后购买":"立即购买"}}
  257 + </view>
  258 + </block>
  259 + </block>
  260 + <!-- 线上销售 -->
  261 + <block wx:else>
  262 + <block wx:if="{{sele_g.store_count<=0}}">
  263 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  264 + </block>
  265 + <block wx:else>
  266 + <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"
  267 + class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view>
  268 + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"
  269 + class="spec-cart-btn spec-buy" data-action="buy">
  270 + {{sele_g.offline_price?"券后购买":"立即购买"}}
  271 + </view>
  272 + </block>
  273 + </block>
  274 + </block>
  275 + </block>
  276 + </block>
  277 + </block>
  278 +
  279 + </block>
  280 + </view>
  281 +
  282 +
1174 283
1175 <view class="clear"></view> 284 <view class="clear"></view>
1176 - <!---选择门店的列表--->  
1177 - <view hidden="{{ismend==0}}" class="sto_v">  
1178 - <view class="title" hidden="{{is_sec_mend==1}}" bindtap="hidemend">  
1179 - <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>选择门店  
1180 - </view>  
1181 - <!-----第一级显示------>  
1182 - <!-- <view class="itemlists" hidden="{{is_sec_mend==1}}">  
1183 - <block wx:if="{{is_show_sto_cat}}">  
1184 - <view wx:for="{{all_sto}}" wx:key="all_sto" class="item" bindtap="show_sec" data-index="{{index}}">{{item.name}}</view>  
1185 - </block>  
1186 - <block wx:else>  
1187 - <view wx:for="{{only_pk}}" wx:key="only_pk" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}">{{item.pickup_name}}</view>  
1188 - </block>  
1189 - </view> -->  
1190 - <!-----第二级显示------>  
1191 - <!-- <view class="stitle" hidden="{{is_sec_mend==0}}" bindtap="hide_sec_mend">  
1192 - <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>{{sec_sto.name}}  
1193 - </view> -->  
1194 - <!-- <view class="itemlists" hidden="{{is_sec_mend==0}}">  
1195 - <view wx:for="{{sec_sto.s_arr}}" wx:key="{{index}}" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}">{{item.pickup_name}}  
1196 - </view>  
1197 - </view> -->  
1198 - </view> 285 +
1199 </view> 286 </view>
1200 </view> 287 </view>
1201 288
1202 -<!-- 弹起来,购买积分购 -->  
1203 -<!-- <view hidden="{{!openSpecModal_inte}}">  
1204 - <include src="buy_integral.wxml" />  
1205 -</view> -->  
1206 -<!-- 弹起来,购买积分购的普通购买 -->  
1207 -<!-- <view hidden="{{!openSpecModal_inte_normal}}">  
1208 - <include src="buy_integral_normal.wxml" />  
1209 -</view> -->  
1210 289
1211 -<!----弹起来,选择规格数量,拼单商品购买------>  
1212 -<!-- <view hidden="{{!openSpecModal_pt}}">  
1213 - <include src="buy_pt.wxml" />  
1214 -</view> -->  
1215 -  
1216 -<!----弹起来优惠信息------>  
1217 -<!-- <view hidden="{{!openPromModal}}">  
1218 - <view bindtap="closePromModal" class="cover-layer"></view>  
1219 - <view class="prom-model">  
1220 - <icon bindtap="closePromModal" class="modal-close" color="gray" size="22" type="cancel"></icon>  
1221 - <view class="prom-title">优惠信息</view>  
1222 - <view class="logistics-item" wx:for="{{select.activity.data}}" wx:key="{{index}}">  
1223 - <view class="item-title">  
1224 - <text class="prom-item">{{item.title}}</text>  
1225 - </view>  
1226 - <view class="item-mes ellipsis-1">{{item.content}}</view>  
1227 - </view>  
1228 - </view>  
1229 -</view> -->  
1230 -<!----弹起的---->  
1231 -<!-- <block wx:if="{{pd_xx==1}}">  
1232 - <view class="bview"></view>  
1233 - <view class="juzhong">  
1234 - <view class="xq">  
1235 - <view class="title" bindtap="close_pt_xx">拼团玩法介绍  
1236 - <image src="{{iurl}}/miniapp/images/gbi.png" class="close"></image>  
1237 - </view>  
1238 - <view>1.开团:  
1239 - <text class="hs1">选择心仪商品,点击“发起X人团”按钮,付款后即为开团成功;</text>  
1240 - </view>  
1241 - <view>2.参团:  
1242 - <text class="hs1">进入朋友分享的页面,点击“立即参团”按钮,付款后即为参团成功,若多人同时支付,支付成功时间较早的人获得参团资格;</text>  
1243 - </view>  
1244 - <view>3.成团:  
1245 - <text class="hs1">在开团或参团成功后,点击“邀请小伙伴参团”将页面分享给好友,在有效时间内凑齐人数即为成团,此时商家会开始发货;</text>  
1246 - </view>  
1247 - <view>4.组团失败:  
1248 - <text class="hs1">在有效时间内未凑齐人数,即为组团失败,此时付款项会原路退回到支付账户;</text>  
1249 - </view>  
1250 - <view>5.  
1251 - <text class="hs1">组团有效期间内,拼购商品订单不允许取消。 </text>  
1252 - </view>  
1253 - </view>  
1254 - </view>  
1255 -</block> -->  
1256 -<!----弹起领券---->  
1257 -<view wx:if='{{coupon==1}}'>  
1258 - <view class="cover-layer flex-center" data-coupon='0' bindtap="switchCoupon"></view>  
1259 - <view class="cx-popup {{coupon== true ? 'up' : 'down'}} ">  
1260 - <!-- <view class="top-frame">  
1261 - <view class="top two-level-word t-c">  
1262 - 优惠券领取  
1263 - </view>  
1264 - </view> -->  
1265 - <!-- <view class="top-frame">  
1266 - <view class="xc-valid-coupon four-level-word">可以领优惠券</view>  
1267 - </view> -->  
1268 - <view class="xc-frame">  
1269 - <view class="top-frame">  
1270 - <view class="xc-coupon-frame">  
1271 - <!---单张的券--->  
1272 - <view class="rel" wx:for="{{quan_list}}" wx:key="{{index}}">  
1273 - <view class="coupon flex">  
1274 - <view class="circle xc-circular-one"></view>  
1275 - <view class="xc-coupon-left ">  
1276 - <view class="flex xc-money-frame">  
1277 - <view class=" xc-money two-level-word xc-rmb">¥</view>  
1278 - <view class="one-level-word xc-money">{{item.money}}</view>  
1279 - </view>  
1280 - <view class="xc-money four-level-word xc-spacing">  
1281 - 满{{item.condition}}元可用  
1282 - </view>  
1283 - </view>  
1284 - <view class="xc-coupon-right flex">  
1285 - <view class="xc-detail-coupon">  
1286 - <view class="four-level-word">订单金额满{{item.condition}}元可用</view>  
1287 - <view class="four-level-word xc-below">{{item.start}}-{{item.end}}</view>  
1288 - </view>  
1289 - <view class="flex-vertical">  
1290 - <view class="three-level-word xc-get background {{item.everyone_num>0 && item.lqnum>=item.everyone_num?'nouse':''}}"  
1291 - data-ind="{{index}}" data-cid="{{item.id}}" bindtap="get_quan">{{ item.linging==1?'领取中':'领取'}}</view>  
1292 - </view>  
1293 - </view>  
1294 - <view class="circle xc-circular-two"></view>  
1295 - </view>  
1296 - </view>  
1297 - </view>  
1298 - </view>  
1299 - </view>  
1300 - <view class="cx-confirm flex-center" data-coupon='0' bindtap="switchCoupon">  
1301 - <view class="confirm t-c">确定</view>  
1302 - </view>  
1303 - </view>  
1304 -</view>  
1305 290
1306 <!-- 选择门店的弹框,1.1版最新的 --> 291 <!-- 选择门店的弹框,1.1版最新的 -->
1307 <block wx:if="{{store==1}}"> 292 <block wx:if="{{store==1}}">
@@ -1458,14 +443,9 @@ @@ -1458,14 +443,9 @@
1458 <view class="poster-container"> 443 <view class="poster-container">
1459 <view class="poster-wrapper"> 444 <view class="poster-wrapper">
1460 <view class="poster"> 445 <view class="poster">
1461 - <!-- <view class="poster" bindtap="previewImage"> -->  
1462 - <image src="{{shareImgPath}}" class="poster-img" show-menu-by-longpress></image>  
1463 - <view class="btn-close" catchtap="closePoster"><text class="iconfont icon-close"></text></view>  
1464 - </view>  
1465 - <!-- <view class="btn-container">  
1466 - <button class="btn-share" open-type="share" bindtap="">微信好友分享</button>  
1467 - <button class="btn-share" bindtap="savePic">保存到相册</button>  
1468 - </view> --> 446 + <image src="{{shareImgPath}}" class="poster-img" show-menu-by-longpress></image>
  447 + <view class="btn-close" catchtap="closePoster"><text class="iconfont icon-close"></text></view>
  448 + </view>
1469 </view> 449 </view>
1470 </view> 450 </view>
1471 </view> 451 </view>
packageA/pages/goodsInfo/goodsInfo.wxss
@@ -348,11 +348,11 @@ image { @@ -348,11 +348,11 @@ image {
348 } 348 }
349 349
350 .join-cart>view { 350 .join-cart>view {
351 - width: 29%; 351 + width: 32%;
352 } 352 }
353 353
354 .join-cart>.new_split { 354 .join-cart>.new_split {
355 - width: 13%; 355 + width: 17%;
356 text-align: center; 356 text-align: center;
357 padding: 0; 357 padding: 0;
358 margin: 0; 358 margin: 0;
pages/togoin/togoin.js
@@ -10,21 +10,37 @@ Page({ @@ -10,21 +10,37 @@ Page({
10 imghots: os.imghost, 10 imghots: os.imghost,
11 store_logo:'', 11 store_logo:'',
12 first_leader:'', //-- 邀请人 -- 12 first_leader:'', //-- 邀请人 --
  13 + config2:null,
13 }, 14 },
14 onLoad: function (options) { 15 onLoad: function (options) {
15 getApp().globalData.isLoad_ad=1; 16 getApp().globalData.isLoad_ad=1;
16 //--判断是否有接受到邀请人的ID-- 17 //--判断是否有接受到邀请人的ID--
17 if(options.first_leader){ 18 if(options.first_leader){
18 - this.setData({first_leader:options.first_leader}); 19 + this.setData({first_leader:options.first_leader});
19 }else if(getApp().globalData.first_leader){ 20 }else if(getApp().globalData.first_leader){
20 - this.setData({first_leader:getApp().globalData.first_leader});  
21 - 21 + this.setData({first_leader:getApp().globalData.first_leader});
22 } 22 }
23 var th=this; 23 var th=this;
24 app.getConfig(function (e) { 24 app.getConfig(function (e) {
25 var logo=th.data.imghots+e.store_logo; 25 var logo=th.data.imghots+e.store_logo;
26 th.setData({ store: e,store_logo:logo}); 26 th.setData({ store: e,store_logo:logo});
27 - }) 27 + })
  28 +
  29 + app.getConfig2(function (e) {
  30 + if(e.reg_type==1){
  31 + var need_go=0;
  32 + var arr=JSON.parse(e.reg_info);
  33 + if(arr['name_state']==1) need_go=1;
  34 + if(!need_go && arr['birthday_state']==1) need_go=1;
  35 + if(!need_go && arr['idcard_state']==1) need_go=1;
  36 + if(!need_go && arr['address_state']==1) need_go=1;
  37 + if(!need_go && arr['pick_state']==1) need_go=1;
  38 + if(!need_go && arr['sex_state']==1) need_go=1;
  39 + if(!need_go && arr['introducer_state']==1) need_go=1;
  40 + th.setData({need_go:1});
  41 + }
  42 +
  43 + })
28 }, 44 },
29 //绑定手机号 45 //绑定手机号
30 getphone:function (e) { 46 getphone:function (e) {
@@ -166,8 +182,16 @@ Page({ @@ -166,8 +182,16 @@ Page({
166 182
167 wx.setStorageSync("userinfo",e.data.data); 183 wx.setStorageSync("userinfo",e.data.data);
168 wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = t.getFullUrl(a.globalData.userInfo.head_pic); 184 wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = t.getFullUrl(a.globalData.userInfo.head_pic);
169 - wx.navigateBack({ delta: 1})  
170 - 185 + //如果有需要跳转,就跳转到.如果微信端有注册,就不需要跳转
  186 + if(app.globalData.userInfo['openid']){
  187 + th.data.need_go=0;
  188 + }
  189 + if(th.data.need_go){
  190 + getApp().goto("/packageA/pages/profile/profile");
  191 + }else{
  192 + wx.navigateBack({ delta: 1})
  193 + }
  194 +
171 }, 195 },
172 failStatus: function (t) { 196 failStatus: function (t) {
173 return app.my_warnning("授权登入失败,请稍后再试!", 0, that); 197 return app.my_warnning("授权登入失败,请稍后再试!", 0, that);
@@ -184,5 +208,6 @@ Page({ @@ -184,5 +208,6 @@ Page({
184 _errObj[_errImg] = this.data.imghots+"/miniapp/images/logo.png"; 208 _errObj[_errImg] = this.data.imghots+"/miniapp/images/logo.png";
185 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; 209 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
186 } 210 }
187 - 211 +
  212 +
188 }) 213 })
pages/togoin/togoin.wxml
@@ -51,5 +51,5 @@ @@ -51,5 +51,5 @@
51 </view> 51 </view>
52 </view> 52 </view>
53 </view> 53 </view>
54 -  
55 <warn id="warn"></warn> 54 <warn id="warn"></warn>
  55 +