Commit a223079631d6574381eb238f5179c12477838750

Authored by yvan.ni
1 parent f46752b4

预售服务卡的优化

packageC/pages/presell/cardInfo/goodsInfo.js
... ... @@ -730,6 +730,7 @@ Page({
730 730 'service_sn':t.data.data.serviceSn,
731 731 'goods_sn':t.data.data.serviceSn,
732 732 'listServiceVideos': t.data.data.listServiceVideos,
  733 + 'erpItemID': t.data.data.erpItemID,
733 734 }
734 735  
735 736 that.setData({
... ... @@ -916,6 +917,8 @@ Page({
916 917 goods_name: o.goods_name,
917 918 goods_sn: o.goods_sn,
918 919 presell_list_id: th.data.presellList.id,
  920 + erpItemID: o.erpItemID,
  921 + keyid: th.data.sto_sele_keyid,
919 922 };
920 923  
921 924 //---是不是从收藏夹出来的---
... ...
packageC/pages/presell/cart/cart2_pre.js
... ... @@ -823,14 +823,14 @@ Page({
823 823 var th = this,pdata = new Array();
824 824  
825 825 var item = {
826   - 'user_id': to.globalData.user_id,
  826 + 'user_id': getApp().globalData.user_id,
827 827 'account': th.data.formData.order_amount, //使用余额
828   - 'store_id': oo.stoid, //商家
  828 + 'store_id': os.stoid, //商家
829 829 'list': new Array(),
830 830 };
831 831  
832 832 //判断是不是购物车购买还是立即购买
833   - var gg = getApp().globalData.service_now;
  833 + var gg = app.get_b_now();
834 834 if (!gg.pick_id) {
835 835 getApp().showWarning("未找到门店");
836 836 return false;
... ... @@ -839,7 +839,7 @@ Page({
839 839 'card_id': th.data.bn_goods.id,
840 840 'itemid': th.data.bn_goods.erpItemID,
841 841 'qty': gg.goods_num,
842   - 'price': th.data.bn_goods.money,
  842 + 'price': th.data.bn_goods.shop_price,
843 843 // 'price': th.data.formData.order_amount,
844 844 'pickup_id': gg.pick_id,
845 845 'pickup_keyid': gg.keyid,
... ... @@ -847,10 +847,6 @@ Page({
847 847 'prom_id': this.data.postdata.prom_id, //促销活动id
848 848 };
849 849  
850   - if(this.data.postdata.prom_type == 1) {
851   - goods.price = this.data.postdata.prom_price;
852   - };
853   -
854 850 if(getApp().globalData.skinface_id){
855 851 goods.skinface_id=getApp().globalData.skinface_id;
856 852 }
... ... @@ -865,7 +861,7 @@ Page({
865 861 goods.guide_id = gg.guide_id;
866 862 goods.guide_type = gg.guide_type;
867 863 //调用接口判断是不是会员
868   - await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(
  864 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + os.stoid + "/" + gg.guide_id, {}).then(
869 865 res => {
870 866 if (res.data.code == 0) {
871 867 goods.guide_name = res.data.data.salesman;
... ... @@ -888,7 +884,7 @@ Page({
888 884 title: "加载中"
889 885 });
890 886 wx.request({
891   - url: oo.url + '/api/weshop/recharge/saveRecharge',
  887 + url: os.url + '/api/weshop/recharge/saveRecharge',
892 888 data: str,
893 889 method: 'POST',
894 890 header: {
... ... @@ -901,14 +897,7 @@ Page({
901 897 var data = res.data;
902 898 if (data.code == 0) {
903 899 th.data.order_id = data.data.order_id;
904   - // console.log('myyyyyyyyyyyyyyyyyy', data.data);
905   - if (th.data.is_cart) {
906   - var list = th.data.cartlist_y;
907   - for (var i = 0; i < list.length; i++) {
908   - //删除购物车
909   - a.delete("/api/weshop/cartService/del/" + oo.stoid + "/" + list[i].id, {});
910   - }
911   - }
  900 +
912 901 var order_amount = pdata.account;
913 902 //要进行判断,如果是用微信支付,就要跳转到支付界面
914 903 if (order_amount > 0) {
... ... @@ -920,7 +909,7 @@ Page({
920 909 t_pay.pay(
921 910 {
922 911 parentSn: data.data.order_sn,
923   - store_id: oo.stoid
  912 + store_id: os.stoid
924 913 },function (){
925 914 wx.showToast({
926 915 title: '购买成功',
... ...