Commit 9c540730 by 张立顺

Merge branch 'develop' of 192.168.3.233:saas_plus/business-assistant into develop

2 parents 0dc48bb9 dba69ae0
......@@ -28,10 +28,10 @@ Component({
*/
data: {
formData: {
phone: '13714966184',
code: '8888',
account: 'admin',
password: '123456789'
phone: '',
code: '',
account: '',
password: ''
},
phoneReady: false,
countDown: null
......
import WxValidate from '../../utils/wxValidate'
import WxValidate from '../../utils/WxValidate.js'
Page({
/**
* 页面的初始数据
......
// packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.js
import wxqrcode from '~/utils/lib/wxqrcode'
Component({
/**
* 组件的属性列表
......@@ -94,6 +95,13 @@ Component({
this.setData({
orderObj: list
})
},
handleCopy(e) {
var { idx } = e.currentTarget.dataset
var currentItem = this.data.orderObj.activityList[idx]
console.log(currentItem)
// console.log(wxqrcode)
wxqrcode.createQrCodeImg(currentItem.activityUrl)
}
}
})
......@@ -12,7 +12,7 @@
<view class="box merchant" wx:for="{{orderObj.activityList}}" wx:key="index">
<view class="head">
<view class="text-hide head-title">{{item.activityName}}</view>
<view class="head-link" bindtap="handleCopy">复制活动链接</view>
<view class="head-link" bindtap="handleCopy" data-idx="{{index}}">复制活动链接</view>
</view>
<view class="content">
<view class="content-row" wx:for="{{merchantFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
......
......@@ -6,7 +6,7 @@ Component({
properties: {
formData: {
type: Object,
value: () => {}
value: () => { }
}
},
......@@ -45,6 +45,19 @@ Component({
* 组件的方法列表
*/
methods: {
// handleDetail() {
// wx.navigateToMiniProgram({
// appId: 'wx0ff4e01294eca299', //appid
// path: '/pages/web_view/web_view',//path
// extraData: { //参数
// foo: 'bar'
// },
// envVersion: 'develop', //开发版develop 开发版 trial 体验版 release 正式版
// success(res) {
// console.log('成功')
// // 打开成功
// }
// })
// }
}
})
......@@ -8,4 +8,6 @@
</view>
<view class="label">{{item.label}}</view>
</view>
</view>
\ No newline at end of file
</view>
<navigator target="miniProgram" open-type="navigate" app-id="wx570d9331f9ace0bd" version="release">查看订单详情
</navigator>
\ No newline at end of file
......@@ -2,7 +2,6 @@
// const navStyle = "background-color: transparent;";
const navStyle = "background-color: #fff";
import { senceData } from "~/pages/tab/index/constant/data";
import { reportData } from "~/api/index.js";
import { IMG_URL } from "~/utils/constantData.js";
import Draw from "~/utils/Draw.js";
import {createQrCodeApi} from '~/api/checkProduct.js'
......@@ -96,28 +95,6 @@ Page({
actNum,
activeNavIdx,
});
if (this.options?.shareOpenId) {
const WXUSERINFO = wx.$storage.get("wx_user_info"),
USERINFO = wx.$storage.get("userInfo"),
shareInfo = this.options;
reportData(
{
openId: WXUSERINFO.openId || "",
unionId: WXUSERINFO.unionId || "",
nickName: WXUSERINFO.nickName || "",
avatar: WXUSERINFO.avatarUrl || "",
phone: USERINFO.phone || "",
merchantId: shareInfo.merchantId || "",
shareOpenId: shareInfo.shareOpenId || "",
sharePhone: shareInfo.sharePhone || "",
productCode: shareInfo.productCode || "",
productDesc: shareInfo.productDesc || "",
},
1
);
// 禁用分享功能
wx.hideShareMenu();
}
},
// 分享按钮
handleClick(e) {
......@@ -292,4 +269,8 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage() {},
/**
* 浏览埋点
*/
onViewTrack:true
});
......@@ -13,7 +13,8 @@ Component({
properties: {
stickyTop: Number,
actNum: Number,
senceData: Object,
senceData: Object, //本地数据
apiData:Object, //后端接口数据
isShare: {
type: Boolean,
value: false,
......
......@@ -5,7 +5,13 @@ import { senceData } from "./constant/data";
// `${IMG_URL}index/car2.png`,
//本地图片路径
let IMG_URLLocal = "../../../images/";
import { productBysceneApi,unreadApi,pageApi,readApi,tagApi } from "~/api/index.js";
import {
productBysceneApi,
unreadApi,
pageApi,
readApi,
tagApi,
} from "~/api/index.js";
Page({
// behaviors: [kfMixin],
......@@ -165,8 +171,8 @@ Page({
isShow: false,
// 看线索部分
unreadClueCount: 0,
cluePageSize:10,
clueCurrentPage: 1
cluePageSize: 10,
clueCurrentPage: 1,
},
//引导图
......@@ -216,28 +222,57 @@ Page({
sessionId,
};
let first = true
let first = true;
this.setData({
tabIndx: e.detail,
});
//标记线索已读
if(e.detail == 0 && first ){
first = false
readApi(param)
if (e.detail == 0 && first) {
first = false;
readApi(param);
}
},
gotoApply(e) {
let {type,item} = e.currentTarget.dataset
console.log('type,item: ', type,item);
if(type == "active"){
//申请活动
wx.$router.go("packageOutput.openBusiness");
}else{
let { userInfo } = wx.$storage.get();
let pMerchantName = userInfo.subLoginUser.merchantName
let pMerchantId = userInfo.subLoginUser.merchantId;
let sceneActive;
switch (this.data.actNum) {
case 0:
sceneActive = 1.1;
break;
case 1:
sceneActive = 1.2;
break;
case 2:
sceneActive = 1.3;
break;
case 3:
sceneActive = 1.4;
break;
}
// let pMerchantId = userInfo.subLoginUser.merchantId
let { type, item } = e.currentTarget.dataset;
// console.log("type,item: ", type, item);
const params = {
merchantInfo: {
pMerchantId,
pMerchantName,
merchantId: item.visitList[0].merchantId,
merchantName: item.visitList[0].merchantName,
},
sceneActive,
// sceneCodeList: ['SC001', 'SC002','SC003','SC004']
};
if (type == "active") {
//申请活动
wx.$router.go("packageOutput.openBusiness", params);
} else {
//申请门店
wx.$router.go("apply");
}
// wx.$router.go('apply',1235)
},
getMore(e) {
console.log("显示更多数据");
......@@ -448,41 +483,41 @@ Page({
this.setData({
apiData: data,
});
this.compositionData(senceData,this.data.apiData)
this.getFirstSenceIndex()
this.compositionData(senceData, this.data.apiData);
this.getFirstSenceIndex();
}
});
// 看线索
this.getClueInit()
this.getClueInit();
},
//接口数据,本地数据对接
compositionData(localData, apiData) {
localData.forEach((item, index) => {
apiData.forEach((inner,idx)=>{
if(item.name == inner.stage){
item.sceneStatus = inner.sceneStatus
apiData.forEach((inner, idx) => {
if (item.name == inner.stage) {
item.sceneStatus = inner.sceneStatus;
item.productList.forEach((outChild,outIndex)=>{
inner.productList.forEach((innerChild,innerIndex)=>{
if(outChild.proName == innerChild.productName){
outChild.productStatus = innerChild.productStatus
item.productList.forEach((outChild, outIndex) => {
inner.productList.forEach((innerChild, innerIndex) => {
if (outChild.proName == innerChild.productName) {
outChild.productStatus = innerChild.productStatus;
}
})
})
});
});
}
})
})
});
});
// console.log('localData, apiData: ', localData);
this.setData({
senceData:localData
})
senceData: localData,
});
},
getFirstSenceIndex(param){
let actTndex = this.data.apiData.findIndex(item =>item.sceneStatus == 1)
getFirstSenceIndex(param) {
let actTndex = this.data.apiData.findIndex((item) => item.sceneStatus == 1);
// console.log('actTndex: ', actTndex);
this.setData({
actNum:actTndex
})
actNum: actTndex,
});
},
// 看线索相关
......@@ -493,8 +528,8 @@ Page({
this.prompt = this.selectComponent("#toast");
},
showToast: function (e) {
let {type,item} = e.currentTarget.dataset;
console.log('type,item: ', type,item);
let { type, item } = e.currentTarget.dataset;
console.log("type,item: ", type, item);
let tipObj = {};
if (item.starTag == 1) {
tipObj = {
......@@ -526,60 +561,60 @@ Page({
//发请求
let { sessionId } = wx.$storage.get();
let params = {
clueId:item.clueId,
sessionId
}
this.getTagApi(params)
clueId: item.clueId,
sessionId,
};
this.getTagApi(params);
},
filterTypeFn(e) {
let index = e.currentTarget.dataset.index;
let itemList = [];
let params = {
clueSource:'',
hasPhone:'',
starTag:''
}
clueSource: "",
hasPhone: "",
starTag: "",
};
console.log("index: ", index);
switch (index) {
case 0:
itemList = ["无","有"];
itemList = ["无", "有"];
break;
case 1:
itemList = ["否","是"];
itemList = ["否", "是"];
break;
case 2:
itemList = ["访客", "门店"]; //线索来源(1访客,2门店)
break;
case 3:
params = {
clueSource:'',
hasPhone:'',
starTag:''
}
clueSource: "",
hasPhone: "",
starTag: "",
};
break;
}
let _this = this;
wx.pro.showActionSheet({
itemList,
success(res) {
let num
if(index == 2){
num = res.tapIndex+1
}else{
num = res.tapIndex
let num;
if (index == 2) {
num = res.tapIndex + 1;
} else {
num = res.tapIndex;
}
switch (index) {
case 0:
params.hasPhone = num
params.hasPhone = num;
break;
case 1:
params.starTag = num
params.starTag = num;
break;
case 2:
params.clueSource = num
params.clueSource = num;
break;
}
_this.getPageApi(params)
_this.getPageApi(params);
},
fail(res) {
console.log(res.errMsg);
......@@ -588,10 +623,9 @@ Page({
console.log("res: ", res);
},
});
if(index == 3){
this.getPageApi(params)
if (index == 3) {
this.getPageApi(params);
}
},
// 打电话
phoneCallFn(e) {
......@@ -604,48 +638,48 @@ Page({
let { phone } = e.currentTarget.dataset;
wx.$api.setCopyData(phone);
},
getClueInit(param){
this.getUnreadApi(param)
this.getPageApi(param)
getClueInit(param) {
this.getUnreadApi(param);
this.getPageApi(param);
},
//未读消息
async getUnreadApi(param){
let {code,data} = await unreadApi(param)
if(code == 0){
this.setData({
unreadClueCount:data.unreadClueCount
})
async getUnreadApi(param) {
let { code, data } = await unreadApi(param);
if (code == 0) {
this.setData({
unreadClueCount: data.unreadClueCount,
});
}
},
//获取浏览线索数据列表
async getPageApi(param){
let {cluePageSize,clueCurrentPage} = this.data
async getPageApi(param) {
let { cluePageSize, clueCurrentPage } = this.data;
let params = {
...param,
pageSize:1000,
currentPage:clueCurrentPage
}
let {code,data} = await pageApi(params)
if(code == 0){
let arr = data.list.map(item=>{
if(item.visitList.length >5){
item.getMoreFlag = true
pageSize: 1000,
currentPage: clueCurrentPage,
};
let { code, data } = await pageApi(params);
if (code == 0) {
let arr = data.list.map((item) => {
if (item.visitList.length > 5) {
item.getMoreFlag = true;
}
return item
})
return item;
});
this.setData({
clueList: arr
})
clueList: arr,
});
}
},
//喜欢收藏功能
async getTagApi(param){
let res = await tagApi(param)
console.log('res: ', res);
this.getPageApi(param)
async getTagApi(param) {
let res = await tagApi(param);
console.log("res: ", res);
this.getPageApi(param);
},
onReachBottom(){
console.log("滑到底部了")
onReachBottom() {
console.log("滑到底部了");
},
/**
* 生命周期函数--监听页面显示
......
......@@ -22,7 +22,7 @@
</view>
</view>
</view>
<product stickyTop="{{headerHeight}}" actNum="{{actNum}}" senceData="{{senceData}}" bindsharehandle="sharehandle" />
<product stickyTop="{{headerHeight}}" actNum="{{actNum}}" senceData="{{senceData}}" apiData="{{apiData}}" bindsharehandle="sharehandle" />
</view>
<!-- 看线索内容 -->
<view class="clue" wx:if="{{tabIndx == 0 }}" hover-class="none" hover-stop-propagation="false">
......
......@@ -21,7 +21,7 @@ Component({
totalProfit: 0,
pageObj: {
currentPage: 1,
pageSize: 3
pageSize: 10
},
totalPages: -1,
list: []
......@@ -44,6 +44,14 @@ Component({
pMerchantId: userInfo.subLoginUser.merchantId
})
},
clientRefresh() {
this.getPMerchantInfo()
this.setData({
['pageObj.currentPage']: 1,
list: []
})
this.getClientApi()
},
getClientApi() {
this.getProfit()
this.getList()
......
......@@ -66,7 +66,7 @@ Page({
let merchantModule = this.selectComponent('#merchant')
// console.log('clientModule', clientModule)
// console.log()
clientModule.getClientApi && clientModule.getClientApi()
clientModule.getClientApi && clientModule.clientRefresh()
merchantModule.init && merchantModule.init()
}
let { isSuper, userInfo } = this.data
......
......@@ -5,7 +5,6 @@ import { IMG_URL } from '~/utils/constantData'
import { generateRoutList } from './wxOnAppRoute.js'
import { getNavigationBarTitleText } from '~/utils/cache/storageApi'
import { getUserInfo } from '~/utils/cache/userInfo'
import USERAPI from '~/api/usersApi/index'
class Router {
[_query] = {};
[_routeHooks] = [];
......@@ -13,10 +12,9 @@ class Router {
constructor(router) {
this[_routerList] = generateRoutList(router)
wx.onAppRoute &&
wx.onAppRoute(async e => {
wx.onAppRoute(e => {
let thisPage = this.getPageInstance()
if (thisPage) {
if(!thisPage.route.includes('login')) await USERAPI.getWXUserInfo()
thisPage.setData({ IMG_URL })
if(Object.keys(this[_query]).length) thisPage.options = this[_query]
this.setNavigationBarTitleText(thisPage)
......
......@@ -6,7 +6,7 @@ const target = ['ip', 'dev', 'uat', 'prod']
2测试
3生产
*/
const index = 1
const index = 2
const secretKey = {
ip: {},
dev: {
......
......@@ -6,11 +6,14 @@
* @param {*} noPageAuth 分享页面是否需要登录拦截
* @param {*} shareFun 分享页面
* @param {*} shareTrackData 分享埋点数据
* @param {*} onViewTrack 开启浏览埋点
* @returns
*/
import {
reportData
} from '~/api/index.js'
import USERAPI from '~/api/usersApi/index'
class Share {
constructor() {
console.log('---------------- 分享初始化 ----------------')
......@@ -31,6 +34,8 @@ class Share {
/**设置全局分享 */
pageLeaveProxy(page) {
const onLoad = page.onLoad,
that = this
if (page.onShareAppMessage) {
const that = this
page.onShareAppMessage = function () {
......@@ -78,6 +83,24 @@ class Share {
}
}
}
page.onLoad = async function () {
onLoad && onLoad.apply(this, arguments)
if (this.onViewTrack) {
const WXUSERINFO = await USERAPI.getWXUserInfo(),
{
USERINFO
} = that.getCommonData(),
shareInfo = this.options
if (shareInfo.shareOpenId) reportData({
openId: WXUSERINFO.openId || '',
unionId: WXUSERINFO.unionId || '',
nickName: WXUSERINFO.nickName || '',
avatar: WXUSERINFO.avatarUrl || '',
phone: USERINFO.phone || '',
...shareInfo
}, 1)
}
}
}
getCommonData() {
const WXUSERINFO = wx.$storage.get('wx_user_info'),
......@@ -111,8 +134,6 @@ class Share {
shareOpenId: WXUSERINFO.openId || '',
sharePhone: USERINFO.phone || '',
...shareTrackData
}).then(res => {
console.log(res)
})
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!