From b39715b5fa5d2092875ed7677bc361c43b6dfbbe Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Thu, 15 Jul 2021 09:22:24 +0800 Subject: [PATCH] 小程序修改 --- packageA/pages/my_service2/appment_main.js | 1010 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- packageA/pages/my_service2/appment_main.wxml | 161 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------- packageA/pages/my_service2/appment_main.wxss | 26 ++++++++++++++------------ packageA/pages/my_service2/g_filter.wxs | 42 +++++++++++++++++------------------------- pages/cart/cart2/cart2.js | 30 +++++++++++++++++++++++++----- pages/cart/cart2/cart2.wxml | 152 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------- pages/cart/cart2_inte/cart2_inte.js | 15 +++++++++++---- pages/cart/cart2_inte/cart2_inte.wxml | 39 +++++++++++++++++++++++---------------- pages/cart/cart2_inte/cart2_inte.wxss | 30 ++++++++++++++++++++++++++++-- pages/cart/cart2_pt/cart2_pt.js | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------- pages/cart/cart2_pt/cart2_pt.wxml | 50 +++++++++++++++++++++----------------------------- pages/cart/cart2_pt/cart2_pt.wxss | 24 ++++++++++++++++++++++++ pages/cart/cart_wk/cart_wk.js | 499 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- pages/cart/cart_wk/cart_wk.wxml | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------- pages/cart/cart_wk/cart_wk.wxss | 180 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/goods/goodsInfo/buy_integral.wxml | 2 +- pages/goods/goodsInfo/buy_integral_normal.wxml | 18 ++++++++++++++++-- pages/goods/goodsInfo/buy_pt.wxml | 22 ++++++++++++++++++---- pages/goods/goodsInfo/goodsInfo.js | 281 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------ pages/goods/goodsInfo/goodsInfo.wxml | 10 +++++----- pages/team/team_show/team_show.wxml | 2 +- 21 files changed, 1706 insertions(+), 1125 deletions(-) diff --git a/packageA/pages/my_service2/appment_main.js b/packageA/pages/my_service2/appment_main.js index 73a63b6..87f4e4a 100644 --- a/packageA/pages/my_service2/appment_main.js +++ b/packageA/pages/my_service2/appment_main.js @@ -3,6 +3,8 @@ var e = getApp(), os = a, t = e.request, d = e.globalData; + var ut = require("../../../utils/util.js"); + Page({ /** * 页面的初始数据 @@ -11,21 +13,17 @@ Page({ inurl: a.url, //接口网址 iurl: a.imghost, //服务器网址 store: 0, //是否显示服务门店列表 - beautician: 0, //是否显示美容师列表 - beautician_name: "", //选中的美容师名称 - beauticianID: "", //美容师id - bea_index: "", //美容师列表下标 + placeholder: "填写备注", //备注为空的placeholder store_list: [], //门店列表 - beautician_list: [], //美容师列表 - store_name: "", //选择的服务门店 + + store_name: "", //选择的服务门店 fir_pick_index: 0, //选择的门店下标 curpage: 1, //当前分页数 pageSize: 8, //页大小 total: 0, ismore: 0, //是否加载完毕 - itemId: "", //服务id - project_id: "", //项目id + isScroll: true, //scroll-y是否可以滑动 key_word: "", //是否按门店文字查询 is_service_read: 0, //是否调用过门店接口 @@ -34,8 +32,7 @@ Page({ remarks: "", //备注 storageId: "", //线下门店id url: "/packageA/pages/my_service/appment_main", //本页面地址路径用于选择时间页面跳转回来 - buyType: "", //项目类型 - time: "", //选择预约时间 + tment_count: "", //可预约人数 lat: "", //纬度坐标 lon: "", //经度坐标 @@ -44,19 +41,19 @@ Page({ is_sub: 0, //判断是否重复提交 is_textea: 1, //备注是否是可输入 - // 拖拽参数 - writePosition: [], //默认定位参数 - writesize: [0, 0],// X Y 定位 - window: [0, 0], //屏幕尺寸 - write: [0, 0], //定位参数 - scrolltop: 0,//据顶部距离 - v:{}, - - project: ['项目1', '项目2', '项目3', '项目4', '项目5', '项目6', '项目7'], - md: [{name:'美导1',time:'08:30-22:00'},{name:'美导2',time:'09:30-18:00'},], - timeList: [], - deltaX: 0, - col_arr:[], + write: [0, 0], //定位参数 + scrolltop: 0,//据顶部距离 + v:{}, + + //project: ['项目1', '项目2', '项目3', '项目4', '项目5', '项目6', '项目7'], + //md: [{name:'美导1',time:'08:30-22:00'},{name:'美导2',time:'09:30-18:00'},], + timeList: [], + deltaX: 0, + col_arr:[], + wp:[], + datet:null, + s_top:0, + }, //控制备注输入 check_text: function() { @@ -67,6 +64,7 @@ Page({ beautician: 0 }) }, + onclickstore: function() { var th = this; var store = th.data.store; @@ -85,6 +83,8 @@ Page({ wx.showLoading({ title: '加载中', }) + + //获取门店 th.query_store(); } } @@ -96,104 +96,81 @@ Page({ remarks: remarks }) }, - //提交成功及发送模版代码 + + + //单个预约的提交成功及发送模版代码 success: function() { + wx.showLoading({ title: '加载中', }); var th = this; var store = th.data.store_name; //门店名称 - var bea_name = th.data.beautician_name; //美容师名称 - var time = th.data.time; //预约时间 - var is_sub = th.data.is_sub; //是否重复提交 - var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/insert"; //接口路径 - var serviceId = th.data.itemId; //服务id - var beauticianID = th.data.beauticianID; //美容师id - var buyType = th.data.buyType; //服务项目类型 - var storeId = a.stoid; //商家id - var storageId = th.data.storageId; //门店id - var userId = th.data.options.userid; //用户id - var remarks = th.data.remarks; //用户备注 - var project_id = th.data.project_id; //项目id - var validay = th.data.validay; - var json = { - "arrangeTime": time + ":00", - "beauticianId": beauticianID, - "buyType": buyType, - "effectiveDay": "", - "number": "", - "projectId": project_id, - "remark": remarks, - "serviceId": serviceId, - "states": 0, - "storageId": storageId, - "storeId": storeId, - "userId": userId, - "validay": validay, - "isxz": 1 - - } - var data = JSON.stringify(json); + var datet = th.data.datet; //预约时间 + //接口路径 + var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/batchinsert"; + var req_arr={ + "storageId": th.data.storageId, + "storeId": a.stoid, + "userId": getApp().globalData.userInfo.user_id, + "remark": '', + "isxz": 1, + "states": 0, + "list":[] + }; + for(var i in this.data.v){ + for(var j in this.data.v[i]){ + var item=this.data.v[i][j]; + var md=this.data.md[i]; + var tn=this.data.timeArr[j]; + var json = { + "arrangeTime":datet+' '+ tn + ":00", + "beauticianId":encodeURIComponent(md.staffid) , + "buyType": item.BuyType, + //"effectiveDay": "", + //"number": "", + "projectId": item.ProjectID, + "serviceId": item.ServiceID, + "validay": item.Validay, + } + req_arr.list.push(json); + } + } + console.log(req_arr); + //return false; + var js_data = JSON.stringify(req_arr); wx.request({ url: url, - data: json, + data: js_data, method: 'post', header: { 'content-type': 'application/json' }, // 设置请求的 header success: function(res) { - th.setData({ - is_sub: 0 - }) + th.setData({ is_sub: 0}) wx.hideLoading(); if (res.data.code == 0) { - getApp().my_warnning("预约成功", 1, th); - // var store_name = th.data.store_name; //预约门店 - var number = res.data.data.Number; - // var temp_url = "/api/wx/open/app/user/sendSubscribeMsg"; //模版接口 - //var userinfo = getApp().globalData.userInfo; - //var name = d.userInfo.nickname; - // var json = { - // // "formId": formid, - // "keyWord": [{ - // "keyword": res.data.data.ServiceName - // }, - // { - // "keyword": time.substring(0, 16) - // }, { - // "keyword": res.data.data.BeauticianName - // }, { - // "keyword": res.data.data.StorageName - // }, { - // "keyword": res.data.data.Address - // } - // ], - // "page": "/packageA/pages/my_service/tment_details?number=" + number+"&userid="+th.data.options.userid, - // "storeId": a.stoid, - // "typeId": "1011", - // "userId": th.data.options.userid - // }; - // var data = JSON.stringify(json); - // //调用发送预约成功模版接口 - // wx.request({ - // url: th.data.inurl + temp_url, - // data: data, - // method: 'post', - // header: { - // 'content-type': 'application/json' - // }, // 设置请求的 header - // success: function(data) {} - // }) - - wx.redirectTo({ - url: "/packageA/pages/my_service/tment_details?number=" + number+"&userid="+th.data.options.userid, - }); - + getApp().my_warnning("预约成功", 1, th); + + if(res.data.data.length>1){ + var number = res.data.data[0].Number; + wx.redirectTo({ + url: "/packageA/pages/my_service/tment_order_list?number=" + number+"&userid="+th.data.options.userid, + }); + + }else{ + var number = res.data.data[0].Number; + wx.redirectTo({ + url: "/packageA/pages/my_service/tment_details?number=" + number+"&userid="+th.data.options.userid, + }); + } + } else { getApp().my_warnning(res.data.msg, 0, th); th.settime(); } } }) - }, + + //定时显示texteat settime: function() { var th = this; @@ -203,141 +180,59 @@ Page({ }) }, 2000); }, - //提交预约 + + + //-- 提交预约 -- sub_success: function(e) { var th = this; - var temp_url = th.data.inurl + "/api/wx/weappSendlist/page"; + //和推送消息有关系 + var temp_url = th.data.inurl + "/api/wx/weappSendlist/page"; var template_id = ""; - if (th.data.is_sub == 1) { - return false; - } - var store = th.data.store_name; //门店名称 - var bea_name = th.data.beautician_name; //美容师名称 - var time = th.data.time; //预约时间 - var is_sub = th.data.is_sub; //是否重复提交 - th.setData({ - is_textea: 0, - is_sub: 1 - }) + + //门店名称 + var store = th.data.store_name; //提交预约前的判断 if (store == "") { - getApp().my_warnning("请选择服务门店", 0, th); - th.setData({ - is_sub: 0 - }) - th.settime(); - return false; - } else if (bea_name == "") { - getApp().my_warnning("请选择美容师", 0, th); - th.setData({ - is_sub: 0 - }) - th.settime(); - return false; - } else if (time == undefined || time == '') { - getApp().my_warnning("请选择预约时间", 0, th); - th.setData({ - is_sub: 0 - }) - th.settime(); - return false; - } else { - var version =""; - //判断微信版本是否达到预约成功订阅的要求 - wx.getSystemInfo({ - success(res) { - version = res.version; - } - }) - wx.showLoading({ - title: '加载中', - }) - - th.success(); - // if (th.ver(version, '7.0.4') >= 0) { - // //获取模版id - // getApp().request.promiseGet(temp_url, { - // data: { - // store_id: a.stoid, - // typeid: "1011" - // } - // }).then(res => { - // if (res.data.code == 0 && res.data.data.pageData.length > 0) { - // template_id = res.data.data.pageData[0].template_id; - // // //授权订阅 - // wx.requestSubscribeMessage({ - // tmplIds: [template_id], - // success(res) { - // th.success(); - // }, - // fail(res) { - // th.success(); - // } - // }) - // } else { - // th.success(); - // } - // }) - // } else { - // // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示 - // wx.showModal({ - // title: '提示', - // content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。' - // }) - // th.setData({ - // is_sub: 0 - // }) - // } - - } - }, - //版本判断 - ver:function(v1,v2){ - v1 = v1.split('.') - v2 = v2.split('.') - var num1 = "" ; - var num2 = ""; - var len = Math.max(v1.length, v2.length) - - while (v1.length < len) { - v1.push('0') - } - while (v2.length < len) { - v2.push('0') - } - - for (let i = 0; i < len; i++) { - num1 = parseInt(v1[i]) - num2 = parseInt(v2[i]) - - if (num1 > num2) { - return 1 - } else if (num1 < num2) { - return -1 - } - } - return 0 - }, - goto: function(e) { - var th = this; - th.setData({ - beautician: 0, - is_textea: 0 - }) - if (th.data.store_name == "") { - getApp().my_warnning("请选择服务门店", 0, th); - th.settime(); - } else if (th.data.beautician_name == "") { - getApp().my_warnning("请选择美容师", 0, th); - th.settime(); - } else { - th.setData({ - is_textea: 1 - }) - var url = e.currentTarget.dataset.url; - getApp().goto(url); - } + getApp().my_warnning("请选择服务门店", 0, th); + return false; + } + + if(Object.keys(th.data.v).length === 0){ + getApp().my_warnning("请选择美导和预约时间", 0, th); + return false; + } + + if(th.data.is_sub) return false; + th.setData({ is_sub: 1}); + + + //获取模版id + getApp().request.get(temp_url, { + data: { + store_id: a.stoid, + typeid: "1011" + }, + success:function(res){ + if (res.data.code == 0 && res.data.data.pageData.length > 0) { + template_id = res.data.data.pageData[0].template_id; + // //授权订阅 + wx.requestSubscribeMessage({ + tmplIds: [template_id], + success(res) { + th.success(); + }, + fail(res) { + th.success(); + } + }) + } else { + th.success(); + } + } + }) + }, + //点击选择门店 choose_for_store: function(e) { var th = this; @@ -355,6 +250,7 @@ Page({ }) } }, + //确认选择门店 choice_store: function() { var th = this; @@ -367,8 +263,49 @@ Page({ storageId: Id, is_textea: 1 }) + + th.get_project_guide(); + + }, + + //获取美导和项目 + get_project_guide(){ + var th=this,user=getApp().globalData.userInfo; + var req={ + storeId:os.stoid, + userId:user.user_id, + StorageId:encodeURIComponent(this.data.storageId), + } + getApp().request.get("/api/weshop/marketing/reservation/sm/pageNew",{ + data:req, + success:function(res){ + if(ut.ajax_ok(res)){ + th.setData({project:res.data.data.pageData}) + } + } + }) + + req.SeekTime=this.data.datet; + getApp().request.get("/api/weshop/marketing/reservation/listStaffAndTime",{ + data:req, + success:function(res){ + if(ut.ajax_ok2(res)){ + th.setData({v:{},col_arr:[]}) + //-- 有些时间是全部没有的 -- + th.setTimeShow(res.data.data) + } + } + }) + + //获取第一个元素的位置 + setTimeout(function(){ + th.queryMultipleNodes(); + },1000) + }, - onReachBottom: function() { + + + onGetBottom: function() { var th = this; if (this.data.total <= th.data.pageSize) return; if (this.data.ismore) return; @@ -378,6 +315,7 @@ Page({ }) th.query_store(); }, + //分页查询门店信息 query_store: function() { var th = this; @@ -385,14 +323,13 @@ Page({ is_textea: 0 }) var itemId = th.data.itemId; //服务id - var url = "/api/weshop/marketing/reservation/storage/pagenew"; + var url = "/api/weshop/marketing/reservation/storage/pageAll"; var key_word = th.data.key_word; key_word = key_word.replace(/\s+/g, ""); getApp().request.promiseGet(url, { data: { - userId: th.data.options.userid, + userId: getApp().globalData.user_id, storeId: a.stoid, - serviceId: itemId, latitude: th.data.lat, longitude: th.data.lon, page: th.data.curpage, @@ -534,8 +471,9 @@ Page({ th.setData({ is_textea: 1 }) - console.log('optionsxxx===>', this.data.options); - // console.log('1-->', "/pages/user/my_service/cosmetology_list?userid=" + th.data.options.userid + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id); + + console.log('optionsxxx===>', this.data.options); + // console.log('1-->', "/pages/user/my_service/cosmetology_list?userid=" + th.data.options.userid + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id); wx.navigateTo({ url: "/packageA/pages/my_service/cosmetology_list?userid=" + this.data.options.userid + '&storageId=' + storageId + '&itemId=' + itemId + "&projectId=" + project_id }); @@ -546,15 +484,30 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function(options) { + + + // 如果数值位数为1,则补0 + function appendZero(obj) { + if (obj < 10) { + return "0" + "" + obj; + } else { + return obj; + } + }; this.getTimeList(23, 30); var th = this; + var now_date = new Date(); + var md = now_date.getFullYear()+"-"+appendZero(now_date.getMonth() + 1) + "-" + appendZero(now_date.getDate()); + th.setData({ - options, + options, itemId: options.service_id, buyType: options.BuyType, project_id: options.ProjectID, - validay: options.Validay + validay: options.Validay, + datet:md, + nowDate:md }); wx.getLocation({ type: 'gcj02', @@ -584,87 +537,30 @@ Page({ th.data.is_get_local_ok = 1; } }); - - // 获取当前默认导购信息及归属门店信息 - if(options.firstleader) { - getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+a.stoid+"/"+options.firstleader,{}).then(res=>{ - if(res.data.code==0){ - getApp().globalData.guide_id=res.data.data.id; - - getApp().request.promiseGet('/api/weshop/shoppingGuide/geIdStaffInfo', { - data: { - store_id: a.stoid, - guide_id: e.globalData.guide_id, - UserCode: th.data.options.usercode, - } - }).then(res => { - console.log('res==>', a.stoid, e.globalData.guide_id, th.data.options.usercode); - if(res.data.data.Tech) { - - var data={ - store_name: res.data.data.StorageName, - beautician_name: res.data.data.StaffName, - beauticianID: res.data.data.StaffId, - StorageId: res.data.data.StorageId, - } - th.check_firleader(data); - } - }); - - - }; - }); - }; - - + + //--先判断会员状态-- + var user_info = getApp().globalData.userInfo; + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + wx.navigateTo({ + url: '/pages/togoin/togoin', + }) + return false; + } }, - //查询剩下可预约人数 - query_more: function() { - var th = this; - var url = "/api/weshop/marketing/reservation/can/reservation/countnew"; - var beauticianID = th.data.beauticianID; //美容师id - var projectID = th.data.itemId; //服务id - var seekTime = th.data.time; //预约日期 - var storageId = th.data.storageId; //门店id - var storeId = a.stoid; //商家id - getApp().request.promiseGet(url, { - data: { - beauticianId: beauticianID, - seekTime: seekTime, - serviceId: projectID, - storageId: storageId, - storeId: storeId - } - }).then(res => { - if (res.data.code == 0) { - var tment_count = res.data.data.CanReservation; - th.setData({ - tment_count: tment_count - }) - } else { - getApp().my_warnning(res.data.msg, 0, th); - th.settime(); - } - }) + - }, /** * 生命周期函数--监听页面显示 */ onShow: function() { var th = this; - var seekTime = th.data.time; //预约日期 - if (seekTime != "") { - th.query_more(); - } th.setData({ - time: th.data.time.substring(0, 16), is_textea: 1 }) - th.query_project(); - - th.queryMultipleNodes(); + }, + + //获取单个服务项目信息 query_project: function() { var th = this; @@ -687,81 +583,17 @@ Page({ } }) }, - //关闭导航 - // close: function() { - // var th = this; - // var nav_b = th.selectComponent("#nav_b"); //组件的id - // nav_b.close_box(); - // } - - //判断分享的导购是不是有门店,是不是该门店下又该会员 - check_firleader(data){ - var th=this; - var itemId = this.data.itemId; //服务id - var url = "/api/weshop/marketing/reservation/storage/pagenew"; - var key_word = data.store_name; - key_word = key_word.replace(/\s+/g, ""); - getApp().request.promiseGet(url, { - data: { - userId: th.data.options.userid, - storeId: os.stoid, - serviceId: itemId, - latitude: th.data.lat, - longitude: th.data.lon, - page: 1, - pageSize: 1000, - keyWord: key_word - } - }).then(res => { - //-- 如果是门店的话 -- - if (res.data.code == 0 && res.data.data && res.data.data.pageData) { - var store_data=null; - for(var i in res.data.data.pageData){ - var it=res.data.data.pageData[i]; - if(it.Id==data.StorageId){ - store_data={ - store_name: data.store_name, - StorageId: data.StorageId, - }; - break; - } - } - if(!store_data) return false; - th.setData(store_data) - - }else{ - return false; - } - - //导购接口地址 - var url = "/api/weshop/marketing/reservation/staff/pagenew"; - return getApp().request.promiseGet(url, { - isShowLoading:1, - data: { - storeId: os.stoid, - userId: th.data.options.userid, - serviceId: itemId, - storageId: data.StorageId - } - }) - }).then(res=>{ - if (res && res.data && res.data.code == 0) { - var beautician_list=res.data.data; - for(var i in beautician_list){ - var item=beautician_list[i]; - if(item.staffid==data.beauticianID){ - th.setData({ - beautician_name:data.beautician_name, - beauticianID:data.beauticianID, - }) - break; - } - } - - } - }) - }, - + + + + //开始拖拽项目列表 + touchmove1: function (e) { + var that = this; + var position = [e.touches[0].pageX-15, e.touches[0].pageY-that.data.s_top]; + that.setData({ + wp: position + }); + }, //开始拖拽 touchmove: function (e) { @@ -772,37 +604,41 @@ Page({ write: position }); }, - touchend:function(e){ + + touchend:function(e){ var that = this,th=that; if(!that.data.copy_btn) return false; var position =th.data.write; var arr=th.data.col_arr; for(var i=0;i1?new Date(d_str+d_arr[1]):0; - + for(var j=0; jt2 && t2>0) continue; + var tn=this.data.timeArr[j]; + //如果坐标在网格内 if( position[0]>th.data.f_x+i*th.data.f_width && position[0]th.data.f_y +j*th.data.f_hei && position[1]=parseInt(res.data.data.CanReservation) ){ + wx.showToast({ + title: "已经超出可预约次数", + icon: 'none', + duration: 2000 + }) + return false; + } + back(); + + }else{ + wx.showToast({ + title: res.data.msg, + icon: 'none', + duration: 2000 + }) + } + } + }) + }, //声明节点查询的方法 queryMultipleNodes: function() { @@ -838,11 +828,16 @@ Page({ th.data.f_y=res[0].top; th.data.f_hei=res[0].height; th.data.f_width=res[0].width; - }) + }, + /*-- getcopy(e) { + + },--*/ + //项目元素点击后的效果 + getName(e) { var that=this; console.log('e', e); var x=e.currentTarget.dataset.offsetLeft; @@ -850,52 +845,73 @@ Page({ var position = [x, y]; that.setData({ write: position,copy_btn:1 - }); - - }, - - getName(e) { - // console.log('e1', e); - let name = e.currentTarget.dataset.name; + }); + // console.log('e1', e); + let index = e.currentTarget.dataset.index; + let name = this.data.project[index]; + + this.setData({ - projectName: name, + sele_project: name,prj_index:index }); }, + + //-- 项目列表长按 -- + setmove1(){ + this.setData({move1:1}); + }, - - // 生成时间段 - getTimeList(hours,step) { - var minutes=60; + //-- 生成时间段 -- + getTimeList(hours,step) { + var minutes=60; var timeArr = []; hours = hours; step = step; + + // 如果数值位数为1,则补0 + function appendZero(obj) { + if (obj < 10) { + return "0" + "" + obj; + } else { + return obj; + } + }; + + var now_date=new Date(); + var md = now_date.getFullYear()+"-"+appendZero(now_date.getMonth() + 1) + "-" + appendZero(now_date.getDate()); - for(var i = 8; i < hours; i++){ - var str = ''; - if(i < 10) { - str = 0 + '' + i; - } else { - str = '' + i; - }; - - for(var j = 0; j < minutes; j++) { - if(j % step == 0){ - var s = j < 10 ? ':' + 0 + '' + j : ':' + j; - s = str + s; - timeArr.push(s); - }; - }; - }; - - // console.log('timeArr', timeArr); - this.setData({ - timeArr, - }); + for(var i = 8; i < hours; i++){ + var str = ''; + if(i < 10) { + str = 0 + '' + i; + } else { + str = '' + i; + }; + + for(var j = 0; j < minutes; j++) { + if(j % step == 0){ + var s = ':' + appendZero(j); + s = str + s; + //-- 不是当天 -- + if(this.data.datet && this.data.datet!=md){ + timeArr.push(s); + }else{ + var d1=md+" "+s; + var date1=new Date(d1); + //必须是大于 + if(date1.getTime()>now_date.getTime()){ + timeArr.push(s); + } + } + + }; + }; + }; + + this.setData({timeArr,}); }, - - - + scroll(e) { // console.log('e', e.detail.deltaX); let deltaX = e.detail.deltaX; @@ -904,8 +920,100 @@ Page({ // }; this.data.deltaX = -deltaX; }, - + + pickerTap:function() { + var date = new Date(); + var monthDay = ['今天','明天']; + // 月-日 + for (var i = 2; i <= 14; i++) { + var date1 = new Date(date); + date1.setDate(date.getDate() + i); + var md = (date1.getFullYear()+"-"+date1.getMonth() + 1) + "-" + date1.getDate(); + monthDay.push(md); + } + this.setData(monthDay); + }, + + + //-- 选择时间的时候 -- + bindDateChenge: function(e) { + var th=this; + var nd=new Date(this.data.nowDate); + var nd1=new Date(e.detail.value); + if(nd1.getTime()now_date.getTime()){ + arr.push(ti_time_arr[j]); + } + } + data[i].listtime=arr; + } + this.setData({md:data}); + + }, + + + }) \ No newline at end of file diff --git a/packageA/pages/my_service2/appment_main.wxml b/packageA/pages/my_service2/appment_main.wxml index 27c9dc0..795ce28 100644 --- a/packageA/pages/my_service2/appment_main.wxml +++ b/packageA/pages/my_service2/appment_main.wxml @@ -1,33 +1,43 @@ - - - - - + + + + + - - - - {{item}} - + + + + + {{item.ServiceName}} + + + - - + + + + + + + + + + + + {{datet==""?'选择日期':datet}} + + + + + + @@ -40,8 +50,11 @@ {{store_name==""?'选择服务门店':store_name}} - - + + + + + 时间 @@ -56,89 +69,21 @@ --> - {{item.name}} + {{item.StaffName}} - - {{v[index][subindex]?v[index][subindex]:''}} - × + + + + {{v[index][subindex]?v[index][subindex].ServiceName:''}} + × + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -146,9 +91,10 @@ 我的预约 -
- -
+
+ + +
@@ -165,7 +111,7 @@
- + @@ -206,8 +152,9 @@ - + + diff --git a/packageA/pages/my_service2/appment_main.wxss b/packageA/pages/my_service2/appment_main.wxss index e9fedbe..d775b5b 100644 --- a/packageA/pages/my_service2/appment_main.wxss +++ b/packageA/pages/my_service2/appment_main.wxss @@ -1,12 +1,10 @@ page, .area { width: 100%; - height: 100%; + height: 100%; + position: relative; } - - - /* .container { border-top: 7rpx solid rgb(245, 245, 245); justify-content: baseline; @@ -188,7 +186,7 @@ button { } .storeList { - z-index: 5; + z-index: 1500; left: 0rpx; border-top-left-radius: 25rpx; border-top-right-radius: 25rpx; @@ -301,7 +299,8 @@ button { .table { background-color: white; /* border-top: 2rpx solid rgba(218, 217, 217, 1); - border-left: 2rpx solid rgba(218, 217, 217, 1); */ + border-left: 2rpx solid rgba(218, 217, 217, 1); */ + width: 100%;height: auto; overflow: hidden; margin-bottom: 20rpx; } .blue { background: rgba(241, 252, 255, 1); @@ -339,17 +338,17 @@ button { .card { position: fixed; - width: 110rpx; - top: 50%; + width: 130rpx; + /* top: 50%; */ right: 0; /* min-height: 400rpx; */ - max-height: 700rpx; - overflow-y: auto; - transform: translateY(-50%); + /* max-height: 700rpx; */ + /* transform: translateY(-50%); */ background-color: white; border-radius: 10rpx; box-shadow: -2px 0px 6px #aaa; - z-index: 1000; + z-index: 1000; + top:160rpx } .icon-meirong { @@ -443,3 +442,6 @@ button { } + + + diff --git a/packageA/pages/my_service2/g_filter.wxs b/packageA/pages/my_service2/g_filter.wxs index 4353715..2973176 100644 --- a/packageA/pages/my_service2/g_filter.wxs +++ b/packageA/pages/my_service2/g_filter.wxs @@ -1,30 +1,22 @@ var g_filters = { - is_no_time:function(item,subindex,timeArr){ + is_no_time:function(item,subindex,timeArr,sele_project){ + if(!sele_project || !sele_project.ServiceID) return false; var t_time=timeArr[subindex]; - var time_arr=item.time.split("-"); - - var t_date=getDate(); - var t_date_str=t_date.getFullYear()+"-"+(t_date.getMonth() + 1)+"-"+t_date.getDate()+" " - - var this_time =t_date_str+t_time.substring(0, 19); - var reg = getRegExp("-", "g"); - this_time = this_time.replace(reg, '/'); - var t1 = getDate(this_time); - - var fmt1 =t_date_str+time_arr[0].substring(0, 19); - var reg = getRegExp("-", "g"); - var fmt2 = fmt1.replace(reg, '/'); - var t2 = getDate(fmt2); - - if(t11){ - var ft1 =t_date_str+time_arr[1].substring(0, 19); - var reg = getRegExp("-", "g"); - var ft2 = ft1.replace(reg, '/'); - var t3 = getDate(ft2); - if(t1>t3) return true; - } - return false; + var time_arr=item.listtime; + + for(var i=0;i - - - - {{item}} - + + + + + + + + + + - + + + + + + + + + + + + + + --> - + @@ -124,63 +146,61 @@ {{order.store_prom}} - - - - - + + + + - - - - - - - - - - - - + + 门店自提 + + + - - - 配送方式 - - - - {{wu_arr[item.wind].name}} - - - + - - - + + + + {{wu_arr[item.wind].name}} + + + + + + + + + + 选择物流 + {{wu_arr[item.wind].name}} - --> - - - - - + + + + + @@ -211,7 +231,7 @@ - + @@ -221,7 +241,7 @@ - + @@ -247,7 +267,7 @@ - + {{filters.toFix(bn_goods.shop_price,2)}} x{{bn_goods.buynum}} @@ -270,7 +290,7 @@ {{filters.show_gui_ge(buy_now_gift_goods.goods_spec,buy_now_gift_goods.goods_color)}} - + 0 x{{buy_now_gift_goods.buynum}} @@ -293,7 +313,7 @@ {{filters.show_gui_ge(item.goods_spec,item.goods_color)}} - + {{item.price}} x{{item.goods_num}} @@ -342,24 +362,14 @@ - - - - - 配送方式 - - - - {{wu_arr[index].name}} - + + + 选择物流 + + {{wu_arr[index].name}} + - + diff --git a/pages/cart/cart2_inte/cart2_inte.js b/pages/cart/cart2_inte/cart2_inte.js index 50de9a3..3722eba 100644 --- a/pages/cart/cart2_inte/cart2_inte.js +++ b/pages/cart/cart2_inte/cart2_inte.js @@ -93,8 +93,9 @@ Page({ getApp().getConfig2(function (ee) { var json_d = JSON.parse(ee.switch_list); th.data.json_d=json_d; - th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值 - th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch}); + th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值 + var is_default_logistics=json_d.is_default_logistics; + th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch,is_default_logistics:is_default_logistics}); var rank_switch=json_d.rank_switch; var max_price=-1; @@ -204,8 +205,14 @@ Page({ get_wuliu(func) { var th = this; to.getwuliu(function (e) { - th.setData({ wu_arr: e }) - typeof func == "function" && func(); + if(th.data.is_default_logistics){ + //如果第一个不是开启默认,说明要让用户自己选 + if(!e[0].is_default){ + th.setData({is_default_logistics:0}); + } + } + th.setData({ wu_arr: e }) + typeof func == "function" && func(); }) }, //------获取会员信息-----先获取用户信息,在进行下一步--- diff --git a/pages/cart/cart2_inte/cart2_inte.wxml b/pages/cart/cart2_inte/cart2_inte.wxml index cda87da..243a2df 100644 --- a/pages/cart/cart2_inte/cart2_inte.wxml +++ b/pages/cart/cart2_inte/cart2_inte.wxml @@ -4,6 +4,19 @@
+ + + + + + + + + + + - - - - - 门店自提 - - - - 快递邮寄 - - - - - {{wu_arr[index].name}} - + + + + + 选择物流 + + {{wu_arr[index].name}} + + - + diff --git a/pages/cart/cart2_inte/cart2_inte.wxss b/pages/cart/cart2_inte/cart2_inte.wxss index a3ed00c..869aaf8 100644 --- a/pages/cart/cart2_inte/cart2_inte.wxss +++ b/pages/cart/cart2_inte/cart2_inte.wxss @@ -252,7 +252,7 @@ margin:auto; */ } .btn-wrap { - height: 94rpx; + height: 100rpx; box-sizing: border-box; display: flex; justify-content: space-between; @@ -262,7 +262,8 @@ margin:auto; */ bottom: 0; left: 0; width: 100%; - padding: 0 30rpx; + padding: 0 30rpx; + font-size: 30rpx; } .tips-btn { @@ -958,3 +959,28 @@ margin-left: 20rpx; top:36rpx } + +.tab-container { + font-size: 28rpx; + margin-top: 20rpx; + display: flex; +} + +.tab-wrapper { + background-color: #ccc; + display: flex; + border-radius: 40rpx; + overflow: hidden; +} + +.tab { + padding: 20rpx 30rpx; + +} + + +.tab.active { + background-color: white; + border-radius: 40rpx; +} + diff --git a/pages/cart/cart2_pt/cart2_pt.js b/pages/cart/cart2_pt/cart2_pt.js index 9015c36..716bc87 100644 --- a/pages/cart/cart2_pt/cart2_pt.js +++ b/pages/cart/cart2_pt/cart2_pt.js @@ -95,8 +95,12 @@ Page({ var th = this; console.log("getwuliu4545"); to.getwuliu(function (e) { - console.log("ws"); - console.log(e); + if (th.data.is_default_logistics) { + //如果第一个不是开启默认,说明要让用户自己选 + if (!e[0].is_default) { + th.setData({ is_default_logistics: 0 }); + } + } th.setData({ wu_arr: e }) typeof func == "function" && func(); }) @@ -277,80 +281,81 @@ Page({ }, //----------子页返回父页触发---------- - onShow: function() { - var th=this; - if (th.data.isclose==0){ - wx.navigateTo({ - url: "/pages/index/index/index" - }) - }else{ - this.getuser_addr(function(ie){ - //更换地址回来要重新调用计算价钱的接口 - th.setData({user_addr: ie }); - if(!th.data.user_addr || th.data.user_addr.address_id!=ie.address_id){ - th.setData({add_back:1}); - if(this.data.bn_goods) th.calculatePrice2(); - } - }) - //--更新默认地址--,看一下是不是跳到地址页面 - if(!getApp().globalData.is_cart_old){ - this.update_code(); - }else{ - getApp().globalData.is_cart_old=0; - } - } - - - //先获取是否有关闭使用优惠券 - getApp().getConfig2(function (ee) { - var json_d = JSON.parse(ee.switch_list); - th.data.json_d=json_d; - th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值 - th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch}); - - var rank_switch=json_d.rank_switch; - var max_price=-1; - var show_card=null; - var name=""; - //如果有开等级卡的时候, - //因为都是调接口,要返回在计算 - if(rank_switch==2){ - //-- 获取所有的等级卡, -- - getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?storeId=" + os.stoid, - {}).then(res => { - if(res.data.code==0){ - var plusCard = res.data.data; - //-- 循环判断,拿到最贵的那张卡 -- - for(var ih in plusCard){ - if(plusCard[ih].IsStopBuy == true){ continue; } - if(max_price<0){ - max_price=plusCard[ih].CardFee; - name='card'+plusCard[ih]['CorrPrice']; - show_card=plusCard[ih]; - }else{ - if(max_price + + + + + + + + + + + - - - - - - - - - - - - 门店自提 - - - - - - - - - - - 快递邮寄 - - - - {{wu_arr[index].name}} - - + + + 选择物流 + + {{wu_arr[index].name}} + + + + + + + + + + + + + - + - 美得得超市{{pickup.pickup_name}} + {{pickup.pickup_name}} @@ -49,8 +63,7 @@ - - + - - - 使用物流: - - {{wu_arr[index].name}} - + + 选择物流: + + {{wu_arr[index].name}} + @@ -125,4 +138,49 @@ - \ No newline at end of file + + + + + + + + + + + + 选择物流名字 + + + + × + + + + + + + + Γ + + + + + {{express_list.name}} + + + + + + + 确定 + + + 设为默认 + + + + + diff --git a/pages/cart/cart_wk/cart_wk.wxss b/pages/cart/cart_wk/cart_wk.wxss index 760dd32..282ca14 100644 --- a/pages/cart/cart_wk/cart_wk.wxss +++ b/pages/cart/cart_wk/cart_wk.wxss @@ -1,3 +1,4 @@ +page{ color: #333;} .bdr_t-14 { border-top-left-radius: 14rpx; border-top-right-radius: 14rpx; @@ -329,5 +330,184 @@ page { .anniu_view>view{width: 50%; border-right:1rpx solid #ededed;} +.tab-container { + font-size: 28rpx; + margin-top: 20rpx; + display: flex; +} + +.tab-wrapper { + background-color: #ccc; + display: flex; + border-radius: 40rpx; + overflow: hidden; +} + +.tab { + padding: 20rpx 30rpx; + +} + + +.tab.active { + background-color: white; + border-radius: 40rpx; +} + +.xc-right{ + width:20rpx; + height:20rpx; + border-top:2rpx solid #666; + border-right:2rpx solid #666; + transform:rotate(45deg); + display:inline-block; +} + + +/* 自定义弹出窗口 */ +.cx-popup{ + width:100%; + height:880rpx; + background: #fff; + z-index: 35; + border-top-left-radius: 20rpx; + border-top-right-radius: 20rpx; + position:fixed; + bottom:0; + left: 0; + /* padding-bottom: 25rpx; */ +} + +.cx-popup .top{ + width:95%; + height:100rpx; + border-bottom:3rpx solid #ddd; + margin: auto; + margin-top: 30rpx; + +} +.xc-top-content{ + width: 93%; + height:85rpx; + padding-top: 30rpx; + font-size: 34rpx; + font-weight: 600; + +} + +.xc-close{ + width: 37rpx; +height: 37rpx; +border-radius: 50%; +border: 3rpx solid #333; +text-align: center; +line-height: 34rpx; +font-size: 29rpx; +color: #333; + +} + +.xc-confirm { + width: 50%; + border-radius: 50rpx; + height: 80rpx; + margin:0 auto; + background:#d60021; + color:#fff; + font-size:28rpx; + margin-top: 28rpx; +} + +.up{ animation: up .7s; } +.down{ animation: down 1s; } +@keyframes up { 0% { transform: translateY(550rpx); } 100% { transform: translateY(0); } } +@keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } } + + +.xc-close-express{ + width: 40rpx; +height: 40rpx; +border-radius: 50%; +border: 3rpx solid #333; +text-align: center; +font-size:32rpx; +line-height: 38rpx; +color: #333; +margin-top: 5rpx; +} +.cx-popup .tops{ + width: 100%; +height: 145rpx; +border-bottom: 3rpx solid #eee; + +} +.top-content { + width: 82%; +padding-top: 33px; +height: 100%; +padding-left: 40rpx; +} +.close-frame{ + margin-top: 30rpx; + +} + +.xc-hook { +width: 33rpx; +height: 33rpx; +transform: rotate(-135deg); +line-height: 35rpx; +text-align: center; +margin-right: 20rpx + + +} +.xc-hooks { +width: 30rpx; +height: 30rpx; +border: 1rpx solid #999; +margin-right: 20rpx; +} +.express_list_frame{ + display: flex; +height: 80rpx; +align-items: center; +padding-left: 40rpx; +border-bottom: 1rpx solid #eee; + +} +.express_list{ + width: 100%; + height: 65%; + overflow-y: auto; + margin-bottom: 40rpx; + +} +.xc-confirms { + box-sizing: border-box; + width: 40%; + border-radius: 50rpx; + height: 80rpx; + margin:0 auto; + font-size:28rpx; + background: #fff; + color: #333; + border: 2rpx solid #333; +} +.determine-frame{ + width: 100%; + height: 130rpx; + +} +.xc-determine{ + height: 80rpx; + width: 40%; + border-radius: 50rpx; +background: #d60021; +color: #fff; +font-size: 28rpx; +margin: 0 auto; + +} diff --git a/pages/goods/goodsInfo/buy_integral.wxml b/pages/goods/goodsInfo/buy_integral.wxml index 208e2a7..5d268cb 100644 --- a/pages/goods/goodsInfo/buy_integral.wxml +++ b/pages/goods/goodsInfo/buy_integral.wxml @@ -59,7 +59,7 @@ - +