Commit f62751c6 by 谢中龙

优化功能

parent 8f2287e4
...@@ -11,8 +11,8 @@ Component({ ...@@ -11,8 +11,8 @@ Component({
type: String, type: String,
value: '' value: ''
}, },
cardExplain:{ //文案 cardExplain: { //文案
type: Array, type: String,
value: '' value: ''
}, },
productDesc: { // 产品描述 productDesc: { // 产品描述
...@@ -23,13 +23,9 @@ Component({ ...@@ -23,13 +23,9 @@ Component({
type: String, type: String,
value: '' value: ''
}, },
codeImg:{ codeImg: {
type: String, type: String,
value: '' value: ''
},
shareTitle : {
type : String,
value : ''
} }
}, },
/** /**
...@@ -49,13 +45,14 @@ Component({ ...@@ -49,13 +45,14 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
// 关闭modal // 关闭modal
closePoste(){ closePoste() {
this.setData({ this.setData({
showpost: false showpost: false
}) })
}, },
//下载产品图片 //下载产品图片
getAvaterInfo: function () { getAvaterInfo: function () {
wx.showLoading({ wx.showLoading({
...@@ -89,7 +86,7 @@ Component({ ...@@ -89,7 +86,7 @@ Component({
}) })
} }
}, },
fail : function(res){ fail: function (res) {
wx.hideLoading(); wx.hideLoading();
wx.showToast({ wx.showToast({
title: '产品图片下载失败!', title: '产品图片下载失败!',
...@@ -132,7 +129,7 @@ Component({ ...@@ -132,7 +129,7 @@ Component({
}) })
} }
}, },
fail: function(res){ fail: function (res) {
wx.hideLoading(); wx.hideLoading();
wx.showToast({ wx.showToast({
title: '二维码下载失败!', title: '二维码下载失败!',
...@@ -150,6 +147,7 @@ Component({ ...@@ -150,6 +147,7 @@ Component({
//canvas绘制分享海报 //canvas绘制分享海报
sharePosteCanvas: function (avaterSrc, codeSrc, imgInfo) { sharePosteCanvas: function (avaterSrc, codeSrc, imgInfo) {
wx.showLoading({ wx.showLoading({
title: '生成中...', title: '生成中...',
mask: true, mask: true,
...@@ -165,7 +163,7 @@ Component({ ...@@ -165,7 +163,7 @@ Component({
var left = rect.left; var left = rect.left;
ctx.setFillStyle('#fff'); ctx.setFillStyle('#fff');
ctx.fillRect(0, 0, rect.width, height); ctx.fillRect(0, 0, rect.width, height);
// console.log(that.data)
// 图片 // 图片
if (avaterSrc) { if (avaterSrc) {
if (imgInfo) { if (imgInfo) {
...@@ -176,30 +174,23 @@ Component({ ...@@ -176,30 +174,23 @@ Component({
ctx.setFillStyle('#d8d8d8'); ctx.setFillStyle('#d8d8d8');
ctx.setTextAlign('left'); ctx.setTextAlign('left');
} }
// 品牌头像 // 品牌头像
if (that.data.userAvatar) { if (that.data.userAvatar) {
// ctx.drawImage(that.data.userAvatar, 12, 290, 30, 30); ctx.drawImage(that.data.userAvatar, 12, 290, 40, 40);
}
//画一下分享商户名称
if (that.data.shareTitle){
ctx.setFontSize(14);
ctx.setFillStyle('#333333');
ctx.setTextAlign('left');
let shareTitle = `[${that.data.shareTitle}]`;
ctx.fillText(shareTitle, 12, 310);
} }
// title // title
if (that.data.productDesc){ if (that.data.productDesc) {
ctx.setFontSize(14); ctx.setFontSize(14);
ctx.setFillStyle('#666666'); ctx.setFillStyle('#333333');
ctx.setTextAlign('left'); ctx.setTextAlign('left');
//只显示15个字 //只显示15个字
let newStrArr = []; let newStrArr = [];
if (that.data.productDesc){ if (that.data.productDesc) {
let subTimes = Math.ceil(that.data.productDesc.length / 15); let subTimes = Math.ceil(that.data.productDesc.length / 9);
for (let i = 0; i < subTimes ; i ++){ for (let i = 0; i < subTimes; i++) {
let tempSubStr = that.data.productDesc.substr(i * 15, 15); let tempSubStr = that.data.productDesc.substr(i * 9, 9);
newStrArr.push(tempSubStr) newStrArr.push(tempSubStr)
} }
} }
...@@ -210,7 +201,7 @@ Component({ ...@@ -210,7 +201,7 @@ Component({
var test = ""; var test = "";
var empty = []; var empty = [];
for (var a = 0; a < rowPart.length; a++) { for (var a = 0; a < rowPart.length; a++) {
if (ctx.measureText(test).width < 220) { if (ctx.measureText(test).width < 200) {
// if (context.measureText(test).width < 220) { // if (context.measureText(test).width < 220) {
test += rowPart[a]; test += rowPart[a];
} }
...@@ -226,28 +217,27 @@ Component({ ...@@ -226,28 +217,27 @@ Component({
} }
for (var b = 0; b < newStrArr.length; b++) { for (var b = 0; b < newStrArr.length; b++) {
ctx.fillText(newStrArr[b], 12, 332 + b * 16); ctx.fillText(newStrArr[b], 61, 310 + b * 16);
} }
}else{ } else {
console.log(that.data.cardExplain)
let explain = JSON.parse(JSON.stringify(that.data.cardExplain)) let explain = JSON.parse(JSON.stringify(that.data.cardExplain))
if (explain[0]){ if (explain[0]) {
ctx.setFontSize(12); ctx.setFontSize(12);
ctx.setFillStyle('#666666'); ctx.setFillStyle('#333333');
ctx.setTextAlign('left'); ctx.setTextAlign('left');
ctx.fillText(explain[0], 12, 332); ctx.fillText(explain[0], 61, 300);
} }
if (explain[1]) { if (explain[1]) {
ctx.setFontSize(12); ctx.setFontSize(12);
ctx.setFillStyle('#666666'); ctx.setFillStyle('#333333');
ctx.setTextAlign('left'); ctx.setTextAlign('left');
ctx.fillText(explain[1], 12, 348); ctx.fillText(explain[1], 61, 314);
} }
// if (explain[2]) { // if (explain[2]) {
// ctx.setFontSize(12); // ctx.setFontSize(12);
// ctx.setFillStyle('#666666'); // ctx.setFillStyle('#333333');
// ctx.setTextAlign('left'); // ctx.setTextAlign('left');
// ctx.fillText(explain[2], 12, 364); // ctx.fillText(explain[2], 61, 326);
// } // }
} }
...@@ -266,10 +256,10 @@ Component({ ...@@ -266,10 +256,10 @@ Component({
// 绘制二维码 // 绘制二维码
if (codeSrc) { if (codeSrc) {
ctx.drawImage(codeSrc, 210, 290, 65, 65) ctx.drawImage(codeSrc, 195, 281, 61.5, 61.5)
ctx.setFontSize(10); ctx.setFontSize(10);
ctx.setFillStyle('#000'); ctx.setFillStyle('#000');
// ctx.fillText("微信扫码或长按保存图片", left + 165, imgheght + 110); // ctx.fillText("微信扫码或长按保存图片", left + 165, imgheght + 110);
} }
}).exec() }).exec()
...@@ -362,11 +352,11 @@ Component({ ...@@ -362,11 +352,11 @@ Component({
wx.getSystemInfo({ wx.getSystemInfo({
success(res2) { success(res2) {
var ratio = res.width / res.height; var ratio = res.width / res.height;
var imgHeight = 370; var imgHeight = 352.5;
that.setData({ that.setData({
imgHeight: imgHeight imgHeight: imgHeight
}) })
cb(imgHeight - 150); cb(imgHeight - 130);
} }
}) })
} }
...@@ -383,6 +373,6 @@ Component({ ...@@ -383,6 +373,6 @@ Component({
} }
}, },
}) })
\ No newline at end of file
...@@ -6,16 +6,16 @@ ...@@ -6,16 +6,16 @@
// 修改 BRANCH_ID 为对应的商户id // 修改 BRANCH_ID 为对应的商户id
// app.js 中brandId 修改为对应 // app.js 中brandId 修改为对应
const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
//仅生产环境时 配置 : //仅生产环境时 配置 :
//3001 3001 , wx313ec36b710125d4 //3001 3001 , wx313ec36b710125d4
//泰华 2006 , wx40fec8944623c8b3 //泰华 2006 , wx40fec8944623c8b3
//多多一上 2007 //多多一上 2007, wxf7bc302c51166dc0
//雪岛书屋 2008 //雪岛书屋 2008 wx207f8a95bbc9d3ab
//苏州邻里 2003 //苏州邻里 2003, wxe7770946f9d93d38
//2012 悦芙媞 wxfe14ebde4a6eea3d //2012 悦芙媞 wxfe14ebde4a6eea3d
//2010 热风 wxe6d270a3e399ade9 //2010 热风 wxe6d270a3e399ade9
const BRANCH_ID = 1002 const BRANCH_ID = 3001
const isMall = true const isMall = true
const needMock = '' // const needMock = '' //
...@@ -131,7 +131,7 @@ const prod_brand_config = { ...@@ -131,7 +131,7 @@ const prod_brand_config = {
orderingMustOpenCard: true, orderingMustOpenCard: true,
isOpenSelfMention: true, // 是否开启门店自提 isOpenSelfMention: true, // 是否开启门店自提
shareTitle: '泰华微商城', shareTitle: '泰华微商城',
logo: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/logo_head.png', logo: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/taihua_logo.png',
}, },
//多多一上 //多多一上
2007 : { 2007 : {
...@@ -146,7 +146,7 @@ const prod_brand_config = { ...@@ -146,7 +146,7 @@ const prod_brand_config = {
orderingMustOpenCard: false, orderingMustOpenCard: false,
isOpenSelfMention: false, // 是否开启门店自提 isOpenSelfMention: false, // 是否开启门店自提
shareTitle: '多多一上', shareTitle: '多多一上',
logo: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/logo_head.png', logo: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/duoduoyishang_logo.png',
}, },
//雪岛书屋 //雪岛书屋
2008 : { 2008 : {
...@@ -191,7 +191,7 @@ const prod_brand_config = { ...@@ -191,7 +191,7 @@ const prod_brand_config = {
orderingMustOpenCard: false, orderingMustOpenCard: false,
isOpenSelfMention: false, // 是否开启门店自提 isOpenSelfMention: false, // 是否开启门店自提
shareTitle: '热风微商城', shareTitle: '热风微商城',
logo: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/logo_head.png', logo: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/hotwind_logo.png',
}, },
//悦芙媞 //悦芙媞
2012 : { 2012 : {
...@@ -206,7 +206,7 @@ const prod_brand_config = { ...@@ -206,7 +206,7 @@ const prod_brand_config = {
orderingMustOpenCard: false, orderingMustOpenCard: false,
isOpenSelfMention: false, // 是否开启门店自提 isOpenSelfMention: false, // 是否开启门店自提
shareTitle: '悦芙媞微商城', shareTitle: '悦芙媞微商城',
logo: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/logo_head.png', logo: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/yufuti_logo.png',
} }
} }
......
...@@ -67,8 +67,9 @@ wxService.page({ ...@@ -67,8 +67,9 @@ wxService.page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
const { currentIndex } = this.data const { currentIndex } = this.data;
this.handleOrderStatus(this.options.orderStatus)
if (currentIndex == 5) { if (currentIndex == 5) {
this.getRefundList(this.data.pageNo, this.data.pageSize) this.getRefundList(this.data.pageNo, this.data.pageSize)
} else { } else {
...@@ -80,6 +81,21 @@ wxService.page({ ...@@ -80,6 +81,21 @@ wxService.page({
}) })
} }
}, },
//处理订单状态
handleOrderStatus(orderStatus){
if(orderStatus){
this.data.swiperItem.forEach(item => {
if (item.status == orderStatus){
this.data.currentIndex = item.type;
this.data.status = orderStatus;
}
});
this.setData({
currentIndex : this.data.currentIndex
});
}
},
// 确认收货 // 确认收货
handelConfirmReceipt(e) { handelConfirmReceipt(e) {
const { id } = e.currentTarget.dataset const { id } = e.currentTarget.dataset
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.8.2", "libVersion": "2.8.2",
"appid": "wxac09792264c49b5c", "appid": "wx313ec36b710125d4",
"projectname": "%E5%BE%AE%E5%95%86%E5%9F%8E", "projectname": "%E5%BE%AE%E5%95%86%E5%9F%8E",
"debugOptions": { "debugOptions": {
"hidedInDevtools": [] "hidedInDevtools": []
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
"scene": null "scene": null
}, },
{ {
"id": -1, "id": 20,
"name": "我的订单", "name": "我的订单",
"pathName": "pages/order/order", "pathName": "pages/order/order",
"query": "", "query": "",
...@@ -403,7 +403,7 @@ ...@@ -403,7 +403,7 @@
"id": 53, "id": 53,
"name": "会员详情", "name": "会员详情",
"pathName": "shoppingGuid/page/pages/userInfo/userInfo", "pathName": "shoppingGuid/page/pages/userInfo/userInfo",
"query": "id= 640930496804704256", "query": "id= 677585630707994624",
"scene": null "scene": null
}, },
{ {
......
...@@ -18,12 +18,16 @@ wxService.page({ ...@@ -18,12 +18,16 @@ wxService.page({
current : 1, current : 1,
currentOrderData : {}, currentOrderData : {},
avator: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/biaka_default_u_logo.png', avator: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/biaka_default_u_logo.png',
info : {}, info : {},
achievement : {}, achievement : {},
memberPreview : {}, memberPreview : {
rank : 0,
recruitAmountToday : 0,
recruitAmountMonth : 0,
recruitTotal : 0,
},
achivementType : 1,//1 个人 2门店 achivementType : 1,//1 个人 2门店
chartImg : '' chartImg : '',
}, },
//切换个人和门店 //切换个人和门店
...@@ -231,10 +235,17 @@ wxService.page({ ...@@ -231,10 +235,17 @@ wxService.page({
getGuidAchievementDay(){ getGuidAchievementDay(){
wxService.post('/marketing/shoppingguide/achievement/recruit').then(res => { wxService.post('/marketing/shoppingguide/achievement/recruit').then(res => {
if (!res) return; if (!res) return;
this.data.memberPreview = res.data.data; let obj = res.data.data ? res.data.data : null;
this.setData({ if(obj){
memberPreview: this.data.memberPreview this.data.memberPreview.rank = obj.rank;
}); this.data.memberPreview.recruitAmountMonth = obj.recruitAmountMonth;
this.data.memberPreview.recruitAmountToday = obj.recruitAmountToday;
this.data.memberPreview.recruitTotal = obj.recruitTotal;
this.setData({
memberPreview: this.data.memberPreview
});
}
}); });
}, },
}) })
\ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<view class='info-rg'> <view class='info-rg'>
<view class='my-name'>{{info.member.name}}</view> <view class='my-name'>{{info.member.name}}</view>
<view class='my-rank'> <view class='my-rank'>
<text wx:if="{{memberPreview.rank}}">今日我的招募排名 ,第 <label>{{memberPreview.rank}}</label> 位</text> <text wx:if="{{memberPreview.rank}}">今日我的招募排名 ,第 <text style="font-weight:550;">{{memberPreview.rank}}</text> 位</text>
<text wx:else>当前暂无您的排名信息</text> <text wx:else>当前暂无您的排名信息</text>
</view> </view>
</view> </view>
......
...@@ -87,7 +87,7 @@ wxService.page({ ...@@ -87,7 +87,7 @@ wxService.page({
//获取用户总消费额 //获取用户总消费额
getMemberTotalConsumeAmount(memberId){ getMemberTotalConsumeAmount(memberId){
wxService.get(`/sale/trade/tradeMemberCalcByMemberId?memberId=${memberId}`).then(res => { wxService.get(`/sale/trade/tradeMemberCalcByMemberId?memberId=${memberId}`).then(res => {
this.data.total.totalConsume = res.data.data.totalConsume ? res.data.data.totalConsume : 0; this.data.total.totalConsume = res.data.data.consumeTotal ? res.data.data.consumeTotal : 0;
this.setData({ this.setData({
total : this.data.total total : this.data.total
}); });
......
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