diff --git a/app.js b/app.js
index 32f6e1b..604c9fe 100644
--- a/app.js
+++ b/app.js
@@ -595,6 +595,17 @@ App({
this.globalData.room_goods_id=null; //关闭要把物流清空
this.globalData.config2=null; //清除config2的缓存
this.globalData.config=null; //清除config的缓存
+ },
+
+ clear_word:function (word) {
+
+ var str=word;
+ let reg = /([^\u0020-\u007E\u00A0-\u00BE\u2E80-\uA4CF\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF\u0080-\u009F\u2000-\u201f\u2026\u2022\u20ac\r\n])|(\s)/g ,
+ indexArr = reg.exec(str);
+ if(str.match(reg)) {
+ str = str.replace(reg, '');
+ }
+ return str;
}
diff --git a/app.json b/app.json
index 06d4421..bfcbcdd 100644
--- a/app.json
+++ b/app.json
@@ -1,6 +1,7 @@
{
"pages": [
- "pages/index/index/index",
+
+ "pages/index/index/index",
"pages/justTest/justTest",
"pages/goods/categoryList/categoryList",
"pages/cart/cart/cart",
@@ -85,7 +86,8 @@
"pages/user/assistance/assistance",
"pages/video/index",
"pages/template/index",
- "pages/store/index"
+ "pages/store/index",
+ "pages/user/choice_guide/choice_guide"
],
"plugins": {
"live-player-plugin": {
diff --git a/components/diy_advertising/diy_advertising.wxml b/components/diy_advertising/diy_advertising.wxml
index 78add5a..9895b34 100644
--- a/components/diy_advertising/diy_advertising.wxml
+++ b/components/diy_advertising/diy_advertising.wxml
@@ -85,7 +85,7 @@
-
+
200*200
@@ -95,7 +95,7 @@
-
+
200*200
diff --git a/components/diy_assist/diy_assist.wxml b/components/diy_assist/diy_assist.wxml
index ee12f72..92530a6 100644
--- a/components/diy_assist/diy_assist.wxml
+++ b/components/diy_assist/diy_assist.wxml
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/components/diy_assist/diy_assist.wxss b/components/diy_assist/diy_assist.wxss
index 6c268e3..d7ef0d1 100644
--- a/components/diy_assist/diy_assist.wxss
+++ b/components/diy_assist/diy_assist.wxss
@@ -1,5 +1,4 @@
.assist{
width: 100%;
- min-height:90rpx;
/*border:1px solid #00F;*/
}
\ No newline at end of file
diff --git a/components/goods_list/goods_list.js b/components/goods_list/goods_list.js
index b436a56..90ea97d 100644
--- a/components/goods_list/goods_list.js
+++ b/components/goods_list/goods_list.js
@@ -101,6 +101,8 @@ Component({
store_id: o.stoid,
page: curPage,
pageSize: 6,
+ orderField:"sort",
+ orderType:'asc',
},
success: function(res) {
var data = res.data;
diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js
index c607087..566da66 100644
--- a/pages/cart/cart2/cart2.js
+++ b/pages/cart/cart2/cart2.js
@@ -1076,10 +1076,42 @@ Page({
[atxt7]: all_order_prom,
})
th.data.order_prom_list_cart=c_arr;
+ th.set_can_num();
});
});
},
+
+ set_can_num:function(){
+ var th=this;
+ //-- 这个地方,循环计算几张优惠券可用--
+ for ( var iter in th.data.cartlist){
+ var num=0;
+ var c_item=th.data.cartlist[iter];
+ var pkid=c_item.pickup_id;
+ //-- 普通券 --
+ if(c_item.quan_list){
+ for (var iter1 in c_item.quan_list){
+ //判断是不是其他订单有选用
+ var is_other_is_use=th.check_other_use(c_item.quan_list[iter1],pkid);
+ if(!is_other_is_use) num++;
+ }
+ }
+ //-- 包邮券 --
+ var by_quan=th.data.get_by_quan_list_cart[pkid];
+ if(by_quan){
+ for (var iter2 in by_quan){
+ //判断是不是其他订单有选用
+ var is_other_is_use=th.check_other_use_by(by_quan[iter2],pkid);
+ if(!is_other_is_use) num++;
+ }
+ }
+ var set_txt="cartlist["+iter+"].can_num";
+ th.setData({ [set_txt]: num});
+ }
+ },
+
+
//---------计算立即购买----------
calculatePrice2: function () {
var th = this, good = this.data.bn_goods;
@@ -2103,16 +2135,22 @@ Page({
//对于在其他门店已经选择了的券 要判断是否显示到界面
+ var t_user=th.data.using_quan[pickid];
+
for(var i in quanlist){
quanlist[i].is_using= th.check_in_sele(quanlist[i].CashRepNo,pickid);
+ if(!t_user || quanlist[i].CashRepNo!=t_user.coupon_no) quanlist[i].show_red=0;
}
if(get_by_quan_list_cart){
for(var i in get_by_quan_list_cart){
get_by_quan_list_cart[i].is_using= th.check_in_sele(get_by_quan_list_cart[i].no,pickid);
+ if(!t_user || get_by_quan_list_cart[i].no!=t_user.coupon_no) get_by_quan_list_cart[i].show_red=0;
}
th.setData({by_quan_list_cart:get_by_quan_list_cart});
- }
+ }else {
+ th.setData({by_quan_list_cart:null});
+ }
console.log("2222222券的列表", quanlist);
th.setData({ sele_cart_ind:cindx,sele_exp_type:exp_type,open_quan:1,selected_quan_pick:pickid,selected_quan_list:quanlist,disabled:1});
@@ -2129,7 +2167,7 @@ Page({
if(th.data.using_quan.length<=0) return false;
for(var i in th.data.using_quan){
//--如果键值等于本身就要跳出--
- if(i==pick_id) continue;
+ if(parseInt(i)==parseInt(pick_id)) continue;
var item=th.data.using_quan[i];
if(item.coupon_no==no){
return true;
@@ -2624,9 +2662,9 @@ Page({
th.setData({selected_quan_list:quanlist,cartlist:arr})
}else{
th.setData({cartlist:arr })
+ th.set_can_num();
}
-
})
},
@@ -2869,7 +2907,38 @@ Page({
for(var i in arr){
if(arr[i].goods_id==goods_id) return arr[i];
}
+ },
+
+ //检查是不是有其他门店的订单在选择了券
+ check_other_use:function (iter,pkid) {
+ var using=this.data.using_quan;
+ var is_use=0;
+ if(using){
+ for(var i in using){
+ if(i==pkid) continue;
+ if(iter.CashRepNo==using[i].coupon_no){
+ is_use=1; break;
+ }
+ }
+ }
+ return is_use;
+
+ },
+ //检查是不是有其他门店的订单在选择了包邮券
+ check_other_use_by:function (iter,pkid) {
+ var using=this.data.using_quan;
+ var is_use=0;
+ if(using){
+ for(var i in using){
+ if(i==pkid) continue;
+ if(iter.no==using[i].coupon_no){
+ is_use=1; break;
+ }
+ }
+ }
+ return is_use;
}
+
});
diff --git a/pages/cart/cart2/cart2.wxml b/pages/cart/cart2/cart2.wxml
index 79a0ab8..e8552aa 100644
--- a/pages/cart/cart2/cart2.wxml
+++ b/pages/cart/cart2/cart2.wxml
@@ -70,12 +70,12 @@
- !!!!---{{item.quan_list.length}}---!!!
+
- 优惠券
+ 优惠券{{item.can_num}}张可用
不使用
¥{{using_quan[item.pickup_id].money}}元优惠券
@@ -249,7 +249,7 @@
wx:if="{{(selected_quan_list && selected_quan_list.length>0) || get_by_quan_list!=null}}">
- 优惠券
+ 优惠券 {{(selected_quan_list?selected_quan_list.length:0)+ (get_by_quan_list?get_by_quan_list.length:0)}}张可用
不使用
diff --git a/pages/cart/cart2/cart2.wxss b/pages/cart/cart2/cart2.wxss
index c10b952..90f871c 100644
--- a/pages/cart/cart2/cart2.wxss
+++ b/pages/cart/cart2/cart2.wxss
@@ -819,4 +819,6 @@ margin-left: 20rpx;
color: #808080;
}
.n_guige{ display: inline-block; background:rgb(236, 236, 236); color: rgb(63,63,63); padding: 3rpx 10rpx; border-radius: 3rpx }
-.gift_image{ width: 60rpx; height: 60rpx; position: absolute; top: 0; left: 0}
\ No newline at end of file
+.gift_image{ width: 60rpx; height: 60rpx; position: absolute; top: 0; left: 0}
+
+.quan_num_show{ padding: 6rpx 10rpx; background-color:#ea5551; color:#fff; border-radius: 6rpx }
\ No newline at end of file
diff --git a/pages/getphone/getphone.js b/pages/getphone/getphone.js
index e772f65..a27dd3f 100644
--- a/pages/getphone/getphone.js
+++ b/pages/getphone/getphone.js
@@ -74,7 +74,7 @@ Page({
var app=getApp(),a=app,th=this;
var dd = {
oauth: "miniapp",
- nickname: r.nickName,
+ nickname:a.clear_word(r.nickName),
head_pic: r.avatarUrl,
sex: r.gender,
terminal: "miniapp",
diff --git a/pages/user/choice_guide/choice_guide.js b/pages/user/choice_guide/choice_guide.js
new file mode 100644
index 0000000..8d19cf4
--- /dev/null
+++ b/pages/user/choice_guide/choice_guide.js
@@ -0,0 +1,120 @@
+var a = getApp(),
+ os = a.globalData.setting,
+ util = require("../../../utils/util.js"),
+ ut = util;
+Page({
+ data: {
+ url: os.url,
+ iurl: os.imghost,
+ total: 0, //数据的总量
+ ismore: 0,//数据是否加载完毕
+ page:1,
+ pageSize:10,
+ isload:0,
+ show_pop:0,
+ sele_item:null,
+ input_val:null,
+ },
+ //------初始化加载----------
+ onLoad: function(t) {},
+
+ onShow: function() {
+ this.data.ismore=0;this.data.isload=0;
+ this.setData({list:null});
+ this.get_list();
+ },
+
+ //--点击分享事件---
+ onShareAppMessage: function(t) {
+ return o.share;
+ },
+
+ get_list: function() {
+ var th = this, e = th;
+ var r_data={
+ storeId: os.stoid,
+ page: th.data.page,
+ pageSize: th.data.pageSize
+ };
+
+ //关键字搜索
+ if(this.data.input_val){
+ r_data.KeyWord= encodeURIComponent(this.data.input_val);
+ }
+
+ getApp().request.promiseGet("/api/weshop/users/staff/page", {
+ data:r_data
+ }).then(res => {
+ th.setData({isload:1});
+ if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0) {
+ th.data.page++;//当前页数+1
+ var arr1 = th.data.list;//获取明细数组
+ var arr2 = res.data.data.pageData;//获取当前查询数据
+ if(!arr1) arr1=[];
+
+ var arr3 = [...arr1, ...arr2];//把当前查询数组拼接到原本数组后面
+ var ismore = 0;
+ if (arr3.length == res.data.data.total) ismore = 1 //数据已加载完判断
+
+ th.setData({
+ list: arr3,
+ total: res.data.data.total,
+ ismore: ismore,
+ })
+ }
+ })
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function() {
+ if (this.data.total <= this.data.pageSize) return;
+ if (this.data.ismore) {
+ t.my_warnning("加载完啦!", 0, this);return
+ };
+ this.get_list();
+ },
+
+ //返回
+ back:function () {
+ wx.navigateBack({ delta: 1})
+ },
+
+ pop_sele:function (e) {
+ var index=e.currentTarget.dataset.index;
+ var item=this.data.list[index];
+ this.setData({show_pop:1,sele_item:item});
+ },
+ close_pop:function () {
+ this.setData({show_pop:0});
+ },
+ //选择了导购,就跳转到会员中心页面
+ go_user_info:function () {
+ var item=this.data.sele_item;
+ getApp().globalData.choice_guide=item;
+ getApp().goto("/pages/user/userinfo/userinfo");
+ },
+
+ img_err:function (e) {
+ var txt=e.currentTarget.dataset.err_img;
+ this.setData({[txt]:this.data.iurl+'/miniapp/images/no-head.jpg'});
+ },
+
+ get_input_val:function(e){
+ var value=e.detail.value;
+ this.data.input_val=value;
+ },
+ sear:function(){
+ this.data.ismore=0;this.data.page=1;
+ this.setData({isload:0});
+ this.setData({list:null});
+ this.get_list();
+ }
+
+
+
+
+
+});
\ No newline at end of file
diff --git a/pages/user/choice_guide/choice_guide.json b/pages/user/choice_guide/choice_guide.json
new file mode 100644
index 0000000..e610f01
--- /dev/null
+++ b/pages/user/choice_guide/choice_guide.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "选择美导",
+ "enablePullDownRefresh": false,
+ "usingComponents": {
+ "warn": "/components/long_warn/long_warn"
+ }
+}
\ No newline at end of file
diff --git a/pages/user/choice_guide/choice_guide.wxml b/pages/user/choice_guide/choice_guide.wxml
new file mode 100644
index 0000000..e72b521
--- /dev/null
+++ b/pages/user/choice_guide/choice_guide.wxml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+ 查询
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.StaffName}}
+ {{item.Remark1?item.Remark1:'暂无介绍'}}
+
+
+
+
+ 选择
+
+
+
+
+
+
+
+
+
+
+ 暂无顾问明细
+
+
+ 返回
+
+
+
+
+
+
+
+
+
+
+
+ {{sele_item.StaffName}}
+
+
+ 工作介绍:{{sele_item.Remark1}}
+
+
+ 选择
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/choice_guide/choice_guide.wxss b/pages/user/choice_guide/choice_guide.wxss
new file mode 100644
index 0000000..fca6187
--- /dev/null
+++ b/pages/user/choice_guide/choice_guide.wxss
@@ -0,0 +1,17 @@
+.big_box{padding: 0 20rpx }
+.head_pic{ width: 160rpx; height: 160rpx; border-radius: 50%}
+.pic2{ width: 100rpx; height: 100rpx; }
+
+.item{border-bottom: 0.01rem solid #eeeeee; padding: 20rpx 0;}
+.choice_btn{ width: 130rpx; height: 50rpx; border-radius: 50rpx;
+ border:1rpx solid #cb3549; color: #cb3549;
+}
+.box{ position: fixed; z-index: 6666; bottom: 0; left: 0;background-color: #fff;width: 100%;}
+.t_choice_btn{ width: 160rpx; height: 50rpx; background-color:#169bd5; border-radius: 10rpx; color: #fff }
+
+.sear_all{ width: 93%; margin: 0 auto; height: 80rpx; margin-top: 20rpx }
+.sear_all .inp_div,.sear_all .sear_btn{ height: 80rpx; line-height: 80rpx }
+.inp_div{ width: 80%; overflow: hidden;background-color: #f2f2f2}
+.sear_all .inp_div input{ margin-left: 54rpx; width: 100%; height: 100%; border: 0; border-radius: 0; }
+.sear_btn{ width: 20%;background-color: #ff6768; text-align: center;color: #fff; font-size: 32rpx}
+.find_img{width: 44rpx; height: 44rpx; position: absolute; left: 8rpx; top: 18rpx; z-index: 10}
\ No newline at end of file
diff --git a/pages/user/order_detail/order_detail.js b/pages/user/order_detail/order_detail.js
index 084f4c2..beb7224 100644
--- a/pages/user/order_detail/order_detail.js
+++ b/pages/user/order_detail/order_detail.js
@@ -68,17 +68,13 @@ Page({
rq.get("/api/weshop/ordergoods/list",{
data: { store_id: os.stoid, order_id: oid},
success:async function (eb) {
- r.order_goods=eb.data.data.pageData;
-
- var glist = r.order_goods;
- for(var i in glist){
+ r.order_goods=eb.data.data.pageData;
+ var glist = r.order_goods;
+ for(var i in glist){
if(glist[i].is_gift){
r.is_prom=1;
}
- }
-
-
-
+ }
//------------对比一下有没有退款记录------------
await getApp().request.promiseGet("/api/weshop/order/returngoods/page",{
@@ -107,6 +103,8 @@ Page({
//--------整单退--------
if (ttd.data.data.pageData[0]['goods_id_list'] != null
&& ttd.data.data.pageData[0]['goods_id_list'] != ''){
+
+
var eea = ttd.data.data.pageData[0];
//1.退款正在进行中,
//2.退款被拒绝就要显示可以退款
@@ -118,8 +116,10 @@ Page({
switch (eea.status) {
case 0:
case 1:
+ r.order_status_detail="退款中";
r['return_btn'] = 2; break;
case 2:
+ r.order_status_detail="退款完成";
r['return_btn'] = 4; break;
case 3:
r['return_btn'] = 3; break;
diff --git a/pages/user/order_detail/order_detail.wxml b/pages/user/order_detail/order_detail.wxml
index 51db5fc..2f03c70 100644
--- a/pages/user/order_detail/order_detail.wxml
+++ b/pages/user/order_detail/order_detail.wxml
@@ -18,7 +18,8 @@
门店:{{order.pickname}}
{{order.order_status_detail}}
-
+
+
@@ -35,7 +36,7 @@
×{{item.goods_num}}
-
+
申请退款
+
-
+
@@ -67,7 +68,7 @@
-
+
申请退款
退款中
重新退款
diff --git a/pages/user/userinfo/userinfo.js b/pages/user/userinfo/userinfo.js
index 47ea48c..02bcf48 100644
--- a/pages/user/userinfo/userinfo.js
+++ b/pages/user/userinfo/userinfo.js
@@ -67,6 +67,8 @@ Page({
is_zy: 0, //是否执行onshow
is_lable_set: "", //是否启用我的兴趣标签
check_label: [], //我选择的兴趣标签
+ fir_guide_id:null, //存储会员详情接口出来的美导ID
+
},
//通过路径跳转到其他页面
goto: function(e) {
@@ -80,7 +82,9 @@ Page({
var sms_conf = ee.switch_list;
sms_conf = JSON.parse(sms_conf);
th.setData({
- is_lable_set: sms_conf.user_label_set
+ is_lable_set: sms_conf.user_label_set, //是不是会员标签设置
+ guide_title:sms_conf.guide_consultant, //系统参数 导购标题
+ guide_change_time:sms_conf.guide_change_time //每月能修改几次
})
if (sms_conf.user_label_set) {
th.query_checklabels();
@@ -152,8 +156,6 @@ Page({
th.setData({
isGender: sex
})
-
-
},
//密码是否隐藏显示
ispwhid: function() {
@@ -627,6 +629,14 @@ Page({
var e = this;
if (this.data.is_zy) return false;
this.wait_for_store_config();
+
+ //如果有传值进行跳转的话
+ var choice_guide=null;
+ if(getApp().globalData.choice_guide){
+ choice_guide=JSON.parse(JSON.stringify(getApp().globalData.choice_guide));
+ getApp().globalData.choice_guide=null;
+ }
+
var req = t;
req.get("/api/weshop/users/getAndUpdateUser/" + r.stoid + "/" + getApp().globalData.user_id, {
success: function(src) {
@@ -644,6 +654,13 @@ Page({
a.address="";
}
+ e.data.fir_guide_id=a.staffId;
+ if(choice_guide){
+ a.staffName=choice_guide.StaffName;
+ a.staffId=choice_guide.Id;
+ }
+
+
e.setData({
phone: a.mobile,
user: a,
@@ -656,6 +673,7 @@ Page({
isstcsp: a.vipnopwd,
iscalendar:a.islunar
});
+
}
})
a.getUserInfo(function(a) {
@@ -832,6 +850,11 @@ Page({
islunar:th.data.iscalendar,
birthday:th.data.datet
}
+ //往上提交美导的ID
+ if(th.data.fir_guide_id!=th.data.user.staffId){
+ datas.staffId=th.data.user.staffId;
+ }
+
getApp().request.put("/api/weshop/users/updateUserInfo", {
data: datas,
success: function(res) {
@@ -862,5 +885,10 @@ Page({
return o.share;
},
+ //-- 跳转到获取导购的列表 --
+ go_get_guide:function () {
+ getApp().goto("/pages/user/choice_guide/choice_guide");
+ }
+
});
\ No newline at end of file
diff --git a/pages/user/userinfo/userinfo.wxml b/pages/user/userinfo/userinfo.wxml
index 6a949b3..5faca99 100644
--- a/pages/user/userinfo/userinfo.wxml
+++ b/pages/user/userinfo/userinfo.wxml
@@ -184,15 +184,26 @@
+
所属门店
- {{stoname}}
-
+ {{stoname}}
+ ∟
+
+
+
+
+ {{guide_title}}
+
+ {{user.staffName?user.staffName:"*选择顾问"}}
∟
+
+
+
@@ -218,6 +229,8 @@
+
+
收货地址
@@ -225,11 +238,12 @@
∟
+
绑定时间
{{user.reg_time?filters.replace_time2(user.reg_time):""}}
-
+
diff --git a/utils/auth.js b/utils/auth.js
index ba086b7..bdafaf9 100644
--- a/utils/auth.js
+++ b/utils/auth.js
@@ -51,7 +51,7 @@ module.exports = {
data: {
js_code: e,
store_id: a.globalData.setting.stoid,
- nickname:a.globalData.getu.nickName,
+ nickname: a.clear_word(a.globalData.getu.nickName)
},
success: function (e) {
console.log("openidandkey");