Commit f62751c6 by 谢中龙

优化功能

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