Commit 61bdc5f5 by 谢中龙

删除部分文件

parent bf5bcbe6
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<view class=""> <view class="">
<image <image
class="img" class="img"
src="./../../assets/imgs/7_1_0/icon.png" src="https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/icon.png"
mode="widthFix" mode="widthFix"
lazy-load="false" lazy-load="false"
binderror="" binderror=""
......
import WxCanvas from './wx-canvas';
import * as echarts from './echarts';
let ctx;
Component({
properties: {
canvasId: {
type: String,
value: 'ec-canvas'
},
ec: {
type: Object
}
},
data: {
},
ready: function () {
if (!this.data.ec) {
console.warn('组件需绑定 ec 变量,例:<ec-canvas id="mychart-dom-bar" '
+ 'canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas>');
return;
}
if (!this.data.ec.lazyLoad) {
this.init();
}
},
methods: {
init: function (callback) {
const version = wx.version.version.split('.').map(n => parseInt(n, 10));
const isValid = version[0] > 1 || (version[0] === 1 && version[1] > 9)
|| (version[0] === 1 && version[1] === 9 && version[2] >= 91);
if (!isValid) {
console.error('微信基础库版本过低,需大于等于 1.9.91。'
+ '参见:https://github.com/ecomfe/echarts-for-weixin'
+ '#%E5%BE%AE%E4%BF%A1%E7%89%88%E6%9C%AC%E8%A6%81%E6%B1%82');
return;
}
ctx = wx.createCanvasContext(this.data.canvasId, this);
const canvas = new WxCanvas(ctx, this.data.canvasId);
echarts.setCanvasCreator(() => {
return canvas;
});
var query = wx.createSelectorQuery().in(this);
query.select('.ec-canvas').boundingClientRect(res => {
if (typeof callback === 'function') {
this.chart = callback(canvas, res.width, res.height);
}
else if (this.data.ec && typeof this.data.ec.onInit === 'function') {
this.chart = this.data.ec.onInit(canvas, res.width, res.height);
}
else {
this.triggerEvent('init', {
canvas: canvas,
width: res.width,
height: res.height
});
}
}).exec();
},
canvasToTempFilePath(opt) {
if (!opt.canvasId) {
opt.canvasId = this.data.canvasId;
}
ctx.draw(true, () => {
wx.canvasToTempFilePath(opt, this);
});
},
touchStart(e) {
if (this.chart && e.touches.length > 0) {
var touch = e.touches[0];
var handler = this.chart.getZr().handler;
handler.dispatch('mousedown', {
zrX: touch.x,
zrY: touch.y
});
handler.dispatch('mousemove', {
zrX: touch.x,
zrY: touch.y
});
handler.processGesture(wrapTouch(e), 'start');
}
},
touchMove(e) {
if (this.chart && e.touches.length > 0) {
var touch = e.touches[0];
var handler = this.chart.getZr().handler;
handler.dispatch('mousemove', {
zrX: touch.x,
zrY: touch.y
});
handler.processGesture(wrapTouch(e), 'change');
}
},
touchEnd(e) {
if (this.chart) {
const touch = e.changedTouches ? e.changedTouches[0] : {};
var handler = this.chart.getZr().handler;
handler.dispatch('mouseup', {
zrX: touch.x,
zrY: touch.y
});
handler.dispatch('click', {
zrX: touch.x,
zrY: touch.y
});
handler.processGesture(wrapTouch(e), 'end');
}
}
}
});
function wrapTouch(event) {
for (let i = 0; i < event.touches.length; ++i) {
const touch = event.touches[i];
touch.offsetX = touch.x;
touch.offsetY = touch.y;
}
return event;
}
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<canvas class="ec-canvas" canvas-id="{{ canvasId }}"
bindinit="init"
bindtouchstart="{{ ec.disableTouch ? '' : 'touchStart' }}" bindtouchmove="{{ ec.disableTouch ? '' : 'touchMove' }}" bindtouchend="{{ ec.disableTouch ? '' : 'touchEnd' }}">
</canvas>
.ec-canvas {
width: 100%;
height: 100%;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
export default class WxCanvas {
constructor(ctx, canvasId) {
this.ctx = ctx;
this.canvasId = canvasId;
this.chart = null;
// this._initCanvas(zrender, ctx);
this._initStyle(ctx);
this._initEvent();
}
getContext(contextType) {
if (contextType === '2d') {
return this.ctx;
}
}
// canvasToTempFilePath(opt) {
// if (!opt.canvasId) {
// opt.canvasId = this.canvasId;
// }
// return wx.canvasToTempFilePath(opt, this);
// }
setChart(chart) {
this.chart = chart;
}
attachEvent () {
// noop
}
detachEvent() {
// noop
}
_initCanvas(zrender, ctx) {
zrender.util.getContext = function () {
return ctx;
};
zrender.util.$override('measureText', function (text, font) {
ctx.font = font || '12px sans-serif';
return ctx.measureText(text);
});
}
_initStyle(ctx) {
var styles = ['fillStyle', 'strokeStyle', 'globalAlpha',
'textAlign', 'textBaseAlign', 'shadow', 'lineWidth',
'lineCap', 'lineJoin', 'lineDash', 'miterLimit', 'fontSize'];
styles.forEach(style => {
Object.defineProperty(ctx, style, {
set: value => {
if (style !== 'fillStyle' && style !== 'strokeStyle'
|| value !== 'none' && value !== null
) {
ctx['set' + style.charAt(0).toUpperCase() + style.slice(1)](value);
}
}
});
});
ctx.createRadialGradient = () => {
return ctx.createCircularGradient(arguments);
};
}
_initEvent() {
this.event = {};
const eventNames = [{
wxName: 'touchStart',
ecName: 'mousedown'
}, {
wxName: 'touchMove',
ecName: 'mousemove'
}, {
wxName: 'touchEnd',
ecName: 'mouseup'
}, {
wxName: 'touchEnd',
ecName: 'click'
}];
eventNames.forEach(name => {
this.event[name.wxName] = e => {
const touch = e.touches[0];
this.chart.getZr().handler.dispatch(name.ecName, {
zrX: name.wxName === 'tap' ? touch.clientX : touch.x,
zrY: name.wxName === 'tap' ? touch.clientY : touch.y
});
};
});
}
}
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<view class="overdue-list clearflex"> <view class="overdue-list clearflex">
<view class="overdue-status">失效</view> <view class="overdue-status">失效</view>
<view class="pro-info"> <view class="pro-info">
<image class="pro-img" src="/assets/imgs/7_1_0/icon.png" mode="widthFix" /> <image class="pro-img" src="https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/icon.png" mode="widthFix" />
<view class="pro-right-info"> <view class="pro-right-info">
<view class="pro-name overdue-name">商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称</view> <view class="pro-name overdue-name">商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称</view>
<view class="pro-sku">规格</view> <view class="pro-sku">规格</view>
......
...@@ -14,7 +14,7 @@ wxService.page({ ...@@ -14,7 +14,7 @@ wxService.page({
imgHeight: 450, imgHeight: 450,
dialog: { dialog: {
show: false, show: false,
image: '../../assets/imgs/point/bgc.png', image: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/bgc.png',
content: '优惠券和积分流水', content: '优惠券和积分流水',
tip: '立即查看' tip: '立即查看'
}, },
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
/> />
</view> </view>
<view class="pro-info"> <view class="pro-info">
<image class="pro-img" src="{{item.skuImgUrl ? item.skuImgUrl: '/assets/imgs/7_1_0/icon.png'}}" mode="widthFix" /> <image class="pro-img" src="{{item.skuImgUrl ? item.skuImgUrl: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/icon.png'}}" mode="widthFix" />
<view class="pro-right-info"> <view class="pro-right-info">
<view class="pro-name">{{item.name}}</view> <view class="pro-name">{{item.name}}</view>
<view class="pro-sku">{{item.sku}}</view> <view class="pro-sku">{{item.sku}}</view>
......
// shoppingGuid/page/pages/achievement/achievement.js // shoppingGuid/page/pages/achievement/achievement.js
const wxService = require('../../../../utils/wxService') const wxService = require('../../../../utils/wxService');
const app = getApp();
import * as echarts from '../../../../ec-canvas/echarts';
wxService.page({ wxService.page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
filterBar: [
{ name: '本月', isActive: true, index: 0 },
{ name: '上月', isActive: false, index: 1 },
{ name: '3个月', isActive: false, index: 2 }
],
current : 0,
currentOrderData : {},
info : {}, info : {},
achievement : {},
ec: {
lazyLoad: true
}
}, },
//切换
onTapChangeFilter(e){
let index = e.currentTarget.dataset.index;
this.data.filterBar.forEach(item => {
item.isActive = false;
});
this.data.filterBar[index].isActive = true;
this.data.current = this.data.filterBar[index].index;
this.data.currentOrderData = this.data.achievement.monthAchievement[this.data.current];
this.setData({
filterBar: this.data.filterBar,
current : this.data.current,
currentOrderData: this.data.currentOrderData
});
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
let currentUserInfo = wx.getStorageSync('_baseUserInfo'); let currentUserInfo = wx.getStorageSync('guidBaseInfo');
let userInfo = wx.getStorageSync('_userInfo'); if (!currentUserInfo) { //未登录成功
wx.redirectTo({
url: '/shoppingGuid/page/pages/welcomGuider/welcomGuider',
});
return ;
}
let userInfo = wx.getStorageSync('guidInfo');
if (currentUserInfo.member) { if (currentUserInfo.member) {
if (!currentUserInfo.member.name) { if (!currentUserInfo.member.name) {
currentUserInfo.member.name = userInfo.nickName; currentUserInfo.member.name = userInfo.nickName;
} }
} }
console.log(currentUserInfo)
this.setData({ this.setData({
info: currentUserInfo info: currentUserInfo
}); });
//获取导购业绩
this.echartsComponnet = this.selectComponent('#barChart');
this.getGuidAchievement();
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
},
//初始化barchart
initBarChart(series){
this.echartsComponnet.init((canvas, width, height) => {
// 初始化图表
const Chart = echarts.init(canvas, null, {
width: width,
height: height
});
Chart.setOption(this.getOption(series));
// 注意这里一定要返回 chart 实例,否则会影响事件处理等
return Chart;
});
},
//获取optiosn
getOption(series){
var option = {
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
},
},
xAxis: {
type: 'category',
data: ['普通会员', '付费会员', '销售额'],
axisLine: {
lineStyle: {
color: '#dddddd'
}
},
axisLabel: {
color: '#666666'
}
},
yAxis: {
type: 'value',
axisLine: {
lineStyle: {
color: '#dddddd'
}
},
axisLabel: {
color: '#666666'
}
},
series: series
};
return option;
}, },
//获取导购业绩
getGuidAchievement(){
wxService.post('/marketing/shoppingguide/achievement').then(res => {
if(!res) return ;
this.data.currentOrderData = res.data.data.monthAchievement[this.data.current];
this.setData({
achievement: res.data.data,
currentOrderData: this.data.currentOrderData,
});
let obj = res.data.data;
console.log(obj)
let series = [
{
name: '本月',type: 'bar', color: 'rgba(0,145,255,0.2)', barWidth: '20',
data: [obj.memberRecruitAmountMonth, obj.plusMemberRecruitAmountMonth, obj.achievementMonth]
},
{
name: '累计',
type: 'bar',
barWidth: '20',
color: 'rgba(0, 145, 255, 1)',
data: [obj.memberRecruitAmountTotal, obj.plusMemberRecruitAmountTotal, obj.achievementTotal]
},
];
this.initBarChart(series);
});
},
}) })
\ No newline at end of file
{ {
"navigationBarTitleText": "业绩", "navigationBarTitleText": "业绩",
"usingComponents": { "usingComponents": {
"tab-bar": "../../../component/tabBar/tabBar" "tab-bar": "../../../component/tabBar/tabBar",
"ec-canvas": "../../../../ec-canvas/ec-canvas"
} }
} }
\ No newline at end of file
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
<!-- 今日排行 --> <!-- 今日排行 -->
<view class='today-top'> <view class='today-top'>
<view class='items'> <view class='items'>
<view class='number'>10</view> <view class='number'>{{achievement.rank}}</view>
<view>我的今日招募排名</view> <view>我的今日招募排名</view>
</view> </view>
<view class='items'> <view class='items'>
<view class='number2'>6</view> <view class='number2'>{{achievement.recruitAmountToday}}</view>
<view>今日招募</view> <view>今日招募</view>
</view> </view>
</view> </view>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<!-- 招募总量 --> <!-- 招募总量 -->
<view class='total'> <view class='total'>
<text>招募总量:</text> <text>招募总量:</text>
<text class='total-colors'>135</text> <text class='total-colors'>{{achievement.recruitTotal}}</text>
</view> </view>
<!-- b本月 --> <!-- b本月 -->
<view class='month'> <view class='month'>
...@@ -35,38 +35,49 @@ ...@@ -35,38 +35,49 @@
<view class='month-data'> <view class='month-data'>
<view class='data-item'> <view class='data-item'>
<text class='data-item-title'>本月业绩(元)</text> <text class='data-item-title'>本月业绩(元)</text>
<text class='data-item-number'>11356.59</text> <text class='data-item-number'>{{achievement.recruitTotal}}</text>
</view> </view>
<view class='data-item'> <view class='data-item'>
<text class='data-item-title'>本月新增会员</text> <text class='data-item-title'>本月新增会员</text>
<text class='data-item-number'>32</text> <text class='data-item-number'>{{achievement.recruitAmountMonth}}</text>
</view> </view>
<view class='data-item'> <view class='data-item'>
<text class='data-item-title'>本月新增订单</text> <text class='data-item-title'>本月新增订单</text>
<text class='data-item-number'>228</text> <text class='data-item-number'>{{achievement.orderAmount}}</text>
</view> </view>
</view> </view>
</view> </view>
<!-- 数据筛选 --> <!-- 数据筛选 -->
<view class='data-filter'> <view class='data-filter'>
<view class='data-filter-item active'>本月</view> <view class='data-filter-item {{item.isActive ? "active" : ""}}'
<view class='data-filter-item'>上月</view> wx:for="{{filterBar}}"
<view class='data-filter-item'>3个月</view> wx:key="filter"
bindtap='onTapChangeFilter'
data-index="{{idx}}"
wx:for-index="idx"
wx:for-item="item">{{item.name}}</view>
</view> </view>
<!-- 订单数据概览 --> <!-- 订单数据概览 -->
<view class='order-data'> <view class='order-data'>
<view class='order-data-title'>订单数据概览</view> <view class='order-data-title'>订单数据概览</view>
<view class='statistic-data'> <view class='statistic-data'>
<text>总销售额(¥)</text> <text>总销售额(¥)</text>
<text class='number'>342653.36</text> <text class='number'>{{currentOrderData.salesVolume}}</text>
</view> </view>
<view class='statistic-data'> <view class='statistic-data'>
<text>退货额(¥) </text> <text>退货额(¥) </text>
<text class='number'>234435</text> <text class='number'>{{currentOrderData.refundVolume}}</text>
</view> </view>
<view class='statistic-data'> <view class='statistic-data'>
<text>退款率</text> <text>退款率</text>
<text class='number'>6%</text> <text class='number'>{{currentOrderData.refundRate}}</text>
</view>
</view>
<!-- 柱状图 -->
<view class='chart-con'>
<view class='title'>会员数据概览</view>
<view class='chart'>
<ec-canvas id="barChart" canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas>
</view> </view>
</view> </view>
......
...@@ -210,4 +210,40 @@ view{ ...@@ -210,4 +210,40 @@ view{
} }
/* 图表 */ /* 图表 */
.chart-con{
width: 100%;
height: auto;
padding: 0 30rpx;
background: #ffffff;
font-size: 24rpx;
margin-bottom: 20rpx;
color: #333333;
padding-bottom: 20px;
}
.chart-con .title{
padding: 30rpx 20rpx;
font-size: 28rpx;
border-bottom: solid 1px #eeeeee;
}
.chart-con .chart{
width: 100%;
height: auto;
position: relative;
top: 0;
bottom: 0;
left: 0;
right: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
}
.chart ec-canvas{
width: 100%;
height: 500rpx;
}
\ No newline at end of file
// shoppingGuid/page/pages/couponQrcode/couponQrcode.js // shoppingGuid/page/pages/couponQrcode/couponQrcode.js
const wxService = require('../../../../utils/wxService') const wxService = require('../../../../utils/wxService')
import { Integer } from '../../../../utils/integerDigitalConvertion'
const app = getApp(); const app = getApp();
wxService.page({ wxService.page({
...@@ -31,24 +32,57 @@ wxService.page({ ...@@ -31,24 +32,57 @@ wxService.page({
onShow: function () { onShow: function () {
}, },
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
wx.removeStorageSync('_guidCouponInfo');
},
//获取小程序码 //获取小程序码
getMiniQrcode(id){ getMiniQrcode(id){
// subPackage / page / pages / scanCoupon / scanCoupon // subPackage / page / pages / scanCoupon / scanCoupon
let data = { let currentUserInfo = wx.getStorageSync('guidBaseInfo');
"autoColor": true, let memberId = currentUserInfo.memberId;
"page": 'pages/index/index', console.log(this.data.couponInfo)
"scene": 'id=' + id,
"width": 260 let content = {
title: this.data.couponInfo.couponName,
id: this.data.couponInfo.couponId,
url: this.data.couponInfo.imageBg
}
let tentacleInfo = {
content: JSON.stringify(content),
contentId: this.data.couponInfo.couponId,
contentType: app.globalData.contants.SHARE_TYPE.PRODUCT_DETAIL, //内容类型 STAFF_RECOMMAND
title: this.data.couponInfo.couponName, //标题
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
} }
wxService.post(`/marketing/quickMark/getAppQrCodePicture`, data).then(res => { wxService.getTentacleContent(tentacleInfo).then(res => {
const { result, data } = res.data if (res && res.id) {
if (result == 0) { let tentacleId = res.id;
this.setData({ let inner_id = Integer.digit(this.data.couponInfo.couponId, 10, 64);
qrcodeImg: app.globalData.imageUrl + data let inner_tentacleId = Integer.digit(tentacleId, 10, 64);
}); //生成二维码
let data = {
"autoColor": true,
"page": 'subPackage/page/pages/scanCoupon/scanCoupon',
"scene": '?i=' + inner_id + '&t=' + inner_tentacleId,
"width": 260
}
wxService.post(`/marketing/quickMark/getAppQrCodePicture`, data).then(res => {
const { result, data } = res.data
if (result == 0) {
this.setData({
qrcodeImg: app.globalData.imageUrl + data
});
}
})
} }
}) });
}, },
}) })
\ No newline at end of file
...@@ -5,15 +5,15 @@ ...@@ -5,15 +5,15 @@
<view class='coupon-item' style='background-image:url(https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/coupon_bg.png)'> <view class='coupon-item' style='background-image:url(https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/coupon_bg.png)'>
<view class='coupon-item-lf'> <view class='coupon-item-lf'>
<view class='coupon-price'> <view class='coupon-price'>
¥ <text>5</text> {{couponInfo.couponType != 2 ? '¥' : ''}} <text>{{couponInfo.price}}</text>
</view> </view>
<view>折扣券</view> <view>{{couponInfo.typeText}}</view>
</view> </view>
<view class='coupon-item-rg'> <view class='coupon-item-rg'>
<view class='coupon-title'>满10减5</view> <view class='coupon-title'>{{couponInfo.title}}</view>
<view class='op'> <view class='op'>
<view class='text-btn'> <view class='text-btn'>
<text class='theme-text-color'>数量:100</text> <text class='theme-text-color'>数量:{{couponInfo.stock}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<view class='qrcode-con'> <view class='qrcode-con'>
<view class='qrcode'> <view class='qrcode'>
<image src='{{qrcodeImg}}' mode='aspectFit'></image> <image src='{{qrcodeImg}}' mode='aspectFit'></image>
<view class='coupon-num'>优惠券码:1234564564759</view> <view class='coupon-num'>优惠券码:{{couponInfo.couponSetting.couponSettingId}}</view>
</view> </view>
</view> </view>
......
// shoppingGuid/page/pages/welcomGuider/welcomGuider.js // shoppingGuid/page/pages/welcomGuider/welcomGuider.js
Page({ const wxService = require('../../../../utils/wxService')
const app = getApp();
wxService.page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -15,52 +17,62 @@ Page({ ...@@ -15,52 +17,62 @@ Page({
}, },
/** //授权获取用户信息之后
* 生命周期函数--监听页面初次渲染完成 getGuidUserInfo(e){
*/ console.log(e)
onReady: function () { let userInfo = e.detail;
}, const currentEnv = wx.getStorageSync('_qyWeChat');
console.log(currentEnv)
/** //判断是在企业微信中登录
* 生命周期函数--监听页面显示 if (currentEnv) {
*/ wx.qy.login({
onShow: function () { success: res => {
let code = res.code;
let param = {
code: code,
wechatInfo: userInfo,
brandId: app.globalData.brandId,
};
console.log('调用企业微信登录接口参数----------', param)
wxService.post('/member/qiyeweixin/minaLogin', param).then(r => {
console.log(r)
wx.setStorageSync('guidInfo', userInfo);
let qiyeLoginUserInfo = r.data.data;
wx.setStorageSync('guidBaseInfo', qiyeLoginUserInfo);
wx.redirectTo({
url: '/shoppingGuid/page/pages/home/home',
});
})
},
fail: res => {
console.log('fail -----', res)
}
})
}
else {
//不是在企业微信内打开的 提示信息
wx.showToast({
title: '请在企业微信内打开!',
icon: 'none'
});
}
}, },
/** //进入商城
* 生命周期函数--监听页面隐藏 onTapToMall(e){
*/ wx.redirectTo({
onHide: function () { url: '/pages/userCenter/userCenter',
})
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面显示
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onShow: function () {
}, },
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
}) })
\ No newline at end of file
{ {
"navigationBarTitleText": "欢迎您,导购",
"usingComponents": {} "usingComponents": {}
} }
\ No newline at end of file
<!--shoppingGuid/page/pages/welcomGuider/welcomGuider.wxml--> <!--shoppingGuid/page/pages/welcomGuider/welcomGuider.wxml-->
<text>shoppingGuid/page/pages/welcomGuider/welcomGuider.wxml</text> <view class='login'>
<image src='https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/welcom.png' mode='widthFix'></image>
<button type='primary'
bindgetuserinfo="getGuidUserInfo"
open-type='getUserInfo'>
立即进入</button>
<button class='enter-mall' bindtap='onTapToMall'>进入商城</button>
</view>
/* shoppingGuid/page/pages/welcomGuider/welcomGuider.wxss */ /* shoppingGuid/page/pages/welcomGuider/welcomGuider.wxss */
\ No newline at end of file .login{
padding: 100rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.login image{
width: 160rpx;
margin-bottom: 200rpx;
}
.login button{
width: 300rpx;
font-size: 28rpx;
}
.enter-mall{
background: #ffffff;
color: #333333;
margin-top: 30rpx;
}
\ No newline at end of file
...@@ -96,9 +96,43 @@ wxService.page({ ...@@ -96,9 +96,43 @@ wxService.page({
onTapToSendConpon(e){ onTapToSendConpon(e){
let item = e.currentTarget.dataset.item; let item = e.currentTarget.dataset.item;
let id = item.id; let id = item.id;
// wx.navigateTo({ let content = {
// url: '/shoppingGuid/page/pages/selectUsers/selectUsers?id=' + id + '&type=coupon', title: item.couponName,
// }); id: item.couponId,
url: item.imageBg
}
let tentacleInfo = {
content: JSON.stringify(content),
contentId: item.couponId,
contentType: app.globalData.contants.SHARE_TYPE.PRODUCT_DETAIL, //内容类型 STAFF_RECOMMAND
title: item.couponName, //标题
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
}
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.id) {
let tentacleId = res.id;
let inner_id = Integer.digit(item.couponId, 10, 64);
let inner_tentacleId = Integer.digit(tentacleId, 10, 64);
var path = 'subPackage/page/pages/scanCoupon/scanCoupon' + '?i=' + inner_id + '&t=' + inner_tentacleId;
//打开企业微信通讯录选择会员
wx.qy.shareToExternalContact({
appid: app.globalData.appId,//小程序的appid
title: item.couponName, //小程序消息的title
imgUrl: item.imageBg,//小程序消息的封面图
page: path, //小程序消息打开后的路径
success: function (r) {
//todo:
wx.showToast({
title: '发送成功!'
});
},
fail: function (err) {
console.log('error---------------', err);
}
});
}
});
}, },
//立即推荐商品给用户 //立即推荐商品给用户
onTapToRecommandProduct(e){ onTapToRecommandProduct(e){
...@@ -117,41 +151,38 @@ wxService.page({ ...@@ -117,41 +151,38 @@ wxService.page({
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销 type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
} }
// wxService.getTentacleContent(tentacleInfo).then(res => { wxService.getTentacleContent(tentacleInfo).then(res => {
// if (res && res.id) { if (res && res.id) {
// let tentacleId = res.id; let tentacleId = res.id;
// let inner_id = Integer.digit(item.productId, 10, 64); let inner_id = Integer.digit(item.productId, 10, 64);
// let inner_tentacleId = Integer.digit(tentacleId, 10, 64); let inner_tentacleId = Integer.digit(tentacleId, 10, 64);
// var path = 'pages/productDetail/productDetail' + '?i=' + inner_id + '&t=' + inner_tentacleId; var path = 'pages/productDetail/productDetail' + '?i=' + inner_id + '&t=' + inner_tentacleId;
// //打开企业微信通讯录选择会员 //打开企业微信通讯录选择会员
// this.openQyContact(item,path); wx.qy.shareToExternalContact({
// } appid: app.globalData.appId,//小程序的appid
// }); title: item.productName, //小程序消息的title
imgUrl: item.productImgUrl,//小程序消息的封面图
page: path, //小程序消息打开后的路径
success: function (res) {
//todo:
wx.showToast({
title: '推荐成功!'
});
},
fail: function (err) {
console.log('error---------------', err);
}
});
}
});
// 先不管触点 测试调用企业微信接口 // 先不管触点 测试调用企业微信接口
let inner_id = Integer.digit(item.productId, 10, 64); // let inner_id = Integer.digit(item.productId, 10, 64);
var path = 'pages/productDetail/productDetail' + '?i=' + inner_id; // var path = 'pages/productDetail/productDetail' + '?i=' + inner_id;
this.openQyContact(item, path); // this.openQyContact(item, path);
}, },
//打開企業微信通訊錄
openQyContact(item,path){
//选择企业通讯录中的数据
wx.qy.shareToExternalContact({
appid: app.globalData.appId,//小程序的appid
title: item.productName, //小程序消息的title
imgUrl: item.productImgUrl,//小程序消息的封面图
page: path, //小程序消息打开后的路径
success: function (res) {
//todo:
},
fail: function (err) {
console.log('error---------------', err);
}
});
},
//去商城 //去商城
onTapToMall(){ onTapToMall(){
wx.redirectTo({ wx.redirectTo({
...@@ -256,14 +287,11 @@ wxService.page({ ...@@ -256,14 +287,11 @@ wxService.page({
}, },
//展示优惠券二维码 //展示优惠券二维码
onTapShowQrcode(e){ onTapShowQrcode(e){
console.log(e)
let item = e.currentTarget.dataset.item; let item = e.currentTarget.dataset.item;
wx.setStorageSync('_guidCouponInfo', item); wx.setStorageSync('_guidCouponInfo', item);
wx.navigateTo({ wx.navigateTo({
url: '/shoppingGuid/page/pages/couponQrcode/couponQrcode', url: '/shoppingGuid/page/pages/couponQrcode/couponQrcode',
}); });
}, },
/** /**
......
...@@ -20,6 +20,7 @@ const contants = { ...@@ -20,6 +20,7 @@ const contants = {
TRANSMIT: 16,// "转发统计" TRANSMIT: 16,// "转发统计"
ENJOY: 17,// "点赞统计" ENJOY: 17,// "点赞统计"
READ: 18, //"阅读统计" READ: 18, //"阅读统计"
STAFF_RECOMMAND : 19 , //员工推荐
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment