Commit e4079878cb6ab0f5a74ddaab987548a8cea34511

Authored by yvan.ni
1 parent 05171cbb

预约分享

packageA/pages/goodsInfo/goodsInfo.js
@@ -198,6 +198,9 @@ Page({ @@ -198,6 +198,9 @@ Page({
198 198
199 //------初始化加载---------- 199 //------初始化加载----------
200 onLoad: function(t) { 200 onLoad: function(t) {
  201 +
  202 + console.log("--服务卡项--");
  203 + console.log(t);
201 204
202 var ee = this, 205 var ee = this,
203 that = ee, 206 that = ee,
packageA/pages/my_service/appment_main.js
@@ -150,7 +150,7 @@ Page({ @@ -150,7 +150,7 @@ Page({
150 "keyword": res.data.data.Address 150 "keyword": res.data.data.Address
151 } 151 }
152 ], 152 ],
153 - "page": "/packageA/pages/my_service/tment_details?number=" + number, 153 + "page": "/packageA/pages/my_service/tment_details?number=" + number+"&userid="+th.data.options.userid,
154 "storeId": a.stoid, 154 "storeId": a.stoid,
155 "typeId": "1011", 155 "typeId": "1011",
156 "userId": th.data.options.userid 156 "userId": th.data.options.userid
@@ -168,7 +168,7 @@ Page({ @@ -168,7 +168,7 @@ Page({
168 }) 168 })
169 setTimeout(function() { 169 setTimeout(function() {
170 wx.redirectTo({ 170 wx.redirectTo({
171 - url: "/packageA/pages/my_service/tment_details?number=" + number 171 + url: "/packageA/pages/my_service/tment_details?number=" + number+"&userid="+th.data.options.userid,
172 }); 172 });
173 }, 1000); 173 }, 1000);
174 } else { 174 } else {
@@ -579,14 +579,16 @@ Page({ @@ -579,14 +579,16 @@ Page({
579 UserCode: th.data.options.usercode, 579 UserCode: th.data.options.usercode,
580 } 580 }
581 }).then(res => { 581 }).then(res => {
582 - console.log('res==>', a.stoid, e.globalData.guide_id, th.data.options.usercode); 582 + console.log('res==>', a.stoid, e.globalData.guide_id, th.data.options.usercode);
583 if(res.data.data.Tech) { 583 if(res.data.data.Tech) {
584 - th.setData({ 584 +
  585 + var data={
585 store_name: res.data.data.StorageName, 586 store_name: res.data.data.StorageName,
586 beautician_name: res.data.data.StaffName, 587 beautician_name: res.data.data.StaffName,
587 beauticianID: res.data.data.StaffId, 588 beauticianID: res.data.data.StaffId,
588 StorageId: res.data.data.StorageId, 589 StorageId: res.data.data.StorageId,
589 - }); 590 + }
  591 + th.check_firleader(data);
590 } 592 }
591 }); 593 });
592 594
@@ -670,4 +672,75 @@ Page({ @@ -670,4 +672,75 @@ Page({
670 // var nav_b = th.selectComponent("#nav_b"); //组件的id 672 // var nav_b = th.selectComponent("#nav_b"); //组件的id
671 // nav_b.close_box(); 673 // nav_b.close_box();
672 // } 674 // }
  675 +
  676 + //判断分享的导购是不是有门店,是不是该门店下又该会员
  677 + check_firleader(data){
  678 + var th=this;
  679 + var itemId = this.data.itemId; //服务id
  680 + var url = "/api/weshop/marketing/reservation/storage/pagenew";
  681 + var key_word = data.store_name;
  682 + key_word = key_word.replace(/\s+/g, "");
  683 + getApp().request.promiseGet(url, {
  684 + data: {
  685 + userId: th.data.options.userid,
  686 + storeId: os.stoid,
  687 + serviceId: itemId,
  688 + latitude: th.data.lat,
  689 + longitude: th.data.lon,
  690 + page: 1,
  691 + pageSize: 1000,
  692 + keyWord: key_word
  693 + }
  694 + }).then(res => {
  695 + //-- 如果是门店的话 --
  696 + if (res.data.code == 0 && res.data.data && res.data.data.pageData) {
  697 + var store_data=null;
  698 + for(var i in res.data.data.pageData){
  699 + var it=res.data.data.pageData[i];
  700 + if(it.Id==data.StorageId){
  701 + store_data={
  702 + store_name: data.store_name,
  703 + StorageId: data.StorageId,
  704 + };
  705 + break;
  706 + }
  707 + }
  708 + if(!store_data) return false;
  709 + th.setData(store_data)
  710 +
  711 + }else{
  712 + return false;
  713 + }
  714 +
  715 + //导购接口地址
  716 + var url = "/api/weshop/marketing/reservation/staff/pagenew";
  717 + return getApp().request.promiseGet(url, {
  718 + isShowLoading:1,
  719 + data: {
  720 + storeId: os.stoid,
  721 + userId: th.data.options.userid,
  722 + serviceId: itemId,
  723 + storageId: data.StorageId
  724 + }
  725 + })
  726 + }).then(res=>{
  727 + if (res && res.data && res.data.code == 0) {
  728 + var beautician_list=res.data.data;
  729 + for(var i in beautician_list){
  730 + var item=beautician_list[i];
  731 + if(item.staffid==data.beauticianID){
  732 + th.setData({
  733 + beautician_name:data.beautician_name,
  734 + beauticianID:data.beauticianID,
  735 + })
  736 + break;
  737 + }
  738 + }
  739 +
  740 + }
  741 + })
  742 + }
  743 +
  744 +
  745 +
673 }) 746 })
674 \ No newline at end of file 747 \ No newline at end of file
packageA/pages/my_service/tment_details.js
@@ -69,6 +69,10 @@ Page({ @@ -69,6 +69,10 @@ Page({
69 * 生命周期函数--监听页面加载 69 * 生命周期函数--监听页面加载
70 */ 70 */
71 onLoad: function(options) { 71 onLoad: function(options) {
  72 +
  73 + console.log("预约详情");
  74 + console.log(options);
  75 +
72 var th = this; 76 var th = this;
73 th.setData({ 77 th.setData({
74 options, 78 options,
packageA/pages/service_share/service_share.js
@@ -147,7 +147,7 @@ Page({ @@ -147,7 +147,7 @@ Page({
147 var title= item.serviceName; 147 var title= item.serviceName;
148 var img=this.data.url+item.original_img; 148 var img=this.data.url+item.original_img;
149 149
150 - var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; 150 + var url="/packageA/pages/goodsInfo/goodsInfo?goods_id=" + item.id;
151 if(getApp().globalData.user_id){ 151 if(getApp().globalData.user_id){
152 url+="&first_leader="+getApp().globalData.user_id; 152 url+="&first_leader="+getApp().globalData.user_id;
153 } 153 }
@@ -837,7 +837,7 @@ Page({ @@ -837,7 +837,7 @@ Page({
837 go_goods:function(e){ 837 go_goods:function(e){
838 var index=e.currentTarget.dataset.index; 838 var index=e.currentTarget.dataset.index;
839 var item=this.data.list[index]; 839 var item=this.data.list[index];
840 - var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; 840 + var url="/packageA/pages/goodsInfo/goodsInfo?goods_id=" + item.id;
841 getApp().goto(url); 841 getApp().goto(url);
842 }, 842 },
843 843