From 04b4bddaac0a222760113899568d20b45af701f4 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 27 九月 2024 19:04:14 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
server/web/src/main/java/com/doumee/api/web/CustomerApi.java | 14
wechat_staff/pages/promotion/index.js | 259 ++++++++----
server/service/src/main/java/com/doumee/core/wx/WxMsgVO.java | 23 +
wechat_jiaxuan/pages/detailDis/realpic.js | 17
wechat_staff/pages/login/index.wxml | 2
server/service/src/main/java/com/doumee/biz/zbom/ZbomCRMService.java | 2
wechat_jiaxuan/components/disProduct/index.js | 158 +++++--
wechat_staff/pages/login/index.wxss | 9
wechat_staff/pages/kefu/fond.js | 2
wechat_jiaxuan/pages/detailDis/product.wxml | 8
wechat_staff/project.private.config.json | 6
wechat_staff/pages/kefu/select.wxml | 4
wechat_staff/pages/detailDis/product.js | 3
server/service/src/main/java/com/doumee/core/utils/Constants.java | 6
server/service/src/main/java/com/doumee/core/wx/SendWxMessage.java | 76 +++
wechat_staff/pages/kefu/select.js | 9
wechat_jiaxuan/pages/index/index.js | 2
wechat_jiaxuan/pages/auth/auth.js | 17
wechat_jiaxuan/pages/detailDis/product.js | 21
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTTagChildInfoResponse.java | 2
wechat_staff/utils/config.js | 4
wechat_staff/pages/work/index.js | 71 ++
wechat_staff/pages/login/index.less | 9
wechat_jiaxuan/utils/config.js | 2
wechat_staff/pages/kefu/select.wxss | 2
wechat_staff/components/disProduct/index.js | 321 +++++++++++----
wechat_staff/pages/detailDis/product.wxml | 6
wechat_staff/pages/kefu/select.less | 2
server/service/src/main/java/com/doumee/core/wx/TemplateData.java | 19
wechat_jiaxuan/pages/detailDis/case.js | 10
wechat_staff/pages/work/index.wxml | 2
wechat_staff/components/disProduct/index.wxml | 16
server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomCRMServiceImpl.java | 65 ++
wechat_staff/pages/download/index.js | 4
wechat_staff/api/index.js | 3
server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java | 5
server/service/src/main/java/com/doumee/biz/zbom/model/crm/CRMConstants.java | 2
wechat_jiaxuan/components/disProduct/index.wxml | 16
38 files changed, 879 insertions(+), 320 deletions(-)
diff --git a/server/service/src/main/java/com/doumee/biz/zbom/ZbomCRMService.java b/server/service/src/main/java/com/doumee/biz/zbom/ZbomCRMService.java
index f8babe7..2817f00 100644
--- a/server/service/src/main/java/com/doumee/biz/zbom/ZbomCRMService.java
+++ b/server/service/src/main/java/com/doumee/biz/zbom/ZbomCRMService.java
@@ -22,7 +22,7 @@
void dealCustomerLogData(CustomerLog customerLog);
String zbomEncode(String str);
- String getCrmGoUrl(String userName,Integer type);
+ String getCrmGoUrl(String userName,Integer type,String iamId);
CRMBaseResponse<List<CRMCustomerListResponse>> getCustomerList(CrmCustomerListRequest entity );
CRMBaseResponse<List<CRMDaogouBindListResponse>> getDaogouBindList(CrmDaogouBindListRequest entity );
diff --git a/server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomCRMServiceImpl.java b/server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomCRMServiceImpl.java
index 2262a23..b214562 100644
--- a/server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomCRMServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomCRMServiceImpl.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.biz.zbom.ZbomCRMService;
import com.doumee.biz.zbom.model.crm.*;
import com.doumee.biz.zbom.model.crm.response.CRMBaseResponse;
@@ -17,14 +18,22 @@
import com.doumee.dao.business.CustomerLogMapper;
import com.doumee.dao.business.model.CrmInterfaceLog;
import com.doumee.dao.business.model.CustomerLog;
+import com.doumee.dao.business.model.Member;
+import com.doumee.dao.business.model.Users;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
+import org.apache.logging.log4j.util.Base64Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
+import org.springframework.util.Base64Utils;
+import javax.crypto.Cipher;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.*;
@@ -43,6 +52,8 @@
private CrmInterfaceLogMapper crmInterfaceLogMapper;
@Autowired
private RedisTemplate<String, Object> redisTemplate;
+ @Autowired
+ private SystemDictDataBiz systemDictDataBiz;
@@ -253,24 +264,66 @@
* @return
*/
@Override
- public String getCrmGoUrl(String userName,Integer type){
+ public String getCrmGoUrl(String userName,Integer type,String iamId){
try {
// 鍒涘缓StringBuffer瀵硅薄鐢ㄦ潵鎿嶄綔瀛楃涓�
int _t = (int)(System.currentTimeMillis());
String pageKey ="mp";//瀹㈡埛鍒楄〃椤甸潰鐮�
+ String fileUrl = systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_CRM_API_URL_MP).getCode();
if(Constants.equalsInteger(type,Constants.ONE)){
pageKey = "mpAddIntention";//鏂板鎰忓悜椤甸潰鐮�
+ fileUrl = systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_CRM_API_URL_MP_ADDINTENTION).getCode();
}
- String appkey = (String) redisTemplate.opsForValue().get(Constants.RedisKeys.ZBOM_CRM_AUTH_API_KEY);
String url = redisTemplate.opsForValue().get(Constants.RedisKeys.ZBOM_CRM_API_URL)
- +CRMConstants.IntegerUrl.GO_CRM_AUTH_URL
- + "?timestamp="+_t
- +"&agent_phone_number=" + URLEncoder.encode(userName, "UTF-8")
- + "&bindKey="+pageKey+"&sign="+ DigestUtils.md5Hex( _t + appkey);;
+ + CRMConstants.IntegerUrl.GO_CRM_AUTH_URL
+ + "?bindKey="+pageKey
+ + "&tick=" + this.getTick(iamId, fileUrl);
return url;
}catch (Exception e){
e.printStackTrace();
}
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鑾峰彇璺宠浆鍦板潃澶辫触鍝︼紒");
}
+
+ public String getTick(String iamId, String fileUrL) throws UnsupportedEncodingException {
+ Map<String,Object> map = new HashMap<>();
+ //鐢ㄦ埛IAM涓婚敭
+ map.put("ssouserid",iamId);
+ //鍞墠灏忕▼搴廰ppid
+ map.put("appid",systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_IAM_BUSINESS_APPID).getCode());
+ //璺宠浆鍦板潃
+ map.put("rediUrl",fileUrL);
+ //鏃堕棿鎴�
+ map.put("timestamp",System.currentTimeMillis()/1000+"");
+ //C绔皬绋嬪簭appid
+ map.put("sourceappid",systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_IAM_CUSTOMER_APPID).getCode());
+ System.out.println(JSONObject.toJSONString(map));
+ //鑾峰彇tick
+ String tick = ZbomCRMServiceImpl.encrypt(
+ systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_CRM_API_URL_PRIVATE_KEY).getCode()
+ ,JSONObject.toJSONString(map)
+ ,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_CRM_API_URL_INIT_VECTOR).getCode());
+
+ String tickEncoder = URLEncoder.encode(tick,"UTF-8");
+
+ return tickEncoder;
+ }
+
+
+ public static String encrypt(String key, String value,String initVector) {
+ try {
+ IvParameterSpec iv = new IvParameterSpec(initVector.getBytes("UTF-8"));
+ SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "AES");
+ Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING");
+ cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv);
+ byte[] encrypted = cipher.doFinal(value.getBytes());
+ return Base64Utils.encodeToString(encrypted);
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ return null;
+ }
+
+
}
diff --git a/server/service/src/main/java/com/doumee/biz/zbom/model/crm/CRMConstants.java b/server/service/src/main/java/com/doumee/biz/zbom/model/crm/CRMConstants.java
index 21710ea..e7b321c 100644
--- a/server/service/src/main/java/com/doumee/biz/zbom/model/crm/CRMConstants.java
+++ b/server/service/src/main/java/com/doumee/biz/zbom/model/crm/CRMConstants.java
@@ -16,7 +16,7 @@
String POST_CUS_DATA_URL ="/api/public/zbom/postCusData";
String CUS_BEFORE_PAGE_LIST_URL ="/api/public/mini/program/cusOrBeforeList";
String DAOGOU_BIND_LIST_URL ="/api/public/mini/program/list";
- String GO_CRM_AUTH_URL ="/oauth/authorize/jump";
+ String GO_CRM_AUTH_URL = "/oauth/authorize";//"/oauth/authorize/jump";
}
public interface IntegerName{
diff --git a/server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTTagChildInfoResponse.java b/server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTTagChildInfoResponse.java
index 9aec07d..9572010 100644
--- a/server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTTagChildInfoResponse.java
+++ b/server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTTagChildInfoResponse.java
@@ -33,4 +33,6 @@
@ApiModelProperty(value = "鏍囩鍊兼帓搴�")
private String labelValueSort;
+ @ApiModelProperty(value = "瀛愭爣绛句俊鎭�")
+ private List<ZTTagInfoResponse> relLabel;
}
diff --git a/server/service/src/main/java/com/doumee/core/utils/Constants.java b/server/service/src/main/java/com/doumee/core/utils/Constants.java
index babd1ad..5c23d53 100644
--- a/server/service/src/main/java/com/doumee/core/utils/Constants.java
+++ b/server/service/src/main/java/com/doumee/core/utils/Constants.java
@@ -379,6 +379,12 @@
public static final String WX_TOKEN_CUSTOMER = "WX_TOKEN_CUSTOMER";
public static final String WX_TOKEN_PERSONNEL = "WX_TOKEN_PERSONNEL";
public static final String ZBOM_CRM_POSTCUS_API_KEY = "ZBOM_CRM_POSTCUS_API_KEY";
+ public static final String ZBOM_CRM_API_URL_MP = "ZBOM_CRM_API_URL_MP";
+ public static final String ZBOM_CRM_API_URL_MP_ADDINTENTION = "ZBOM_CRM_API_URL_MP_ADDINTENTION";
+ public static final String ZBOM_CRM_API_URL_PRIVATE_KEY = "ZBOM_CRM_API_URL_PRIVATE_KEY";
+ public static final String ZBOM_CRM_API_URL_INIT_VECTOR = "ZBOM_CRM_API_URL_INIT_VECTOR";
+ public static final String ZBOM_IAM_CUSTOMER_APPID = "ZBOM_IAM_CUSTOMER_APPID";
+ public static final String ZBOM_IAM_BUSINESS_APPID = "ZBOM_IAM_BUSINESS_APPID";
public interface RedisKeys {
diff --git a/server/service/src/main/java/com/doumee/core/wx/SendWxMessage.java b/server/service/src/main/java/com/doumee/core/wx/SendWxMessage.java
new file mode 100644
index 0000000..6a68388
--- /dev/null
+++ b/server/service/src/main/java/com/doumee/core/wx/SendWxMessage.java
@@ -0,0 +1,76 @@
+package com.doumee.core.wx;
+
+import com.alibaba.fastjson.JSONObject;
+import com.doumee.biz.system.SystemDictDataBiz;
+import com.doumee.core.utils.Constants;
+import com.doumee.core.utils.DateUtil;
+import com.doumee.dao.system.model.SystemDictData;
+import com.doumee.dao.system.model.SystemUser;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by IntelliJ IDEA.
+ *
+ * @Author : Rk
+ * @create 2022/12/7 17:27
+ */
+@Service
+@Slf4j
+public class SendWxMessage {
+
+ private static String programUrl = "packagesMine/meetingDetails/meetingDetails?id=";
+
+
+ public void testMessage(String openid,String token){
+ RestTemplate restTemplate = new RestTemplate();
+ log.info("寰俊灏忕▼搴� 浼氳寮�濮嬭闃呮秷鎭彂閫佹棩蹇� -> accessToken锛歿}",token);
+ //杩欓噷绠�鍗曡捣瑙佹垜浠瘡娆¢兘鑾峰彇鏈�鏂扮殑access_token锛堟椂闂村紑鍙戜腑锛屽簲璇ュ湪access_token蹇繃鏈熸椂鍐嶉噸鏂拌幏鍙栵級
+ String url = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="+token;
+ //鎷兼帴鎺ㄩ�佺殑妯$増
+ WxMsgVO wxMsgVo = new WxMsgVO();
+ //鐢ㄦ埛鐨刼penid锛堣鍙戦�佺粰閭d釜鐢ㄦ埛锛�
+ wxMsgVo.setTouser(openid);
+ //璁㈤槄娑堟伅妯℃澘id
+ wxMsgVo.setTemplate_id("A_jEWoyl0Uu_l5J-zwlwx_FcbUirlsS6Peu4JW6a7Gc");
+ Map<String, TemplateData> m = new HashMap<>(2);
+ //浼氳涓婚
+ m.put("thing1", new TemplateData("鍙堟潵鏂板鎴峰暒锛�"));
+
+ //浼氳鍦扮偣
+ m.put("character_string6", new TemplateData("zhangsan01"));
+ wxMsgVo.setData(m);
+ ResponseEntity<String> responseEntity =
+ restTemplate.postForEntity(url, wxMsgVo, String.class);
+ log.info("寰俊灏忕▼搴�-> 鍙栨秷閫氱煡璁㈤槄娑堟伅鍙戦�佹棩蹇楋細{}",JSONObject.toJSONString(responseEntity));
+ }
+
+
+
+
+// /**
+// * 鑾峰彇token
+// */
+// private static String getAccessToken() {
+// //鍙戦�佽姹傝幏鍙杢oken
+// JSONObject token = null;
+// try {
+// token = JSONObject.parseObject(HttpsUtil.get(APP_ACCESS_TOKEN_URL,false));
+// } catch (Exception e) {
+// e.printStackTrace();
+// }
+// JSONObject jsonObject = token;
+// String accessToken = (String) jsonObject.get("access_token");
+// Integer expiresIn = (Integer) jsonObject.get("expires_in");
+// //鍒涘缓token瀵硅薄锛屽苟瀛樺偍
+// return new AccessToken(accessToken,String.valueOf(expiresIn)).getAccessToken();
+// }
+
+}
diff --git a/server/service/src/main/java/com/doumee/core/wx/TemplateData.java b/server/service/src/main/java/com/doumee/core/wx/TemplateData.java
new file mode 100644
index 0000000..aad9cf6
--- /dev/null
+++ b/server/service/src/main/java/com/doumee/core/wx/TemplateData.java
@@ -0,0 +1,19 @@
+package com.doumee.core.wx;
+
+import lombok.Data;
+
+/**
+ * Created by IntelliJ IDEA.
+ *
+ * @Author : Rk
+ * @create 2022/12/7 17:28
+ */
+@Data
+public class TemplateData {
+ private String value;
+
+ public TemplateData(String value) {
+ this.value = value;
+ }
+
+}
diff --git a/server/service/src/main/java/com/doumee/core/wx/WxMsgVO.java b/server/service/src/main/java/com/doumee/core/wx/WxMsgVO.java
new file mode 100644
index 0000000..cee69e6
--- /dev/null
+++ b/server/service/src/main/java/com/doumee/core/wx/WxMsgVO.java
@@ -0,0 +1,23 @@
+package com.doumee.core.wx;
+
+import lombok.Data;
+
+import java.util.Map;
+
+/**
+ * Created by IntelliJ IDEA.
+ *
+ * @Author : Rk
+ * @create 2022/12/7 17:27
+ */
+@Data
+public class WxMsgVO {
+ //鐢ㄦ埛openId
+ private String touser;
+ //妯$増id
+ private String template_id;
+ //鎺ㄩ�佹枃瀛�
+ private Map<String , TemplateData> data;
+ //璺宠浆璺緞 锛岄粯璁よ烦杞埌灏忕▼搴忛椤�
+ private String page="pages/index/index";
+}
diff --git a/server/web/src/main/java/com/doumee/api/web/CustomerApi.java b/server/web/src/main/java/com/doumee/api/web/CustomerApi.java
index 05a0f8e..07abd7e 100644
--- a/server/web/src/main/java/com/doumee/api/web/CustomerApi.java
+++ b/server/web/src/main/java/com/doumee/api/web/CustomerApi.java
@@ -11,6 +11,7 @@
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
+import com.doumee.core.wx.SendWxMessage;
import com.doumee.dao.business.model.*;
import com.doumee.dao.web.reqeust.*;
import com.doumee.dao.web.response.AccountResponse;
@@ -625,4 +626,17 @@
ZTBasePageResponse<ZTCollectLikeInfoResponse> ztBasePageResponse= getZhongTaiDataService.collectLikePage(ztCollectLikeRequest);
return ApiResponse.success("鏌ヨ鎴愬姛",ztBasePageResponse);
}
+
+ @ApiOperation(value = "娴嬭瘯鍙戦�佸井淇℃秷鎭�", notes = "瀹㈡埛绔皬绋嬪簭")
+ @GetMapping("/testSendWxMessage")
+ @ApiImplicitParams({
+ @ApiImplicitParam(paramType = "query", dataType = "String", name = "openid", value = "灏忕▼搴廼d", required = true),
+ @ApiImplicitParam(paramType = "query", dataType = "String", name = "token", value = "token", required = true),
+ })
+ public ApiResponse testSendWxMessage(@RequestParam String openid,@RequestParam String token) {
+ SendWxMessage sendWxMessage = new SendWxMessage();
+ sendWxMessage.testMessage(openid,token);
+ return ApiResponse.success("鎿嶄綔鎴愬姛");
+ }
+
}
diff --git a/server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java b/server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java
index f6a361d..4b2d588 100644
--- a/server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java
+++ b/server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java
@@ -13,10 +13,12 @@
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.model.ApiResponse;
+import com.doumee.core.model.LoginUserInfo;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.dao.business.model.News;
+import com.doumee.dao.business.model.Users;
import com.doumee.dao.web.reqeust.GenerateQRCodeRequest;
import com.doumee.dao.web.response.DailyUpdatesResponse;
import com.doumee.dao.web.response.ZSZXCatalogResponse;
@@ -120,7 +122,8 @@
@ApiImplicitParam(paramType = "query", dataType = "Integer", name = "type", value = "绫诲瀷 0瀹㈡埛鍒楄〃 1璺宠浆鏂板鎰忓悜瀹㈡埛", required = true)
})
public ApiResponse<String> getCrmAuthUrl(@RequestParam Integer type) {
- return ApiResponse.success(zbomCRMService.getCrmGoUrl(this.getLoginUserInfo().getIamUsername(),type));
+ Users users = this.getLoginUserInfo();
+ return ApiResponse.success(zbomCRMService.getCrmGoUrl(users.getIamUsername(),type,users.getIamId()));
}
diff --git a/wechat_jiaxuan/components/disProduct/index.js b/wechat_jiaxuan/components/disProduct/index.js
index 59064f2..bc7e2fb 100644
--- a/wechat_jiaxuan/components/disProduct/index.js
+++ b/wechat_jiaxuan/components/disProduct/index.js
@@ -196,71 +196,141 @@
tagClick(e) {
const code = e.currentTarget.dataset.code
const paramIndex = e.currentTarget.dataset.index
- const { secondCateList, tagCodes, activeParam, activeIndex } = this.data
- const index = tagCodes.indexOf(code)
- console.log('code', code)
- console.log('tagCodes', tagCodes)
- console.log(secondCateList)
- if ( secondCateList[activeIndex].tempParamIndex==null || secondCateList[activeIndex].tempParamIndex != paramIndex) {
- // 鍚宲aram閲宑ode閲嶅
- // if (activeParam && activeParam.length > 0) {
- // activeParam.forEach(item => {
- // const indexTemp = tagCodes.indexOf(item.labelValueCode)
- // if (indexTemp > -1) {
- // tagCodes.splice(indexTemp, 1)
- // }
- // })
- // }
- //tagCodes.push(code)
- secondCateList[activeIndex].tempParamIndex = paramIndex
- secondCateList[activeIndex].tempParamCode = code
- secondCateList[activeIndex].tempParamName = activeParam[paramIndex].labelValueName
+ const {
+ secondCateList,
+ tagCodes,
+ activeParam,
+ activeIndex
+ } = this.data
+ // 鐐瑰嚮瀛愭爣绛�
+ console.log('openRelLabel', secondCateList[activeIndex].openRelLabel);
+ if (secondCateList[activeIndex].openRelLabel) {
+ if (secondCateList[activeIndex].tempParamRelIndex == null || secondCateList[activeIndex].tempParamRelIndex != paramIndex) {
+ secondCateList[activeIndex].tempParamRelIndex = paramIndex
+ secondCateList[activeIndex].tempParamRelCode = code
+ secondCateList[activeIndex].tempParamRelName = activeParam[paramIndex].labelValueName
+ } else {
+ secondCateList[activeIndex].tempParamRelIndex = -1
+ secondCateList[activeIndex].tempParamRelCode = ''
+ secondCateList[activeIndex].tempParamRelName = ''
+ }
+ console.log('secondCateList', secondCateList);
} else {
- // tagCodes.splice(index, 1)
- secondCateList[activeIndex].tempParamIndex = -1
- secondCateList[activeIndex].tempParamCode = ''
- secondCateList[activeIndex].tempParamName = ''
+ // 鐐瑰嚮鐖舵爣绛�
+ const relLabel = secondCateList[activeIndex].valueVos[paramIndex].relLabel || []
+ if (relLabel.length > 0 && relLabel[0].labelCode) {
+ secondCateList[activeIndex].relLabel = relLabel[0]
+ }else{
+ secondCateList[activeIndex].relLabel = null
+ }
+ secondCateList[activeIndex].tempParamRelIndex = -1
+ secondCateList[activeIndex].tempParamRelCode = ''
+ secondCateList[activeIndex].tempParamRelName = ''
+ if (secondCateList[activeIndex].tempParamIndex == null || secondCateList[activeIndex].tempParamIndex != paramIndex) {
+ secondCateList[activeIndex].tempParamIndex = paramIndex
+ secondCateList[activeIndex].tempParamCode = code
+ secondCateList[activeIndex].tempParamName = activeParam[paramIndex].labelValueName
+ } else {
+ secondCateList[activeIndex].tempParamIndex = -1
+ secondCateList[activeIndex].tempParamCode = ''
+ secondCateList[activeIndex].tempParamName = ''
+ }
}
- this.setData({secondCateList })
+ this.setData({
+ tagCodes,
+ secondCateList
+ })
},
changeShowParams(e) {
- const { secondCateList } = this.data
+ const {
+ secondCateList,
+ activeParam
+ } = this.data
const activeIndex = e.currentTarget.dataset.index
- console.log('activeIndex', activeIndex)
- console.log('secondCateList', secondCateList)
- if (activeIndex === this.data.activeIndex) {
- this.setData({ activeIndex: -1, activeParam: [] })
+ const type = e.currentTarget.dataset.type || ''
+ // console.log('activeIndex', activeIndex);
+ // 閽堝鏈夊瓙闆嗙殑label
+ if (type && type == 'child') {
+ if (secondCateList[activeIndex].openRelLabel) {
+ secondCateList[activeIndex].openRelLabel = false
+ this.setData({
+ activeIndex,
+ activeParam: [],
+ secondCateList
+ })
+ } else {
+ secondCateList[activeIndex].openRelLabel = true
+ this.setData({
+ activeParam: secondCateList[activeIndex].relLabel.valueVos,
+ secondCateList,
+ activeIndex
+ })
+ }
+ return
+ }
+ // 闈炲瓙闆嗙殑label
+ secondCateList[activeIndex].openRelLabel = false
+ this.setData({ secondCateList })
+ if (activeIndex === this.data.activeIndex && activeParam.length > 0) {
+ this.setData({
+ activeIndex: -1,
+ activeParam: []
+ })
} else {
this.setData({
activeIndex,
activeParam: secondCateList[activeIndex].valueVos
})
}
- // this.setData({showTwo: false})
},
cancelParam() {
- const { secondCateList } = this.data
- secondCateList.forEach(item => {
+ const {
+ secondCateList
+ } = this.data
+ secondCateList.forEach(item => {
item.tempParamIndex = item.paramIndex
- item.tempParamName = item.paramName
- item.tempParamCode = item.paramCode
+ item.tempParamName = item.paramName
+ item.tempParamCode = item.paramCode
+ item.relLabel = null
+ item.openRelLabel = false
+ item.tempParamRelIndex = null
+ item.tempParamRelCode = null
+ item.tempParamRelName = null
})
// this.setData({ tagCodes: [], activeParam: [], secondCateList, activeIndex: -1 })
- this.setData({ activeParam: [],activeIndex: -1 ,secondCateList})
+ this.setData({
+ activeParam: [],
+ activeIndex: -1,
+ secondCateList
+ })
},
subParam() {
- const { secondCateList } = this.data
+ const {
+ secondCateList
+ } = this.data
var codes = []
secondCateList.forEach(item => {
- item.paramIndex = item.tempParamIndex
- item.paramName = item.tempParamName
+ item.paramIndex = item.tempParamIndex
+ item.paramName = item.tempParamName
item.paramCode = item.tempParamCode
- if( item.paramIndex>-1 && item.tempParamCode){
- codes.push( item.tempParamCode)
- }
- })
- this.setData({tagCodes:codes})
- this.setData({ pageNum: 1, activeParam: [] ,activeIndex: -1, datalist: [], total: 0 })
+ item.openRelLabel = false
+ if(item.tempParamRelIndex > -1 && item.tempParamRelCode){
+ return codes.push(item.tempParamRelCode)
+ }
+ if (item.paramIndex > -1 && item.tempParamCode) {
+ codes.push(item.paramCode)
+ }
+ })
+ this.setData({
+ tagCodes: codes
+ })
+ this.setData({
+ pageNum: 1,
+ activeParam: [],
+ activeIndex: -1,
+ datalist: [],
+ total: 0
+ })
this.getList()
},
}
diff --git a/wechat_jiaxuan/components/disProduct/index.wxml b/wechat_jiaxuan/components/disProduct/index.wxml
index ff5e5c9..38bb3cc 100644
--- a/wechat_jiaxuan/components/disProduct/index.wxml
+++ b/wechat_jiaxuan/components/disProduct/index.wxml
@@ -15,15 +15,21 @@
<view class="main_right">
<scroll-view class="query_wrap_scroll" scroll-x>
<view class="query_wrap">
- <view data-index="{{index}}" wx:for="{{ secondCateList }}" class="item" bindtap="changeShowParams">
- <view class="name">{{ item.tempParamName || item.labelName }}</view>
- <van-icon name="{{ index == activeIndex ? 'arrow-up' : 'arrow-down' }}" />
- </view>
+ <block wx:for="{{ secondCateList }}">
+ <view class="item" data-index="{{index}}" bindtap="changeShowParams">
+ <view class="name">{{ item.tempParamName || item.labelName }}</view>
+ <van-icon name="{{ index == activeIndex && !item.openRelLabel && activeParam.length > 0 ? 'arrow-up' : 'arrow-down' }}" />
+ </view>
+ <view wx:if="{{item.relLabel && item.relLabel.labelCode}}" data-type="child" data-index="{{index}}" class="item" bindtap="changeShowParams">
+ <view class="name">{{ item.tempParamRelName || item.relLabel.labelName }}</view>
+ <van-icon name="{{ index == activeIndex && item.openRelLabel && activeParam.length > 0? 'arrow-up' : 'arrow-down' }}" />
+ </view>
+ </block>
</view>
</scroll-view>
<view wx:if="{{ activeParam.length > 0 }}" class="query_form">
<view class="list">
- <view data-index="{{index}}" data-tempindex="{{item.tempParamIndex}}" data-code="{{ item.labelValueCode }}" bindtap="tagClick" wx:for="{{ activeParam }}" class="item {{ secondCateList[activeIndex].tempParamIndex === index ? 'active' : '' }}">{{ item.labelValueName }}</view>
+ <view data-index="{{index}}" data-code="{{ item.labelValueCode }}" bindtap="tagClick" wx:for="{{ activeParam }}" class="item {{ (!secondCateList[activeIndex].openRelLabel && secondCateList[activeIndex].tempParamIndex === index) || (secondCateList[activeIndex].openRelLabel && secondCateList[activeIndex].tempParamRelIndex === index) ? 'active' : '' }}">{{ item.labelValueName }}</view>
</view>
<view class="btns">
<view class="btn" bindtap="cancelParam">鍙栨秷</view>
diff --git a/wechat_jiaxuan/pages/auth/auth.js b/wechat_jiaxuan/pages/auth/auth.js
index 694c102..be2b2d0 100644
--- a/wechat_jiaxuan/pages/auth/auth.js
+++ b/wechat_jiaxuan/pages/auth/auth.js
@@ -9,6 +9,7 @@
*/
data: {
agreementFalg: false,
+ tempPath: '',
primary: '',
bottomLift: 0,
@@ -75,10 +76,9 @@
phone: res.data
}).then((res) => {
if (res.code == 200) {
- const tempPath = wx.getStorageSync('tempPath') || ''
+ const { tempPath } = this.data
wx.setStorageSync('member', res.data)
if (tempPath) {
- wx.setStorageSync('tempPath', '')
if (tempPath == '/pages/webView/index') {
wx.navigateTo({
url: '/pages/webView/index',
@@ -129,23 +129,22 @@
},
onLoad(options) {
var app = getApp().globalData
+
this.setData({
primary: app.primary
})
this.initData()
},
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
- */
onReady() {
},
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
- */
onShow() {
+ const tempPath = wx.getStorageSync('tempPath') || ''
+ this.setData({tempPath})
+ setTimeout(() => {
+ wx.setStorageSync('tempPath', '')
+ })
},
diff --git a/wechat_jiaxuan/pages/detailDis/case.js b/wechat_jiaxuan/pages/detailDis/case.js
index 22fd0ba..3a5e508 100644
--- a/wechat_jiaxuan/pages/detailDis/case.js
+++ b/wechat_jiaxuan/pages/detailDis/case.js
@@ -82,8 +82,14 @@
info
} = this.data
console.log('鐐瑰嚮浜嗗垎浜�')
- return {
- path: '/pages/detailDis/case?id=' + info.id + '&userId=' + info.users.id
+ if(info.users && info.users.id){
+ return {
+ path: '/pages/detailDis/case?id=' + info.id + '&userId=' + info.users.id
+ }
+ }else{
+ return {
+ path: '/pages/detailDis/case?id=' + info.id
+ }
}
},
handleAction(e) {
diff --git a/wechat_jiaxuan/pages/detailDis/product.js b/wechat_jiaxuan/pages/detailDis/product.js
index cc5c0d8..2bc3305 100644
--- a/wechat_jiaxuan/pages/detailDis/product.js
+++ b/wechat_jiaxuan/pages/detailDis/product.js
@@ -15,6 +15,7 @@
origin: '',
isFold: false,
info: {},
+ isCollection: false,
member: {},
showShare: false,
options: {
@@ -77,8 +78,8 @@
},
handleAction(e) {
const actionType = e.currentTarget.dataset.code
- const {
- info, member
+ let {
+ info, member, isCollection
} = this.data
if (!member.phone) {
return wx.navigateTo({
@@ -90,8 +91,9 @@
id: this.data.info.id
}).then(res => {
info.isCollection = !info.isCollection
+ isCollection = !isCollection
this.setData({
- info
+ isCollection
})
wx.showToast({
title: actionType == 'collect' ? '鏀惰棌鎴愬姛' : '鍙栨秷鏀惰棌',
@@ -105,7 +107,8 @@
salesId: userId || null
}).then(res => {
this.setData({
- info: res.data
+ info: res.data,
+ isCollection: res.data.isCollection
})
wx.setNavigationBarTitle({
title: res.data.title
@@ -167,8 +170,14 @@
onShareAppMessage: function () {
let { info } = this.data
console.log('鐐瑰嚮浜嗗垎浜�')
- return {
- path: '/pages/detailDis/product?id=' + info.id + '&userId=' + info.users.id
+ if(info.users && info.users.id){
+ return {
+ path: '/pages/detailDis/product?id=' + info.id + '&userId=' + info.users.id
+ }
+ }else{
+ return {
+ path: '/pages/detailDis/product?id=' + info.id
+ }
}
},
onClose() {
diff --git a/wechat_jiaxuan/pages/detailDis/product.wxml b/wechat_jiaxuan/pages/detailDis/product.wxml
index 6fb6f4b..d4f8c42 100644
--- a/wechat_jiaxuan/pages/detailDis/product.wxml
+++ b/wechat_jiaxuan/pages/detailDis/product.wxml
@@ -49,8 +49,8 @@
<view class="spaceList">
<view class="item" wx:for="{{ info.spaceList }}">
<!-- <view class="name">{{ item.spaceName }}</view> -->
- <image data-url="{{ item.spaceImg }}" bindtap="priviewSpace" src="{{ item.spaceImg }}" mode="widthFix" class="img"></image>
- <!-- <mp-html content="{{item.spaceContent}}"></mp-html> -->
+ <!-- <image data-url="{{ item.spaceImg }}" bindtap="priviewSpace" src="{{ item.spaceImg }}" mode="widthFix" class="img"></image> -->
+ <mp-html content="{{item.spaceContent}}"></mp-html>
</view>
</view>
<!-- footer -->
@@ -59,8 +59,8 @@
</view>
<view wx:else class="footer" style="padding-bottom: {{bottomLift}}px;">
<view class="btns">
- <button hover-class="none" data-code="{{ info.isCollection ? 'collect_cancel' : 'collect' }}" bindtap="handleAction" class="item btn">
- <image wx:if="{{ info.isCollection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
+ <button hover-class="none" data-code="{{ isCollection ? 'collect_cancel' : 'collect' }}" bindtap="handleAction" class="item btn">
+ <image wx:if="{{ isCollection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
<image wx:else class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image>
<view class="name">鏀惰棌</view>
</button>
diff --git a/wechat_jiaxuan/pages/detailDis/realpic.js b/wechat_jiaxuan/pages/detailDis/realpic.js
index bbbe022..1921e9f 100644
--- a/wechat_jiaxuan/pages/detailDis/realpic.js
+++ b/wechat_jiaxuan/pages/detailDis/realpic.js
@@ -149,13 +149,6 @@
// this.setData({showShare: false})
// })
},
- // onShareAppMessage: function () {
- // // let { productDetail, userInfo } = this.data
- // return {
- // title: productDetail.title,
- // path: '/pages/index/index?id=' + productDetail.id + '&shareuserid=' + userInfo.id + '&type=0'
- // }
- // },
onClose() {
this.setData({
showShare: false
@@ -214,8 +207,14 @@
info
} = this.data
console.log('鐐瑰嚮浜嗗垎浜�')
- return {
- path: '/pages/detailDis/realpic?id=' + info.id + '&userId=' + info.users.id
+ if(info.users && info.users.id){
+ return {
+ path: '/pages/detailDis/realpic?id=' + info.id + '&userId=' + info.users.id
+ }
+ }else{
+ return {
+ path: '/pages/detailDis/realpic?id=' + info.id
+ }
}
},
})
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/index/index.js b/wechat_jiaxuan/pages/index/index.js
index 69f06e2..d590a95 100644
--- a/wechat_jiaxuan/pages/index/index.js
+++ b/wechat_jiaxuan/pages/index/index.js
@@ -78,7 +78,7 @@
windowHeight: windowInfo.windowHeight
})
})
- }, 2000)
+ }, 3000)
},
onShow() {
const member = wx.getStorageSync('member')
diff --git a/wechat_jiaxuan/utils/config.js b/wechat_jiaxuan/utils/config.js
index 84f81a4..0fbace4 100644
--- a/wechat_jiaxuan/utils/config.js
+++ b/wechat_jiaxuan/utils/config.js
@@ -1,7 +1,7 @@
-// export const baseUrl = 'http://192.168.0.135:10027' // 鏈湴
+// export const baseUrl = 'http://192.168.0.136:10027' // 鏈湴
// export const baseUrl = 'https://dmtest.ahapp.net/web_interface' //娴嬭瘯鏈嶅姟鍣�
// 娴嬭瘯鏈嶅姟鍣�
diff --git a/wechat_staff/api/index.js b/wechat_staff/api/index.js
index cbca5dc..c6066a2 100644
--- a/wechat_staff/api/index.js
+++ b/wechat_staff/api/index.js
@@ -82,7 +82,8 @@
export const saveShareRecord = (data) => {
return request({
url: '/web/customer/saveShareRecord?id='+data,
- data
+ data,
+ loading: '0'
})
}
// 浜у搧瑙嗛
diff --git a/wechat_staff/components/disProduct/index.js b/wechat_staff/components/disProduct/index.js
index 7bde532..90b4a64 100644
--- a/wechat_staff/components/disProduct/index.js
+++ b/wechat_staff/components/disProduct/index.js
@@ -1,4 +1,8 @@
-import { getCatalogList,getCataLogTagList, getZhongTaiProductPage } from '../../api/index'
+import {
+ getCatalogList,
+ getCataLogTagList,
+ getZhongTaiProductPage
+} from '../../api/index'
let touchDot = 0
Component({
/**
@@ -19,7 +23,7 @@
cateList: [],
secondCateList: [],
datalist: [],
- isLoading:false,
+ isLoading: false,
pageNum: 1,
pageSize: 10,
total: 0,
@@ -27,12 +31,14 @@
sortType: '',
catalogCode: ""
},
- attached() {
+ attached() {
this.getCatelist()
var app = getApp()
console.log('globalData', app.globalData);
- if(app.globalData.catalogCode){
- this.setData({ catalogCode: app.globalData.catalogCode })
+ if (app.globalData.catalogCode) {
+ this.setData({
+ catalogCode: app.globalData.catalogCode
+ })
setTimeout(() => {
console.log('catalogCode', this.data.catalogCode);
getApp().globalData.catalogCode = ''
@@ -45,22 +51,26 @@
},
methods: {
bindscrolltoupper() {
- this.setData({ showTouch: true })
+ this.setData({
+ showTouch: true
+ })
this.fadeIn();
},
- touchstart(e){
+ touchstart(e) {
touchDot = e.detail.scrollTop;
},
touchmove(e) {
var touchMove = e.detail.scrollTop;
- if(touchMove - touchDot > 24){
+ if (touchMove - touchDot > 24) {
touchDot = touchMove
this.fadeOut();
}
- if(touchDot - touchMove > 24){
+ if (touchDot - touchMove > 24) {
touchDot = touchMove
setTimeout(() => {
- this.setData({ showTouch: true })
+ this.setData({
+ showTouch: true
+ })
this.fadeIn();
}, 200)
}
@@ -77,36 +87,40 @@
animationData: this.animation.export()
});
setTimeout(() => {
- this.setData({ showTouch: false });
+ this.setData({
+ showTouch: false
+ });
}, 200); // 鍔ㄧ敾鎸佺画鏃堕棿
},
- refreshCount(){
- let temData = wx.getStorageSync('conentCountTemp')
- if(temData && this.data.datalist){
- var dataList =this.data.datalist;
- dataList.forEach(item =>{
- if(item.id+'' == temData.id+'' ){
- item.viewCount = (item.viewCount ||0)+1;
- if( item.isCollection != temData.isCollection){
- if(item.isCollection){
- item.collectCount = (item.collectCount || 0)-1
- item.collectCount = item.collectCount >=0? item.collectCount :0;
- } else{
- item.collectCount = (item.collectCount || 0)+1
- }
- item.isCollection = temData.isCollection
- }
- }
- })
- this.setData({datalist:dataList})
- wx.setStorageSync('conentCountTemp',null)
+ refreshCount() {
+ let temData = wx.getStorageSync('conentCountTemp')
+ if (temData && this.data.datalist) {
+ var dataList = this.data.datalist;
+ dataList.forEach(item => {
+ if (item.id + '' == temData.id + '') {
+ item.viewCount = (item.viewCount || 0) + 1;
+ if (item.isCollection != temData.isCollection) {
+ if (item.isCollection) {
+ item.collectCount = (item.collectCount || 0) - 1
+ item.collectCount = item.collectCount >= 0 ? item.collectCount : 0;
+ } else {
+ item.collectCount = (item.collectCount || 0) + 1
+ }
+ item.isCollection = temData.isCollection
+ }
+ }
+ })
+ this.setData({
+ datalist: dataList
+ })
+ wx.setStorageSync('conentCountTemp', null)
}
},
- getCatelist(){
+ getCatelist() {
getCatalogList({
catalogCode: 'product_intro'
}).then(res => {
- if(res.data && res.data.length > 0){
+ if (res.data && res.data.length > 0) {
this.setData({
catalogCode: this.data.catalogCode || res.data[0].code,
cateList: res.data
@@ -131,31 +145,55 @@
},
bindblur() {
console.log('澶卞幓鐒︾偣');
- this.setData({ pageNum: 1,datalist: [],total: 0})
+ this.setData({
+ pageNum: 1,
+ datalist: [],
+ total: 0
+ })
this.getList()
},
- getList() {
- const { catalogCode,tagCodes, pageNum, pageSize, sortType, query } = this.data
+ getList() {
+ const {
+ catalogCode,
+ tagCodes,
+ pageNum,
+ pageSize,
+ sortType,
+ query
+ } = this.data
getZhongTaiProductPage({
- catalogCode,pageNum,pageSize,sortType,query,tagCodes
+ catalogCode,
+ pageNum,
+ pageSize,
+ sortType,
+ query,
+ tagCodes
}).then(res => {
- if(res.data && res.data.records){
+ if (res.data && res.data.records) {
this.setData({
datalist: [...this.data.datalist, ...res.data.records],
total: res.data.total
})
}
- }).finally(()=>{
- this.setData({isLoading:false})
+ }).finally(() => {
+ this.setData({
+ isLoading: false
+ })
})
},
scrolltolower() {
console.log('瑙﹀簳浜嬩欢');
- const { total, datalist, pageNum } = this.data
- if(total > datalist.length){
- this.setData({ pageNum: pageNum + 1 })
+ const {
+ total,
+ datalist,
+ pageNum
+ } = this.data
+ if (total > datalist.length) {
+ this.setData({
+ pageNum: pageNum + 1
+ })
this.getList()
- }else{
+ } else {
wx.showToast({
title: '鏆傛棤鏇村鏁版嵁',
icon: 'none'
@@ -163,21 +201,38 @@
}
},
cateClick(e) {
- var {isLoading} = this.data
- if(isLoading){
+ var {
+ isLoading
+ } = this.data
+ if (isLoading) {
return
}
- this.setData({isLoading:true})
+ this.setData({
+ isLoading: true
+ })
const catalogCode = e.currentTarget.dataset.code
- this.setData({ catalogCode, tagCodes: [] })
- this.setData({ pageNum: 1,datalist: [],total: 0})
+ this.setData({
+ catalogCode,
+ tagCodes: []
+ })
+ this.setData({
+ pageNum: 1,
+ datalist: [],
+ total: 0
+ })
this.getTag()
this.getList()
},
statusChange(e) {
const sortType = e.currentTarget.dataset.status
- this.setData({sortType})
- this.setData({ pageNum: 1,datalist: [],total: 0})
+ this.setData({
+ sortType
+ })
+ this.setData({
+ pageNum: 1,
+ datalist: [],
+ total: 0
+ })
this.getList()
},
handleDetail(e) {
@@ -189,70 +244,142 @@
tagClick(e) {
const code = e.currentTarget.dataset.code
const paramIndex = e.currentTarget.dataset.index
- const { secondCateList, tagCodes, activeParam, activeIndex } = this.data
- if( secondCateList[activeIndex].tempParamIndex==null || secondCateList[activeIndex].tempParamIndex != paramIndex){
- // 鍚宲aram閲宑ode閲嶅
- // if (activeParam && activeParam.length > 0) {
- // activeParam.forEach(item => {
- // const indexTemp = tagCodes.indexOf(item.labelValueCode)
- // if (indexTemp > -1) {
- // tagCodes.splice(indexTemp, 1)
- // }
- // })
- // }
- //tagCodes.push(code)
- secondCateList[activeIndex].tempParamIndex = paramIndex
- secondCateList[activeIndex].tempParamCode = code
- secondCateList[activeIndex].tempParamName = activeParam[paramIndex].labelValueName
+ const {
+ secondCateList,
+ tagCodes,
+ activeParam,
+ activeIndex
+ } = this.data
+ // 鐐瑰嚮瀛愭爣绛�
+ console.log('openRelLabel', secondCateList[activeIndex].openRelLabel);
+ if (secondCateList[activeIndex].openRelLabel) {
+ if (secondCateList[activeIndex].tempParamRelIndex == null || secondCateList[activeIndex].tempParamRelIndex != paramIndex) {
+ secondCateList[activeIndex].tempParamRelIndex = paramIndex
+ secondCateList[activeIndex].tempParamRelCode = code
+ secondCateList[activeIndex].tempParamRelName = activeParam[paramIndex].labelValueName
+ } else {
+ secondCateList[activeIndex].tempParamRelIndex = -1
+ secondCateList[activeIndex].tempParamRelCode = ''
+ secondCateList[activeIndex].tempParamRelName = ''
+ }
+ console.log('secondCateList', secondCateList);
} else {
- // tagCodes.splice(index, 1)
- secondCateList[activeIndex].tempParamIndex = -1
- secondCateList[activeIndex].tempParamCode = ''
- secondCateList[activeIndex].tempParamName = ''
+ // 鐐瑰嚮鐖舵爣绛�
+ const relLabel = secondCateList[activeIndex].valueVos[paramIndex].relLabel || []
+ if (relLabel.length > 0 && relLabel[0].labelCode) {
+ secondCateList[activeIndex].relLabel = relLabel[0]
+ }else{
+ secondCateList[activeIndex].relLabel = null
+ }
+ secondCateList[activeIndex].tempParamRelIndex = -1
+ secondCateList[activeIndex].tempParamRelCode = ''
+ secondCateList[activeIndex].tempParamRelName = ''
+ if (secondCateList[activeIndex].tempParamIndex == null || secondCateList[activeIndex].tempParamIndex != paramIndex) {
+ secondCateList[activeIndex].tempParamIndex = paramIndex
+ secondCateList[activeIndex].tempParamCode = code
+ secondCateList[activeIndex].tempParamName = activeParam[paramIndex].labelValueName
+ } else {
+ secondCateList[activeIndex].tempParamIndex = -1
+ secondCateList[activeIndex].tempParamCode = ''
+ secondCateList[activeIndex].tempParamName = ''
+ }
}
- this.setData({ tagCodes, secondCateList })
+ this.setData({
+ tagCodes,
+ secondCateList
+ })
},
- changeShowParams(e){
- const { secondCateList } = this.data
+ changeShowParams(e) {
+ const {
+ secondCateList,
+ activeParam
+ } = this.data
const activeIndex = e.currentTarget.dataset.index
- console.log('activeIndex', activeIndex);
- console.log('activeIndex', this.data.activeIndex);
- console.log('secondCateList', secondCateList);
- if(activeIndex === this.data.activeIndex){
- this.setData({ activeIndex: -1, activeParam: [] })
- }else{
- this.setData({
+ const type = e.currentTarget.dataset.type || ''
+ // console.log('activeIndex', activeIndex);
+ // 閽堝鏈夊瓙闆嗙殑label
+ if (type && type == 'child') {
+ if (secondCateList[activeIndex].openRelLabel) {
+ secondCateList[activeIndex].openRelLabel = false
+ this.setData({
+ activeIndex,
+ activeParam: [],
+ secondCateList
+ })
+ } else {
+ secondCateList[activeIndex].openRelLabel = true
+ this.setData({
+ activeParam: secondCateList[activeIndex].relLabel.valueVos,
+ secondCateList,
+ activeIndex
+ })
+ }
+ return
+ }
+ // 闈炲瓙闆嗙殑label
+ secondCateList[activeIndex].openRelLabel = false
+ this.setData({ secondCateList })
+ if (activeIndex === this.data.activeIndex && activeParam.length > 0) {
+ this.setData({
+ activeIndex: -1,
+ activeParam: []
+ })
+ } else {
+ this.setData({
activeIndex,
activeParam: secondCateList[activeIndex].valueVos
})
}
- console.log('activeParam', this.data.activeParam);
- // this.setData({showTwo: false})
},
cancelParam() {
- const { secondCateList } = this.data
- secondCateList.forEach(item => {
+ const {
+ secondCateList
+ } = this.data
+ secondCateList.forEach(item => {
item.tempParamIndex = item.paramIndex
- item.tempParamName = item.paramName
- item.tempParamCode = item.paramCode
+ item.tempParamName = item.paramName
+ item.tempParamCode = item.paramCode
+ item.relLabel = null
+ item.openRelLabel = false
+ item.tempParamRelIndex = null
+ item.tempParamRelCode = null
+ item.tempParamRelName = null
})
// this.setData({ tagCodes: [], activeParam: [], secondCateList, activeIndex: -1 })
- this.setData({ activeParam: [],activeIndex: -1 ,secondCateList})
+ this.setData({
+ activeParam: [],
+ activeIndex: -1,
+ secondCateList
+ })
},
subParam() {
- const { secondCateList } = this.data
+ const {
+ secondCateList
+ } = this.data
var codes = []
secondCateList.forEach(item => {
- item.paramIndex = item.tempParamIndex
- item.paramName = item.tempParamName
+ item.paramIndex = item.tempParamIndex
+ item.paramName = item.tempParamName
item.paramCode = item.tempParamCode
- if( item.paramIndex>-1 && item.tempParamCode){
- codes.push( item.tempParamCode)
- }
- })
- this.setData({tagCodes:codes})
- this.setData({ pageNum: 1, activeParam: [] ,activeIndex: -1, datalist: [], total: 0 })
+ item.openRelLabel = false
+ if(item.tempParamRelIndex > -1 && item.tempParamRelCode){
+ return codes.push(item.tempParamRelCode)
+ }
+ if (item.paramIndex > -1 && item.tempParamCode) {
+ codes.push(item.paramCode)
+ }
+ })
+ this.setData({
+ tagCodes: codes
+ })
+ this.setData({
+ pageNum: 1,
+ activeParam: [],
+ activeIndex: -1,
+ datalist: [],
+ total: 0
+ })
this.getList()
},
}
-})
+})
\ No newline at end of file
diff --git a/wechat_staff/components/disProduct/index.wxml b/wechat_staff/components/disProduct/index.wxml
index 0484dc6..5a467dd 100644
--- a/wechat_staff/components/disProduct/index.wxml
+++ b/wechat_staff/components/disProduct/index.wxml
@@ -15,15 +15,21 @@
<view class="main_right">
<scroll-view class="query_wrap_scroll" scroll-x>
<view class="query_wrap">
- <view data-index="{{index}}" wx:for="{{ secondCateList }}" class="item" bindtap="changeShowParams">
- <view class="name">{{ item.tempParamName || item.labelName }}</view>
- <van-icon name="{{ index == activeIndex ? 'arrow-up' : 'arrow-down' }}" />
- </view>
+ <block wx:for="{{ secondCateList }}">
+ <view class="item" data-index="{{index}}" bindtap="changeShowParams">
+ <view class="name">{{ item.tempParamName || item.labelName }}</view>
+ <van-icon name="{{ index == activeIndex && !item.openRelLabel && activeParam.length > 0 ? 'arrow-up' : 'arrow-down' }}" />
+ </view>
+ <view wx:if="{{item.relLabel && item.relLabel.labelCode}}" data-type="child" data-index="{{index}}" class="item" bindtap="changeShowParams">
+ <view class="name">{{ item.tempParamRelName || item.relLabel.labelName }}</view>
+ <van-icon name="{{ index == activeIndex && item.openRelLabel && activeParam.length > 0? 'arrow-up' : 'arrow-down' }}" />
+ </view>
+ </block>
</view>
</scroll-view>
<view wx:if="{{ activeParam.length > 0 }}" class="query_form">
<view class="list">
- <view data-index="{{index}}" data-code="{{ item.labelValueCode }}" bindtap="tagClick" wx:for="{{ activeParam }}" class="item {{ secondCateList[activeIndex].tempParamIndex === index ? 'active' : '' }}">{{ item.labelValueName }}</view>
+ <view data-index="{{index}}" data-code="{{ item.labelValueCode }}" bindtap="tagClick" wx:for="{{ activeParam }}" class="item {{ (!secondCateList[activeIndex].openRelLabel && secondCateList[activeIndex].tempParamIndex === index) || (secondCateList[activeIndex].openRelLabel && secondCateList[activeIndex].tempParamRelIndex === index) ? 'active' : '' }}">{{ item.labelValueName }}</view>
</view>
<view class="btns">
<view class="btn" bindtap="cancelParam">鍙栨秷</view>
diff --git a/wechat_staff/pages/detailDis/product.js b/wechat_staff/pages/detailDis/product.js
index ca16234..7ffee42 100644
--- a/wechat_staff/pages/detailDis/product.js
+++ b/wechat_staff/pages/detailDis/product.js
@@ -14,6 +14,7 @@
current: 0,
id: '',
info: {},
+ spaceList: [],
member: {},
showShare: false,
isFold: false,
@@ -102,6 +103,7 @@
this.setData({ current: e.detail.current })
},
priviewSpace(e) {
+ return
const url = e.currentTarget.dataset.url
const {
info
@@ -121,6 +123,7 @@
}).then(res => {
const index = enjoyList.findIndex( i =>(res.data && i.id === res.data.id) )
this.setData({
+ spaceList: res.data.spaceList || [],
info: {
...res.data,
isEnjoy: index > -1
diff --git a/wechat_staff/pages/detailDis/product.wxml b/wechat_staff/pages/detailDis/product.wxml
index 1c26f22..74f8ce9 100644
--- a/wechat_staff/pages/detailDis/product.wxml
+++ b/wechat_staff/pages/detailDis/product.wxml
@@ -46,10 +46,10 @@
<mp-html content="{{info.content}}"></mp-html>
</view>
<view class="spaceList">
- <view data-url="{{ item.spaceImg }}" bindtap="priviewSpace" class="item" wx:for="{{ info.spaceList }}">
+ <view data-url="{{ item.spaceImg }}" bindtap="priviewSpace" class="item" wx:for="{{ spaceList }}">
<!-- <view class="name">{{ item.spaceName }}</view> -->
- <image src="{{ item.spaceImg }}" mode="widthFix" class="img"></image>
- <!-- <mp-html content="{{item.spaceContent}}"></mp-html> -->
+ <!-- <image src="{{ item.spaceImg }}" mode="widthFix" class="img"></image> -->
+ <mp-html content="{{item.spaceContent}}"></mp-html>
</view>
</view>
</view>
\ No newline at end of file
diff --git a/wechat_staff/pages/download/index.js b/wechat_staff/pages/download/index.js
index 2c3d458..b840751 100644
--- a/wechat_staff/pages/download/index.js
+++ b/wechat_staff/pages/download/index.js
@@ -121,6 +121,10 @@
}
},
fail(err) {
+ item.paddingStatus = 4
+ that.setData({
+ downloadList
+ })
wx.showToast({
title: '鍥剧墖涓嬭浇澶辫触',icon: 'none'
})
diff --git a/wechat_staff/pages/kefu/fond.js b/wechat_staff/pages/kefu/fond.js
index 3218f5a..904baa0 100644
--- a/wechat_staff/pages/kefu/fond.js
+++ b/wechat_staff/pages/kefu/fond.js
@@ -16,7 +16,7 @@
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
*/
- onLoad(options) {
+ onShow(options) {
var app = getApp().globalData
this.setData({
bottomLift: app.bottomLift
diff --git a/wechat_staff/pages/kefu/select.js b/wechat_staff/pages/kefu/select.js
index 9fcf601..9877240 100644
--- a/wechat_staff/pages/kefu/select.js
+++ b/wechat_staff/pages/kefu/select.js
@@ -41,8 +41,12 @@
customer
} = this.data
const enjoyList = wx.getStorageSync('enjoyList') || []
- if (!customer.customerId) return wx.showToast({
+ if (!customer.platSourceId) return wx.showToast({
title: '璇峰厛閫夋嫨瑕佸叧鑱旂殑瀹㈡埛',
+ icon: 'none'
+ })
+ if(enjoyList.filter(i => i.checked).length == 0) return wx.showToast({
+ title: '璇烽噸鏂伴�夋嫨瑕佸叧鑱旂殑鐨勪骇鍝�',
icon: 'none'
})
batchAddLike({
@@ -58,12 +62,15 @@
icon: 'none'
})
}, 500)
+ const temp = enjoyList.filter(i => !i.checked)
+ wx.setStorageSync('enjoyList', temp)
this.setData({
customer: {},
total: 0,
dataList: [],
page: 1
})
+ wx.navigateBack()
this.getList()
}else{
return wx.showToast({
diff --git a/wechat_staff/pages/kefu/select.less b/wechat_staff/pages/kefu/select.less
index 1c6837e..a7534d3 100644
--- a/wechat_staff/pages/kefu/select.less
+++ b/wechat_staff/pages/kefu/select.less
@@ -55,12 +55,14 @@
}
.icon{
width: 28rpx;
+ height: 28rpx;
margin-top: 4rpx;
margin-right: 14rpx;
}
}
.kehu{
width: 48rpx;
+ height: 48rpx;
margin-left: 30rpx;
}
}
diff --git a/wechat_staff/pages/kefu/select.wxml b/wechat_staff/pages/kefu/select.wxml
index f9fcf70..9cc9877 100644
--- a/wechat_staff/pages/kefu/select.wxml
+++ b/wechat_staff/pages/kefu/select.wxml
@@ -12,10 +12,10 @@
<!-- -->
<view class="search_wrap">
<view class="input_wrap">
- <image class="icon" src="../../static/icon/ic_search@2x.png" mode="widthFix"></image>
+ <image class="icon" src="../../static/icon/ic_search@2x.png"></image>
<input model:value="{{keyWords}}" bindblur="reloadList" type="text" placeholder="鎼滅储瀹㈡埛鏄电О銆佸璐�佸娉ㄥ悕" />
</view>
- <image bindtap="jumpClient" class="kehu" src="../../static/icon/kehu_ic_new@2x.png" mode="widthFix"></image>
+ <image bindtap="jumpClient" class="kehu" src="../../static/icon/kehu_ic_new@2x.png"></image>
</view>
<!-- -->
<scroll-view bindscrolltolower="scrolltolower" scroll-y enable-passive enable-flex class="list">
diff --git a/wechat_staff/pages/kefu/select.wxss b/wechat_staff/pages/kefu/select.wxss
index a6f2ead..f065745 100644
--- a/wechat_staff/pages/kefu/select.wxss
+++ b/wechat_staff/pages/kefu/select.wxss
@@ -56,11 +56,13 @@
}
.search_wrap .input_wrap .icon {
width: 28rpx;
+ height: 28rpx;
margin-top: 4rpx;
margin-right: 14rpx;
}
.search_wrap .kehu {
width: 48rpx;
+ height: 48rpx;
margin-left: 30rpx;
}
.list {
diff --git a/wechat_staff/pages/login/index.less b/wechat_staff/pages/login/index.less
index 225cc23..f485360 100644
--- a/wechat_staff/pages/login/index.less
+++ b/wechat_staff/pages/login/index.less
@@ -101,4 +101,13 @@
color: #fff;
}
}
+}
+.tip{
+ position: fixed;
+ bottom: 108rpx;
+ left: 0;
+ width: 100%;
+ text-align: center;
+ font-size: 26rpx;
+ color: #666666;
}
\ No newline at end of file
diff --git a/wechat_staff/pages/login/index.wxml b/wechat_staff/pages/login/index.wxml
index 78c244f..6b4c706 100644
--- a/wechat_staff/pages/login/index.wxml
+++ b/wechat_staff/pages/login/index.wxml
@@ -45,4 +45,6 @@
</view>
</view>
</van-popup>
+ <!-- -->
+ <view class="tip">鏈皬绋嬪簭鍔熻兘浠呴檺浜庡織閭﹀灞呭強缁忛攢鍟嗗憳宸ヤ娇鐢�</view>
</view>
\ No newline at end of file
diff --git a/wechat_staff/pages/login/index.wxss b/wechat_staff/pages/login/index.wxss
index f68f586..164a697 100644
--- a/wechat_staff/pages/login/index.wxss
+++ b/wechat_staff/pages/login/index.wxss
@@ -102,3 +102,12 @@
justify-content: center;
color: #fff;
}
+.tip {
+ position: fixed;
+ bottom: 108rpx;
+ left: 0;
+ width: 100%;
+ text-align: center;
+ font-size: 26rpx;
+ color: #666666;
+}
diff --git a/wechat_staff/pages/promotion/index.js b/wechat_staff/pages/promotion/index.js
index abb2a7c..b7c2019 100644
--- a/wechat_staff/pages/promotion/index.js
+++ b/wechat_staff/pages/promotion/index.js
@@ -1,4 +1,7 @@
-import { newsPage,saveShareRecord } from '../../api/index'
+import {
+ newsPage,
+ saveShareRecord
+} from '../../api/index'
import moment from "moment";
Page({
@@ -19,23 +22,31 @@
this.getList()
},
getList() {
- newsPage({capacity:this.data.capacity,
- page:this.data.page,
- model:{type:0}})
- .then(res =>{
- wx.stopPullDownRefresh()
- if(this.data.page ==1){
- this.setData({list:[]})
+ newsPage({
+ capacity: this.data.capacity,
+ page: this.data.page,
+ model: {
+ type: 0
}
- if(this.data.page == res.data.page){
- res.data.records.forEach(element => {
- element.createDate = moment(element.createDate).format("yyyy/MM/DD")
+ })
+ .then(res => {
+ wx.stopPullDownRefresh()
+ if (this.data.page == 1) {
+ this.setData({
+ list: []
})
- this.setData({list: [...this.data.list, ...res.data.records || []],
- total:res.data.total})
- }
+ }
+ if (this.data.page == res.data.page) {
+ res.data.records.forEach(element => {
+ element.createDate = moment(element.createDate).format("yyyy/MM/DD")
+ })
+ this.setData({
+ list: [...this.data.list, ...res.data.records || []],
+ total: res.data.total
+ })
+ }
console.log(this.data)
- })
+ })
},
onReady() {
@@ -49,105 +60,70 @@
},
onReachBottom() {
console.log('瑙﹀簳浜嬩欢');
- const { total, list, page } = this.data
- if(total > list.length){
- this.setData({ page: page + 1 })
+ const {
+ total,
+ list,
+ page
+ } = this.data
+ if (total > list.length) {
+ this.setData({
+ page: page + 1
+ })
this.getList()
- }else{
+ } else {
wx.showToast({
title: '鏆傛棤鏇村鏁版嵁',
icon: 'none'
})
}
},
- downfile(e){
- const item = e.currentTarget.dataset.index;
+ downfile(e) {
+ const item = e.currentTarget.dataset.index;
saveShareRecord(item.id)
const files = []
- if(item.fileType ==1 && item.fileList && item.fileList.length && item.fileList[0].fileurlFull ){
+ if (item.fileType == 1 && item.fileList && item.fileList.length && item.fileList[0].fileurlFull) {
files.push(item.fileList[0].fileurlFull)
}
- if(item.fileType !=1 && item.fileList && item.fileList.length ){
- item.fileList.forEach(ee => {
- if(ee.fileurlFull){
- files.push(ee.fileurlFull)
- }
- })
+ if (item.fileType != 1 && item.fileList && item.fileList.length) {
+ item.fileList.forEach(ee => {
+ if (ee.fileurlFull) {
+ files.push(ee.fileurlFull)
+ }
+ })
}
- if(item.fileType ==1){
- this.downloadVideoFileDo(files,item.title)
- }else{
- this.downloadImageFileDo(files,item.title)
- }
+ if (item.fileType == 1) {
+ this.downloadVideoFileDo(files, item.title)
+ } else {
+ this.downloadImageFileDo(files, item.title)
+ }
},
- downloadImageFileDo(files,title){
+ downloadImageFileDo(files, title) {
wx.showLoading({
title: '姝e湪涓嬭浇',
+ mask: true
})
- let temp = 0;
- if(files.length){
- for(let i = 0;i<files.length;i++){
- let filePath = wx.env.USER_DATA_PATH + '/' + new Date().valueOf()+i + '.jpg' ;
+ let temp = 0;
+ let count = 0;
+ if (files.length) {
+ for (let i = 0; i < files.length; i++) {
+ let filePath = wx.env.USER_DATA_PATH + '/' + new Date().valueOf() + i + '.jpg';
wx.downloadFile({
url: files[i],
filePath: filePath,
- timeout:180000,
- success: function (res) {
+ timeout: 180000,
+ success: function (res) {
var tempFp = res.filePath
wx.saveImageToPhotosAlbum({
filePath: tempFp,
success(result) {
- temp ++;
- console.log(result)
- if(temp == files.length){
- wx.hideLoading();
- wx.setClipboardData({
- data: title,
- success: function (res) {
- wx.getClipboardData({
- success: function (res) {
- wx.showToast({
- title: '鏂囨宸插鍒舵垚鍔燂紝鍘诲垎浜惂'
- })
- }
- })
- }
- })
- }
- }, fail(err) {
- wx.showToast({
- title: '鍥剧墖涓嬭浇澶辫触鍝�'
- })
- }
- })
- } , fail(err) {
- wx.showToast({
- title: '鍥剧墖涓嬭浇澶辫触鍝�'
- })
- }
- })
- }
- }
- },
- downloadVideoFileDo(files,title){
- wx.showLoading({
- title: '姝e湪涓嬭浇',
- })
- if(files.length){
- let filePath = wx.env.USER_DATA_PATH + '/' + new Date().valueOf() + '0.mp4';
- wx.downloadFile({
- url: files[0],
- filePath: filePath,
- timeout:180000,
- success: function (res) {
- var tempFp = res.filePath
- wx.saveVideoToPhotosAlbum({
- filePath: tempFp,
- success(result) {
- console.log(result)
- wx.hideLoading();
+ temp++;
+ count++;
+ if (count == files.length) {
+ wx.hideLoading()
+ }
+ if (temp == files.length) {
wx.setClipboardData({
- data: title,
+ data: title,
success: function (res) {
wx.getClipboardData({
success: function (res) {
@@ -157,16 +133,99 @@
}
})
}
- })
- }, fail(err) {
+ })
+ }
+ },
+ fail(err) {
+ count++;
+ if (count == files.length) {
+ wx.hideLoading()
+ }
+ wx.showToast({
+ title: '鍥剧墖涓嬭浇澶辫触鍝�'
+ })
+ }
+ })
+ },
+ fail(err) {
+ count++;
+ if (count == files.length) {
+ wx.hideLoading()
+ }
+ wx.showToast({
+ title: '鍥剧墖涓嬭浇澶辫触鍝�'
+ })
+ }
+ })
+ }
+ }else{
+ wx.showToast({
+ title: '璇ヨ祫璁殏鏃犲彲鍒嗕韩鐨勫浘鐗囨垨瑙嗛',
+ icon: 'none'
+ })
+ }
+ },
+ downloadVideoFileDo(files, title) {
+ wx.showLoading({
+ title: '姝e湪涓嬭浇',
+ mask: true
+ })
+ let count = 0;
+ if (files.length) {
+ let filePath = wx.env.USER_DATA_PATH + '/' + new Date().valueOf() + '0.mp4';
+ wx.downloadFile({
+ url: files[0],
+ filePath: filePath,
+ timeout: 180000,
+ success: function (res) {
+ var tempFp = res.filePath
+ wx.saveVideoToPhotosAlbum({
+ filePath: tempFp,
+ success(result) {
+ count++;
+ if (count == files.length) {
+ wx.hideLoading()
+ }
+ wx.setClipboardData({
+ data: title,
+ success: function (res) {
+ wx.getClipboardData({
+ success: function (res) {
+ wx.showToast({
+ title: '鏂囨宸插鍒舵垚鍔燂紝鍘诲垎浜惂'
+ })
+ }
+ })
+ }
+ })
+ },
+ fail(err) {
+ count++;
+ if (count == files.length) {
+ wx.hideLoading()
+ }
wx.showToast({
title: '瑙嗛涓嬭浇澶辫触鍝�'
})
}
})
- }
- })
- }
+ },
+ fail(err) {
+ count++;
+ if (count == files.length) {
+ wx.hideLoading()
+ }
+ wx.showToast({
+ title: '瑙嗛涓嬭浇澶辫触鍝�'
+ })
+ }
+ })
+ }else{
+ wx.showToast({
+ title: '璇ヨ祫璁殏鏃犲彲鍒嗕韩鐨勫浘鐗囨垨瑙嗛',
+ icon: 'none'
+ })
+ }
},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌
@@ -186,11 +245,13 @@
* 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔
*/
onPullDownRefresh() {
- console.log('涓嬫媺鍒锋柊')
- this.setData({ page: 1 })
- this.getList()
+ console.log('涓嬫媺鍒锋柊')
+ this.setData({
+ page: 1
+ })
+ this.getList()
},
-
+
/**
* 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
*/
diff --git a/wechat_staff/pages/work/index.js b/wechat_staff/pages/work/index.js
index ef2a209..ef07618 100644
--- a/wechat_staff/pages/work/index.js
+++ b/wechat_staff/pages/work/index.js
@@ -1,38 +1,76 @@
-import { getDictData, getMemberInfo } from '../../api/index'
+import {
+ getDictData,
+ getMemberInfo
+} from '../../api/index'
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- topimg:'',
+ topimg: '',
clientHeight: 0,
- clientTop: 0,
+ clientTop: 0,
showCard: false,
- userInfo: {name:''}
+ userInfo: {
+ name: ''
+ }
},
onLoad(options) {
const res = wx.getMenuButtonBoundingClientRect()
- this.setData({clientHeight: res.height})
- this.setData({clientTop: res.top})
+ this.setData({
+ clientHeight: res.height
+ })
+ this.setData({
+ clientTop: res.top
+ })
},
onShow() {
this.initData()
},
+ subscribe: function () {
+ // 鏄剧ず鍔犺浇鎻愮ず
+ let that = this
+ wx.requestSubscribeMessage({
+ tmplIds: ['A_jEWoyl0Uu_l5J-zwlwx_FcbUirlsS6Peu4JW6a7Gc'],
+ success: (res) => {
+ if (res['A_jEWoyl0Uu_l5J-zwlwx_FcbUirlsS6Peu4JW6a7Gc'] === 'accept') {
+ that.submitClock();
+ } else if (res['A_jEWoyl0Uu_l5J-zwlwx_FcbUirlsS6Peu4JW6a7Gc'] === 'reject') {
+ // 鐢ㄦ埛鍘嗗彶鎿嶄綔鏈夎缃簡鎷掔粷 or 鍏抽棴浜嗚闃呮秷鎭殑涓伙紙鎬伙級寮�鍏筹紝瀵艰嚧鏃犳硶鎺ㄩ��
+ // console.log(res, '0 鎷掔粷 or 鍏抽棴浜嗚闃呮秷鎭殑涓伙紙鎬伙級寮�鍏�---');
+ } else {
+ wx.showToast({
+ title: '鎺堟潈璁㈤槄娑堟伅鏈夎',
+ icon: 'none'
+ });
+ }
+ },
+ fail: () => {
+ reject();
+ }
+ })
+ },
showQrcode() {
- this.setData({ showCard: true })
+ this.setData({
+ showCard: true
+ })
},
onClose() {
- this.setData({ showCard: false })
+ this.setData({
+ showCard: false
+ })
},
changePath(e) {
- const {userInfo} = this.data
+ const {
+ userInfo
+ } = this.data
// 椤甸潰璺宠浆
let temp = [
'/pages/userinfo/index',
'/pages/store/staff?userType=1',
'/pages/userinfo/collect',
- '/pages/store/index?shopId='+userInfo.departmentId,
+ '/pages/store/index?shopId=' + userInfo.departmentId,
'/pages/sets/index'
]
const index = e.currentTarget.dataset.index
@@ -44,18 +82,19 @@
getMemberInfo().then(res => {
this.setData({
userInfo: res.data
- })
- wx.setStorageSync('member',res.data)
- })
+ })
+ wx.setStorageSync('member', res.data)
+ })
getDictData({
code: 'WEIXIN_DEFAULT_IMGS',
label: 'STAFF_WORK_TOP_IMG'
}).then(res => {
- this.setData({ topimg: res.data.code })
+ this.setData({
+ topimg: res.data.code
+ })
})
},
- onReady() {
- },
+ onReady() {},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌
diff --git a/wechat_staff/pages/work/index.wxml b/wechat_staff/pages/work/index.wxml
index db266d2..0a75c06 100644
--- a/wechat_staff/pages/work/index.wxml
+++ b/wechat_staff/pages/work/index.wxml
@@ -35,6 +35,8 @@
<image class="icon" src="../../static/icon/mine_ic_ar.png" mode="widthFix"></image>
</view>
</view>
+ <!-- index.wxml -->
+ <!-- <button bindtap="subscribe">璁㈤槄娑堟伅</button> -->
</view>
<!-- 璇︽儏 -->
<van-popup show="{{ showCard }}" closeable round bind:close="onClose">
diff --git a/wechat_staff/project.private.config.json b/wechat_staff/project.private.config.json
index 8bd54e7..65cf939 100644
--- a/wechat_staff/project.private.config.json
+++ b/wechat_staff/project.private.config.json
@@ -2,7 +2,7 @@
"projectname": "wechat_staff",
"setting": {
"compileHotReLoad": true,
- "urlCheck": true
+ "urlCheck": false
},
"description": "椤圭洰绉佹湁閰嶇疆鏂囦欢銆傛鏂囦欢涓殑鍐呭灏嗚鐩� project.config.json 涓殑鐩稿悓瀛楁銆傞」鐩殑鏀瑰姩浼樺厛鍚屾鍒版鏂囦欢涓�傝瑙佹枃妗o細https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"condition": {
@@ -31,8 +31,8 @@
},
{
"name": "",
- "pathName": "pages/productVideo/index",
- "query": "id=1813372914895843329",
+ "pathName": "pages/detailDis/product",
+ "query": "id=1823671456940113921",
"launchMode": "default",
"scene": null
},
diff --git a/wechat_staff/utils/config.js b/wechat_staff/utils/config.js
index 1376c89..f224b25 100644
--- a/wechat_staff/utils/config.js
+++ b/wechat_staff/utils/config.js
@@ -1,8 +1,8 @@
-// export const baseUrl = 'http://192.168.0.135:10027'
+export const baseUrl = 'http://192.168.0.170:80'
// 娴嬭瘯鏈嶅姟鍣�
// export const baseUrl = 'https://dmdev.zhibang.com:8443/web_interface'
// 鐢熶骇鏈嶅姟鍣�
-export const baseUrl = 'https://zbyj.zbom.com/web_interface'
+// export const baseUrl = 'https://zbyj.zbom.com/web_interface'
// 鑵捐鍦板浘寮�鍙戣�� key
export const qqMapKey = 'HIDBZ-2QXL4-TAWUD-XET6Q-EKTJE-CCBSQ'
--
Gitblit v1.9.3