Commit d167bd8b by 谢中龙

优化功能

parent 67460242
...@@ -18,7 +18,7 @@ App({ ...@@ -18,7 +18,7 @@ App({
wx.setStorageSync('reLoginErr', false) wx.setStorageSync('reLoginErr', false)
try { try {
this.isFromQiyeConsoleIn(e); this.isFromQiyeConsoleIn(e);
this.checkForUpdate();
let res = wx.getSystemInfoSync(); // 获取当前运行环境 let res = wx.getSystemInfoSync(); // 获取当前运行环境
config.pixelRate = res.windowWidth / 750; config.pixelRate = res.windowWidth / 750;
config.platform = res.platform; config.platform = res.platform;
...@@ -83,6 +83,9 @@ App({ ...@@ -83,6 +83,9 @@ App({
}, },
onShow: function (options = {}) { onShow: function (options = {}) {
//检查是不是有更新
this.checkForUpdate();
const baseUserInfo = wx.getStorageSync('_baseUserInfo') const baseUserInfo = wx.getStorageSync('_baseUserInfo')
// 获取当前会员是否是体验者 // 获取当前会员是否是体验者
const { member } = baseUserInfo const { member } = baseUserInfo
......
...@@ -68,7 +68,7 @@ Component({ ...@@ -68,7 +68,7 @@ Component({
}, },
}, },
attached() { attached() {
console.log("isvip", this.data.isVip) // console.log("isvip", this.data.isVip)
const { imageUrl } = app.globalData const { imageUrl } = app.globalData
const { personData, isVip } = this.data const { personData, isVip } = this.data
this.setData({ this.setData({
...@@ -94,6 +94,7 @@ Component({ ...@@ -94,6 +94,7 @@ Component({
}, },
_userInfoChange(newVal, oldVal) { _userInfoChange(newVal, oldVal) {
if (newVal !== oldVal) { if (newVal !== oldVal) {
// console.log(newVal)
this.setData({ this.setData({
memberActivateStatus: newVal && newVal.memberActivateStatus || false, memberActivateStatus: newVal && newVal.memberActivateStatus || false,
memberCardNo: newVal && newVal.memberCardNo || '', memberCardNo: newVal && newVal.memberCardNo || '',
......
...@@ -57,6 +57,15 @@ const needMock = '' // ...@@ -57,6 +57,15 @@ const needMock = '' //
* contactUspluginId = a6ea55b56eb09ced8f9aeeaa14383b52 联系我插件id * contactUspluginId = a6ea55b56eb09ced8f9aeeaa14383b52 联系我插件id
*/ */
/**
* 多多一上 生产环境配置
* appId = wxf7bc302c51166dc0 //小程序 appId
* tunnel-token = //token 杨辰提供
* brandId= 2007 //商户Id
* contactUspluginId = 联系我插件id
*/
// appid_dev_wx wxc3b64b09b1d3dfc2 // appid_dev_wx wxc3b64b09b1d3dfc2
// appid_test_wx wx857ea77f4f7f4f34// wxac09792264c49b5c // 1002商城 // appid_test_wx wx857ea77f4f7f4f34// wxac09792264c49b5c // 1002商城
...@@ -121,6 +130,8 @@ const envInfo = (() => { ...@@ -121,6 +130,8 @@ const envInfo = (() => {
appId: appId[PROJECT_ENV], appId: appId[PROJECT_ENV],
brandId: 3001,// 1001 1002 3001 3002 //2711 711生产brandId, brandId: 3001,// 1001 1002 3001 3002 //2711 711生产brandId,
plusIsOpen : true, //是否开启plus plusIsOpen : true, //是否开启plus
contactUsPluginId: '766c50920993bf9c41c6c3d2761a2df5',
contactUsIsOpen : true,//是否开启联系我
} }
})() })()
......
...@@ -228,10 +228,11 @@ page{ ...@@ -228,10 +228,11 @@ page{
} }
.empty{ .empty{
color: #808080; color: #808080;
text-align: center;
width: 100%; width: 100%;
margin-top: 458rpx; margin-top: 350rpx;
display: flex;
flex-direction: column;
height: 320rpx;
} }
.empty-img{ .empty-img{
margin: 0 auto; margin: 0 auto;
......
...@@ -24,9 +24,6 @@ wxService.page({ ...@@ -24,9 +24,6 @@ wxService.page({
}) })
// 条形码 // 条形码
if(cardno){ if(cardno){
setTimeout(()=> {
wxbarcode.barcode('barcode', cardno, 600, 180);
}, 200)
this.getCouponDetail(cardno) this.getCouponDetail(cardno)
} }
}, },
...@@ -54,6 +51,12 @@ wxService.page({ ...@@ -54,6 +51,12 @@ wxService.page({
},()=> { },()=> {
wx.hideLoading() wx.hideLoading()
}) })
// 重新渲染条形码
wxbarcode.barcode('barcode', this.data.cardno, 600, 180);
setTimeout(() => {
wxbarcode.barcode('barcode', this.data.cardno, 600, 180);
}, 200)
} else { } else {
wx.hideLoading() wx.hideLoading()
wx.showToast({ wx.showToast({
......
...@@ -5,6 +5,22 @@ const utils = require('../../utils/util') ...@@ -5,6 +5,22 @@ const utils = require('../../utils/util')
const envInfo = require('../../config/index').envInfo const envInfo = require('../../config/index').envInfo
var wxbarcode = require('../../codeUtils/index.js'); var wxbarcode = require('../../codeUtils/index.js');
var count = 0; var count = 0;
const COLOR_OBJ = {
Color010: '#63B359',
Color020: '#2C9F67',
Color030: '#509FC9',
Color040: '#5885CF',
Color050: '#9062C0',
Color060: '#D09A45',
Color070: '#E4B138',
Color080: '#EE903C',
Color081: '#F08500',
Color082: '#A9D92D',
Color090: '#DD6549',
Color100: '#CC463D',
Color101: '#CF3E36',
Color102: '#5E6671',
}
wxService.page({ wxService.page({
/** /**
...@@ -33,6 +49,14 @@ wxService.page({ ...@@ -33,6 +49,14 @@ wxService.page({
} }
], ],
index: 0, index: 0,
cardStyle : {
bgColor : '',
bgUrl : ''
},
cardNoOffline : '',
qrCardNo : '',
membershipCardnoType: '1', ////1 舞象会员卡号 2 关联实卡号
codeType: '',//CODE_TYPE_QRCODE 二维码 //CODE_TYPE_BARCODE 条形码 ///CODE_TYPE_TEXT 仅展示卡号
}, },
bindPickerChange(e) { bindPickerChange(e) {
this.setData({ this.setData({
...@@ -44,10 +68,77 @@ wxService.page({ ...@@ -44,10 +68,77 @@ wxService.page({
*/ */
onLoad(options) { onLoad(options) {
wx.hideShareMenu(); wx.hideShareMenu();
const { memberCardNo, memberId } = wx.getStorageSync('_baseUserInfo') const { memberCardNo, memberId , member} = wx.getStorageSync('_baseUserInfo')
// if(memberCardNo){ // if(memberCardNo){
// } // }
if (member){
this.data.cardNoOffline = member.cardNoOffline;
}
},
//获取会员卡面设置
getMemberCardSetting(){
wxService.post(`/member/cardSetting/getByBrandId`).then(res => {
let obj = res.data.data ? res.data.data.cardStyle : {};
if (obj.backgroundPicUrl){
this.data.cardStyle.bgUrl = obj.backgroundPicUrl;
this.data.cardStyle.bgColor = '';
}
else if(obj.color){
this.data.cardStyle.bgUrl = '';
this.data.cardStyle.bgColor = COLOR_OBJ[obj.color];
}
else{
this.data.cardStyle.bgUrl = 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/711_08.png';
this.data.cardStyle.bgColor = '';
}
let tempObj = res.data.data ? res.data.data : {};
this.data.membershipCardnoType = tempObj.membershipCardnoType ? tempObj.membershipCardnoType : 1;
this.data.codeType = tempObj.codeType ? tempObj.codeType : 'CODE_TYPE_BARCODE';
// this.data.codeType = 'CODE_TYPE_TEXT';
// this.data.codeType = 'CODE_TYPE_QRCODE';
// this.data.codeType = 'CODE_TYPE_BARCODE';
if (this.data.membershipCardnoType == 1){
//舞象会员卡号
this.data.qrCardNo = this.data.memberCardNo;
}
else{
//三方实体卡
this.data.qrCardNo = this.data.cardNoOffline;
}
// this.data.qrCardNo = this.data.memberCardNo;
this.setData({
qrCardNo: this.data.qrCardNo,
membershipCardnoType: this.data.membershipCardnoType,
codeType: this.data.codeType,
cardStyle: this.data.cardStyle
},() => {
if (this.data.codeType == 'CODE_TYPE_QRCODE'){
this.generateQrcode();
}
else if (this.data.codeType == 'CODE_TYPE_BARCODE'){
this.generateBarCode();
}
});
})
},
//生成条形码
generateBarCode(){
wxbarcode.barcode('barcode', this.data.qrCardNo, 500, 120);
setTimeout(() => {
wxbarcode.barcode('barcode', this.data.qrCardNo, 500, 120);
}, 200);
},
//生成二维码
generateQrcode(){
wxbarcode.qrcode('qrcode', this.data.qrCardNo, 300, 300);
setTimeout(() => {
wxbarcode.qrcode('qrcode', this.data.qrCardNo, 300, 300);
}, 200);
}, },
//微信支付 //微信支付
onTapWxPay() { onTapWxPay() {
...@@ -159,15 +250,13 @@ wxService.page({ ...@@ -159,15 +250,13 @@ wxService.page({
data.member.sex = 2 data.member.sex = 2
} }
this.setData({ this.setData({
cardNoOffline: data.member.cardNoOffline,
memberInfo: data.member, memberInfo: data.member,
index: data.member.sex, index: data.member.sex,
date: data.member.birthday date: data.member.birthday
},() => {
this.getMemberCardSetting();
}) })
wxbarcode.barcode('barcode', this.data.memberCardNo, 500, 120);
setTimeout(() => {
wxbarcode.barcode('barcode', this.data.memberCardNo, 500, 120);
}, 200);
// this.setInternal(); // this.setInternal();
} }
}) })
......
<!--pages/userCenter.wxml--> <!--pages/userCenter.wxml-->
<view class='page-memberOfOwn'> <view class='page-memberOfOwn'>
<view class='own-content'> <view class='own-content'>
<view class='user-info'> <view class='user-info'
style='background-image:url({{cardStyle.bgUrl}});background-color:{{cardStyle.bgColor}}'
>
<view class="user-avatar"> <view class="user-avatar">
<open-data type="userAvatarUrl" /> <open-data type="userAvatarUrl" />
</view> </view>
...@@ -15,10 +17,21 @@ ...@@ -15,10 +17,21 @@
<image src='/assets/imgs/711_11.png' bindtap='handleGoWxCard' /> <image src='/assets/imgs/711_11.png' bindtap='handleGoWxCard' />
</view>--> </view>-->
</view> </view>
<view class='user-qr-code'> <!-- 条形码 -->
<view class='user-qr-code' wx:if="{{codeType == 'CODE_TYPE_BARCODE' && qrCardNo}}">
<canvas canvas-id="barcode" binderror="canvasIdErrorCallback" /> <canvas canvas-id="barcode" binderror="canvasIdErrorCallback" />
<view class='card-no'>{{qrCardNo}}</view>
<!-- <view class='wx-pay-code' bindtap="onTapWxPay">微信支付</view>--> <!-- <view class='wx-pay-code' bindtap="onTapWxPay">微信支付</view>-->
</view> </view>
<!-- 二维码 -->
<view class='u-qr-code' wx:if="{{codeType == 'CODE_TYPE_QRCODE' && qrCardNo}}">
<canvas canvas-id="qrcode" binderror="canvasIdErrorCallback" />
<view class='card-no'>{{qrCardNo}}</view>
</view>
<!-- 仅展示卡号 -->
<view class='u-qr-code' wx:if="{{codeType == 'CODE_TYPE_TEXT' && qrCardNo}}">
<label>{{qrCardNo}}</label>
</view>
</view> </view>
<view class="form-info"> <view class="form-info">
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<view class="bottom-fixed" style="padding-bottom:{{paddingBottom}}"></view> <view class="bottom-fixed" style="padding-bottom:{{paddingBottom}}"></view>
<share-benefit-modal show="{{shareBenefitModalShow}}" benefit-data="{{benefitData}}"/> <share-benefit-modal show="{{shareBenefitModalShow}}" benefit-data="{{benefitData}}"/>
<!-- 联系我 --> <!-- 联系我 -->
<view class="cell-me" wx:if="{{!isQiye}}"> <view class="cell-me" wx:if="{{!isQiye && contactUsIsOpen}}">
<cell <cell
bind:startmessage='startmessage' bind:startmessage='startmessage'
isMask="0" isMask="0"
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
buttonText="0" buttonText="0"
bubbleColor="cb3c3c" bubbleColor="cb3c3c"
bind:completemessage="completemessage" bind:completemessage="completemessage"
plugid='766c50920993bf9c41c6c3d2761a2df5' /> plugid='{{contactUsPluginId}}' />
</view> </view>
<!-- 联系我点击成功之后的回调 --> <!-- 联系我点击成功之后的回调 -->
......
...@@ -274,7 +274,7 @@ wxService.page({ ...@@ -274,7 +274,7 @@ wxService.page({
this.setData({ this.setData({
currHomePageId: data.page.pageId currHomePageId: data.page.pageId
}) })
// 段落 // 段落
const products = data.paragraphs const products = data.paragraphs
const filterResult = products.map((res, index) => { const filterResult = products.map((res, index) => {
...@@ -290,6 +290,7 @@ wxService.page({ ...@@ -290,6 +290,7 @@ wxService.page({
const renderData = render.next() const renderData = render.next()
this.data.renderPageOver = renderData.done this.data.renderPageOver = renderData.done
this.renderPageFunc({ products: renderData.value }) this.renderPageFunc({ products: renderData.value })
// this.renderPageFunc({ products: products })
//是否有tabbar 或 plus //是否有tabbar 或 plus
let tabbar = products.filter(item => item.type == 5); let tabbar = products.filter(item => item.type == 5);
let plus = products.filter(item => item.type == 9); let plus = products.filter(item => item.type == 9);
...@@ -309,10 +310,7 @@ wxService.page({ ...@@ -309,10 +310,7 @@ wxService.page({
paddingBottom: '40rpx' paddingBottom: '40rpx'
}) })
} }
} }
}).finally(() => { }).finally(() => {
wx.hideLoading(); wx.hideLoading();
}) })
...@@ -324,6 +322,7 @@ wxService.page({ ...@@ -324,6 +322,7 @@ wxService.page({
* @param now * @param now
*/ */
renderPageFunc({ products }) { renderPageFunc({ products }) {
this.data.pages = [];
// 9 plus(9/5-权重高) // 9 plus(9/5-权重高)
let newProducts = [...products] let newProducts = [...products]
let typeArr = [] let typeArr = []
...@@ -334,10 +333,7 @@ wxService.page({ ...@@ -334,10 +333,7 @@ wxService.page({
}) })
} }
// let productData = handlerDataOnPage.handlerArray(products)
let productData = handlerDataOnPage.handlerArray(newProducts) let productData = handlerDataOnPage.handlerArray(newProducts)
logger.log('productData.keysNum', productData.keysNum(), productData)
this.setData({ this.setData({
...productData ...productData
}, () => { }, () => {
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<view class="bottom-fixed" style="padding-bottom:{{paddingBottom}}"></view> <view class="bottom-fixed" style="padding-bottom:{{paddingBottom}}"></view>
<!--联系我 客服ID--> <!--联系我 客服ID-->
<!-- style='left:{{x}}px;top:{{y}}px' --> <!-- style='left:{{x}}px;top:{{y}}px' -->
<view class="cell-me" wx:if="{{!isQiye}}" > <view class="cell-me" wx:if="{{!isQiye && contactUsIsOpen}}" >
<cell <cell
bind:startmessage='startmessage' bind:startmessage='startmessage'
isMask="0" isMask="0"
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
buttonText="0" buttonText="0"
bubbleColor="cb3c3c" bubbleColor="cb3c3c"
bind:completemessage="completemessage" bind:completemessage="completemessage"
plugid='766c50920993bf9c41c6c3d2761a2df5' /> plugid='{{contactUsPluginId}}' />
<!-- 766c50920993bf9c41c6c3d2761a2df5 --> <!-- 766c50920993bf9c41c6c3d2761a2df5 -->
<!-- 泰华 a6ea55b56eb09ced8f9aeeaa14383b52 --> <!-- 泰华 a6ea55b56eb09ced8f9aeeaa14383b52 -->
</view> </view>
......
...@@ -19,7 +19,6 @@ wxService.page({ ...@@ -19,7 +19,6 @@ wxService.page({
*/ */
onLoad: function (options) { onLoad: function (options) {
let param = options.id; let param = options.id;
console.log(param)
if(param){ if(param){
this.getCurrentStoreId(); this.getCurrentStoreId();
this.data.couponId = param; this.data.couponId = param;
...@@ -51,8 +50,6 @@ wxService.page({ ...@@ -51,8 +50,6 @@ wxService.page({
//获取优惠券详情 //获取优惠券详情
getCouponDetail(){ getCouponDetail(){
wxService.post(`/coupon/coupon/get?cardNo=${this.data.couponId}`).then(res => { wxService.post(`/coupon/coupon/get?cardNo=${this.data.couponId}`).then(res => {
console.log('请求卡券详情接口cardNo----',this.data.couponId)
console.log('获取卡券结果----',res)
if(res){ if(res){
this.data.couponInfo = res.data.data ? res.data.data : {}; this.data.couponInfo = res.data.data ? res.data.data : {};
this.data.couponInfo.takeCouponBgimg = this.data.couponInfo.couponDetail.style.takeCouponBgimg; this.data.couponInfo.takeCouponBgimg = this.data.couponInfo.couponDetail.style.takeCouponBgimg;
...@@ -93,7 +90,6 @@ wxService.page({ ...@@ -93,7 +90,6 @@ wxService.page({
} else if (res.cancel) {} } else if (res.cancel) {}
} }
}) })
}, },
//核销优惠券 //核销优惠券
...@@ -101,26 +97,28 @@ wxService.page({ ...@@ -101,26 +97,28 @@ wxService.page({
wx.showLoading({ wx.showLoading({
title: '核销中..', title: '核销中..',
}); });
wxService.post(`/coupon/coupon/checkAndInvalid`,{ let param = {};
cardNo : this.data.couponId, param.cardNo = this.data.couponId;
useStoreId: this.data.useStoreId, param.useStoreId = this.data.useStoreId;
brandId: app.globalData.brandId param.brandId = app.globalData.brandId;
}).then(res => {
wxService.post(`/coupon/coupon/checkAndInvalid`, param).then(res => {
wx.hideLoading();
if(res){ if(res){
if (res.data.result == 0) { if (res.data.result == 0) {
wx.showToast({ wx.showToast({
title: '核销成功', title: '核销成功',
icon : 'success',
duration : 2000,
mask : true,
success : function(){
wx.navigateBack({
delta: 1
});
}
}); });
setTimeout(() => {
wx.navigateBack({
delta: 1
});
},500);
} }
} }
}).finally(() => {
wx.hideLoading();
}); });
} }
}); });
\ No newline at end of file
...@@ -219,7 +219,7 @@ wxService.page({ ...@@ -219,7 +219,7 @@ wxService.page({
let content = { let content = {
title: item.title, title: item.title,
id: id, id: id,
url: item.couponBg url: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/icon_get_coupon.png'
} }
let tentacleInfo = { let tentacleInfo = {
content: JSON.stringify(content), content: JSON.stringify(content),
...@@ -236,8 +236,8 @@ wxService.page({ ...@@ -236,8 +236,8 @@ wxService.page({
let inner_tentacleId = Integer.digit(tentacleId, 10, 64); let inner_tentacleId = Integer.digit(tentacleId, 10, 64);
var path = 'subPackage/page/pages/scanCoupon/scanCoupon' + '?i=' + inner_id + '&t=' + inner_tentacleId; var path = 'subPackage/page/pages/scanCoupon/scanCoupon' + '?i=' + inner_id + '&t=' + inner_tentacleId;
this.data.shareModel.title = item.title; this.data.shareModel.title = item.title;
this.data.shareModel.imageUrl = item.couponBg; this.data.shareModel.imageUrl = 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/icon_get_coupon.png';
this.data.shareModel.path = item.path; this.data.shareModel.path = path;
this.setData({ this.setData({
shareModel: this.data.shareModel, shareModel: this.data.shareModel,
showModal: true showModal: true
...@@ -258,7 +258,7 @@ wxService.page({ ...@@ -258,7 +258,7 @@ wxService.page({
let content = { let content = {
title: item.title, title: item.title,
id: item.id, id: item.id,
url: item.imageBg url: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/icon_get_coupon.png'
} }
let tentacleInfo = { let tentacleInfo = {
...@@ -279,7 +279,7 @@ wxService.page({ ...@@ -279,7 +279,7 @@ wxService.page({
wx.qy.shareToExternalContact({ wx.qy.shareToExternalContact({
appid: app.globalData.appId,//小程序的appid appid: app.globalData.appId,//小程序的appid
title: item.couponName, //小程序消息的title title: item.couponName, //小程序消息的title
imgUrl: item.imageBg,//小程序消息的封面图 imgUrl: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/icon_get_coupon.png',//小程序消息的封面图
page: path, //小程序消息打开后的路径 page: path, //小程序消息打开后的路径
success: function (r) { success: function (r) {
wx.showToast({ wx.showToast({
...@@ -431,6 +431,8 @@ wxService.page({ ...@@ -431,6 +431,8 @@ wxService.page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function (res) { onShareAppMessage: function (res) {
console.log(res)
console.log(this.data.shareModel)
if (res.from == 'button') { if (res.from == 'button') {
return { return {
title: this.data.shareModel.title, title: this.data.shareModel.title,
......
...@@ -35,7 +35,7 @@ wxService.page({ ...@@ -35,7 +35,7 @@ wxService.page({
onShow: function () { onShow: function () {
}, },
getTaskPage(pageSize, pageNo,current) { // 1 销售任务 2 招募任务 getTaskPage(pageSize, pageNo,current,refresh) { // 1 销售任务 2 招募任务
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
...@@ -69,11 +69,19 @@ wxService.page({ ...@@ -69,11 +69,19 @@ wxService.page({
} }
}) })
this.setData({ this.setData({
list: pageNo == 1? [...data.content]: [...this.data.list,...data.content], list: pageNo == 1 ? [...data.content]: [...this.data.list,...data.content],
totalPages: data.totalPages totalPages: data.totalPages
}) })
} }
} }
if(refresh){
wx.showToast({
title: '刷新成功',
});
wx.stopPullDownRefresh();
}
}) })
}, },
// 点击事件 // 点击事件
...@@ -130,7 +138,11 @@ wxService.page({ ...@@ -130,7 +138,11 @@ wxService.page({
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
this.data.pageSize = 10;
this.data.pageNo = 1;
this.data.list = [];
const { pageSize, pageNo, current } = this.data
this.getTaskPage(pageSize, pageNo, current,true)
}, },
/** /**
......
{ {
"navigationBarTitleText": "任务中心", "navigationBarTitleText": "任务中心",
"enablePullDownRefresh": true,
"usingComponents": { "usingComponents": {
"empty": "../../../../component/empty/empty"
} }
} }
\ No newline at end of file
...@@ -16,62 +16,66 @@ ...@@ -16,62 +16,66 @@
</view> </view>
<!-- list --> <!-- list -->
<view class='list' wx:if="{{current == 1}}"> <view wx:if="{{current == 1}}">
<view class='list-item' <view class='list' wx:if="{{list.length > 0}}">
wx:for="{{list}}" <view class='list-item'
wx:for-index="idx" wx:for="{{list}}"
wx:key="listItem" wx:for-index="idx"
bindtap='onTapToSaleTaskInfo' wx:key="listItem"
data-item="{{item}}" bindtap='onTapToSaleTaskInfo'
wx:for-item="item"> data-item="{{item}}"
<view class='status-bar'> wx:for-item="item">
<view class='status'> <view class='status-bar'>
已完成:<text>{{item.achieve}}</text> <view class='status'>
已完成:<text>{{item.achieve}}</text>
</view>
<view class='percent'>{{item.rate}}</view>
</view> </view>
<view class='percent'>{{item.rate}}</view> <view class='task-time'>
</view> <image src='/assets/imgs/shoppingGuide/kpi_task_time.png' mode='widthFix'></image>
<view class='task-time'> <text>{{item.task.startStr}}~{{item.task.endStr}}</text>
<image src='/assets/imgs/shoppingGuide/kpi_task_time.png' mode='widthFix'></image> </view>
<text>{{item.task.startStr}}~{{item.task.endStr}}</text> <view class='task-info'>
</view> <view class='lf'>
<view class='task-info'> <image src='/assets/imgs/shoppingGuide/kpi_task_name.png' mode='widthFix'></image>
<view class='lf'> <text>{{item.task.name}}</text>
<image src='/assets/imgs/shoppingGuide/kpi_task_name.png' mode='widthFix'></image> </view>
<text>{{item.task.name}}</text> <view class='rg'> 目标:{{item.task.target}} 元</view>
</view> </view>
<view class='rg'> 目标:{{item.task.target}} 元</view>
</view> </view>
</view> </view>
</view> <empty text="暂无进行中销售任务哦~" wx:else/>
</view>
<!-- 招募任务 --> <!-- 招募任务 -->
<view class='list' wx:if="{{current == 2}}"> <view wx:if="{{current == 2}}">
<view class='list-item' <view class='list' wx:if="{{list.length > 0}}">
wx:for="{{list}}" <view class='list-item'
wx:for-index="idx" wx:for="{{list}}"
wx:key="listItem" wx:for-index="idx"
bindtap='onTapToInviteTaskInfo' wx:key="listItem"
data-item="{{item}}" bindtap='onTapToInviteTaskInfo'
wx:for-item="item"> data-item="{{item}}"
<view class='status-bar'> wx:for-item="item">
<view class='status'> <view class='status-bar'>
已完成:<text>{{item.achieve}}</text> <view class='status'>
已完成:<text>{{item.achieve}}</text>
</view>
<view class='percent'>{{item.rate}}</view>
</view> </view>
<view class='percent'>{{item.rate}}</view> <view class='task-time'>
</view> <image src='/assets/imgs/shoppingGuide/kpi_task_time.png' mode='widthFix'></image>
<view class='task-time'> <text>{{item.task.startStr}}~{{item.task.endStr}}</text>
<image src='/assets/imgs/shoppingGuide/kpi_task_time.png' mode='widthFix'></image> </view>
<text>{{item.task.startStr}}~{{item.task.endStr}}</text> <view class='task-info'>
</view> <view class='lf'>
<view class='task-info'> <image src='/assets/imgs/shoppingGuide/kpi_task_name.png' mode='widthFix'></image>
<view class='lf'> <text>{{item.task.name}}</text>
<image src='/assets/imgs/shoppingGuide/kpi_task_name.png' mode='widthFix'></image> </view>
<text>{{item.task.name}}</text> <view class='rg'> 目标:{{item.task.target}} </view>
</view> </view>
<view class='rg'> 目标:{{item.task.target}} </view>
</view> </view>
</view> </view>
<empty text="暂无进行中招募任务哦~" wx:else/>
</view> </view>
</view> </view>
...@@ -91,8 +91,8 @@ wxService.page({ ...@@ -91,8 +91,8 @@ wxService.page({
let inner_tentacleId = Integer.digit(tentacleId, 10, 64); let inner_tentacleId = Integer.digit(tentacleId, 10, 64);
var path = 'subPackage/page/pages/scanCoupon/scanCoupon' + '?i=' + inner_id + '&t=' + inner_tentacleId; var path = 'subPackage/page/pages/scanCoupon/scanCoupon' + '?i=' + inner_id + '&t=' + inner_tentacleId;
this.data.shareCouponObj.title = item.title; this.data.shareCouponObj.title = item.title;
this.data.shareCouponObj.imageUrl = item.imageBg; this.data.shareCouponObj.imageUrl = 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/icon_get_coupon.png';
this.data.shareCouponObj.path = item.path; this.data.shareCouponObj.path = path;
this.setData({ this.setData({
shareCouponObj: this.data.shareCouponObj, shareCouponObj: this.data.shareCouponObj,
showShareModel : true showShareModel : true
...@@ -134,7 +134,7 @@ wxService.page({ ...@@ -134,7 +134,7 @@ wxService.page({
wx.qy.shareToExternalContact({ wx.qy.shareToExternalContact({
appid: app.globalData.appId,//小程序的appid appid: app.globalData.appId,//小程序的appid
title: item.couponName, //小程序消息的title title: item.couponName, //小程序消息的title
imgUrl: item.imageBg,//小程序消息的封面图 imgUrl: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/icon_get_coupon.png',//小程序消息的封面图
page: path, //小程序消息打开后的路径 page: path, //小程序消息打开后的路径
success: function (r) { success: function (r) {
wx.showToast({ wx.showToast({
......
...@@ -148,8 +148,8 @@ wxService.page({ ...@@ -148,8 +148,8 @@ wxService.page({
let inner_tentacleId = Integer.digit(tentacleId, 10, 64); let inner_tentacleId = Integer.digit(tentacleId, 10, 64);
var path = 'subPackage/page/pages/scanCoupon/scanCoupon' + '?i=' + inner_id + '&t=' + inner_tentacleId; var path = 'subPackage/page/pages/scanCoupon/scanCoupon' + '?i=' + inner_id + '&t=' + inner_tentacleId;
this.data.shareModel.title = item.title; this.data.shareModel.title = item.title;
this.data.shareModel.imageUrl = item.couponBg; this.data.shareModel.imageUrl = 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/icon_get_coupon.png';
this.data.shareModel.path = item.path; this.data.shareModel.path = path;
this.setData({ this.setData({
shareModel: this.data.shareModel, shareModel: this.data.shareModel,
showModal: true showModal: true
...@@ -192,7 +192,7 @@ wxService.page({ ...@@ -192,7 +192,7 @@ wxService.page({
wx.qy.shareToExternalContact({ wx.qy.shareToExternalContact({
appid: app.globalData.appId,//小程序的appid appid: app.globalData.appId,//小程序的appid
title: item.couponName, //小程序消息的title title: item.couponName, //小程序消息的title
imgUrl: item.imageBg,//小程序消息的封面图 imgUrl: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/icon_get_coupon.png',//小程序消息的封面图
page: path, //小程序消息打开后的路径 page: path, //小程序消息打开后的路径
success: function (r) { success: function (r) {
wx.showToast({ wx.showToast({
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
var app = getApp() var app = getApp()
const wxService = require('../../../../utils/wxService') const wxService = require('../../../../utils/wxService')
import { Integer } from '../../../../utils/integerDigitalConvertion' import { Integer } from '../../../../utils/integerDigitalConvertion'
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
wxService.page({ wxService.page({
...@@ -64,17 +63,18 @@ wxService.page({ ...@@ -64,17 +63,18 @@ wxService.page({
this.generatePointObject(tentacleInfo); this.generatePointObject(tentacleInfo);
} }
this.setData({
'form.sortType': this.data.currentTab
})
this.getProList();
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
this.setData({
'form.sortType': this.data.currentTab
})
this.getProList();
}, },
// 切换tab // 切换tab
...@@ -101,11 +101,13 @@ wxService.page({ ...@@ -101,11 +101,13 @@ wxService.page({
}, },
//获取商品列表 //获取商品列表
getProList() { getProList(refresh) {
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) });
wxService.post(`/sale/product/buyer/listPageByCategoryId?pageNo=${this.data.pageNo}&pageSize=${this.data.pageSize}`, this.data.form).then(res => { let pageNo = this.data.pageNo,
pageSize = this.data.pageSize;
wxService.post(`/sale/product/buyer/listPageByCategoryId?pageNo=${pageNo}&pageSize=${pageSize}`, this.data.form).then(res => {
const { result, data } = res.data const { result, data } = res.data
if (result == 0 && data.content) { if (result == 0 && data.content) {
wx.hideLoading() wx.hideLoading()
...@@ -115,6 +117,14 @@ wxService.page({ ...@@ -115,6 +117,14 @@ wxService.page({
totalElements: data.totalElements totalElements: data.totalElements
}) })
} }
if (refresh){
wx.showToast({
title: '数据已刷新',
});
wx.stopPullDownRefresh();
}
}).finally(() => { }).finally(() => {
wx.hideLoading() wx.hideLoading()
}) })
...@@ -128,28 +138,12 @@ wxService.page({ ...@@ -128,28 +138,12 @@ wxService.page({
}, },
/** /**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
this.setData({ this.data.pageNo = 1;
pageNo: 1, this.data.totalPages = 0;
}) this.getProList(true);
this.getProList()
wx.stopPullDownRefresh();
}, },
/** /**
......
{ {
"navigationBarTitleText": "商品列表", "navigationBarTitleText": "商品列表",
"enablePullDownRefresh": true,
"usingComponents": { "usingComponents": {
"product-list-style-one": "/component/productListStyleOne/productListStyleOne", "product-list-style-one": "/component/productListStyleOne/productListStyleOne",
"product-list-style-two": "/component/productListStyleTwo/productListStyleTwo", "product-list-style-two": "/component/productListStyleTwo/productListStyleTwo",
......
...@@ -82,8 +82,8 @@ class Http { ...@@ -82,8 +82,8 @@ class Http {
get (url, parmas) { get (url, parmas) {
let baseUserInfo = wx.getStorageSync('_baseUserInfo') let baseUserInfo = wx.getStorageSync('_baseUserInfo')
console.log(this.getTentacle()) let guideUserInfo = wx.getStorageSync('guidBaseInfo');
if(baseUserInfo){ if (baseUserInfo || guideUserInfo){
return this.request({ return this.request({
url, url,
method: 'GET', method: 'GET',
...@@ -196,7 +196,6 @@ class Http { ...@@ -196,7 +196,6 @@ class Http {
}) })
}) })
} }
console.log(JSON.stringify(error))
return Promise.reject(error) return Promise.reject(error)
} }
......
...@@ -165,7 +165,7 @@ class WXService extends Http { ...@@ -165,7 +165,7 @@ class WXService extends Http {
login() { login() {
const currentEnv = wx.getStorageSync('_qyWeChat') const currentEnv = wx.getStorageSync('_qyWeChat')
console.log('全局', currentEnv) // console.log('全局', currentEnv)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
wx.login({ wx.login({
success: (res) => { success: (res) => {
...@@ -217,12 +217,12 @@ class WXService extends Http { ...@@ -217,12 +217,12 @@ class WXService extends Http {
icon: 'none' icon: 'none'
}) })
console.log(JSON.stringify(baseUserInfo)) // console.log(JSON.stringify(baseUserInfo))
return this.get('i-user/info', { return this.get('i-user/info', {
unionId: baseUserInfo.unionId, unionId: baseUserInfo.unionId,
minaOpenId: baseUserInfo.openId minaOpenId: baseUserInfo.openId
}).then((res) => { }).then((res) => {
console.log('i-user/info res is %o ', res) // console.log('i-user/info res is %o ', res)
if (res.data.code === -10001) { if (res.data.code === -10001) {
this.showToast(`${res.data.message}`) this.showToast(`${res.data.message}`)
return Promise.reject({ return Promise.reject({
...@@ -257,7 +257,7 @@ class WXService extends Http { ...@@ -257,7 +257,7 @@ class WXService extends Http {
//生成触点对象Id //生成触点对象Id
getTentacleContent(tentacleInfo) { getTentacleContent(tentacleInfo) {
console.log('生成触点对象Id', tentacleInfo) // console.log('生成触点对象Id', tentacleInfo)
return this.post('/marketing/tentacleContent/getTentacleContent', tentacleInfo).then((res) => { return this.post('/marketing/tentacleContent/getTentacleContent', tentacleInfo).then((res) => {
let data = res.data.data let data = res.data.data
return Promise.resolve(data); return Promise.resolve(data);
...@@ -349,7 +349,7 @@ class WXService extends Http { ...@@ -349,7 +349,7 @@ class WXService extends Http {
//判断tentacleInfo是否为空 //判断tentacleInfo是否为空
if (!tentacleInfo) { if (!tentacleInfo) {
wx.setStorageSync('TENTACLE_CONTENT', tempTentacleInfo); wx.setStorageSync('TENTACLE_CONTENT', tempTentacleInfo);
console.log('TENTACLE_CONTENT', wx.getStorageSync('TENTACLE_CONTENT')) // console.log('TENTACLE_CONTENT', wx.getStorageSync('TENTACLE_CONTENT'))
return; return;
} }
//tentacleInfo 不为空 //tentacleInfo 不为空
...@@ -576,6 +576,8 @@ class WXService extends Http { ...@@ -576,6 +576,8 @@ class WXService extends Http {
// 集点体验者 // 集点体验者
config.data.experAccessible; config.data.experAccessible;
config.data.plusIsOpen = envInfo.plusIsOpen; config.data.plusIsOpen = envInfo.plusIsOpen;
config.data.contactUsPluginId = envInfo.contactUsPluginId;
config.data.contactUsIsOpen = envInfo.contactUsIsOpen;
const CONFIG_PAPGE = { const CONFIG_PAPGE = {
onLoad: function (...args) { onLoad: function (...args) {
...@@ -604,8 +606,8 @@ class WXService extends Http { ...@@ -604,8 +606,8 @@ class WXService extends Http {
pageIsFromShare = true; pageIsFromShare = true;
let idParam = decodeURIComponent(item['scene']).split('&')[0]; let idParam = decodeURIComponent(item['scene']).split('&')[0];
let shareId = idParam && idParam.split('=')[1] || 0; let shareId = idParam && idParam.split('=')[1] || 0;
console.log(shareId) // console.log(shareId)
console.log(idParam) // console.log(idParam)
//处理pageId的 //处理pageId的
if (idParam.indexOf('pageId') > -1){ if (idParam.indexOf('pageId') > -1){
item['pageId'] = shareId; item['pageId'] = shareId;
...@@ -623,8 +625,6 @@ class WXService extends Http { ...@@ -623,8 +625,6 @@ class WXService extends Http {
_self.getTentacleContentByTentacleId(id); _self.getTentacleContentByTentacleId(id);
} }
// console.log('args ----',args)
config.onLoad && config.onLoad.apply(page, args); config.onLoad && config.onLoad.apply(page, args);
}, },
onShow: function (...args) { onShow: function (...args) {
...@@ -644,8 +644,8 @@ class WXService extends Http { ...@@ -644,8 +644,8 @@ class WXService extends Http {
let currentEndTime = (new Date(premiumExpireStorage.replace(/-/g, '/'))).getTime(); // 到期时间 let currentEndTime = (new Date(premiumExpireStorage.replace(/-/g, '/'))).getTime(); // 到期时间
let currentTime = (new Date()).getTime(); let currentTime = (new Date()).getTime();
let vipFlag = currentTime <= currentEndTime ? true : false // 当前时间 < 到期时间为vip let vipFlag = currentTime <= currentEndTime ? true : false // 当前时间 < 到期时间为vip
console.log('premiumExpireStorage', premiumExpireStorage) // console.log('premiumExpireStorage', premiumExpireStorage)
console.log('当前时间 < 到期时间为vip', vipFlag) // console.log('当前时间 < 到期时间为vip', vipFlag)
if (baseUserInfo && wx.getStorageSync('token')) { if (baseUserInfo && wx.getStorageSync('token')) {
page.setData({ page.setData({
...@@ -727,12 +727,12 @@ class WXService extends Http { ...@@ -727,12 +727,12 @@ class WXService extends Http {
}, },
//处理分享页面打开时参数为memberId时生成触点对象信息 //处理分享页面打开时参数为memberId时生成触点对象信息
generatePointObject(tentacleInfo) { generatePointObject(tentacleInfo) {
console.log('---call 生成触点接口----') // console.log('---call 生成触点接口----')
console.log(tentacleInfo) // console.log(tentacleInfo)
_self.getTentacleContent(tentacleInfo).then(res => { _self.getTentacleContent(tentacleInfo).then(res => {
console.log('-----处理分享页面打开时参数为memberId时生成触点对象信息------') // console.log('-----处理分享页面打开时参数为memberId时生成触点对象信息------')
console.log('-----成功返回是------', res); // console.log('-----成功返回是------', res);
if (res && res.tentacleId) { if (res && res.tentacleId) {
let data = res; let data = res;
let TENTACLE_CONTENT = { let TENTACLE_CONTENT = {
...@@ -899,11 +899,11 @@ class WXService extends Http { ...@@ -899,11 +899,11 @@ class WXService extends Http {
const baseUserInfo = wx.getStorageSync('_baseUserInfo') const baseUserInfo = wx.getStorageSync('_baseUserInfo')
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (baseUserInfo && baseUserInfo.memberActivateStatus) { if (baseUserInfo && baseUserInfo.memberActivateStatus) {
console.log('已开卡', baseUserInfo) // console.log('已开卡', baseUserInfo)
wxService.openCardList() wxService.openCardList()
resolve(baseUserInfo) resolve(baseUserInfo)
} else if (!baseUserInfo || !baseUserInfo.memberActivateStatus) { } else if (!baseUserInfo || !baseUserInfo.memberActivateStatus) {
console.log('去开卡', baseUserInfo) // console.log('去开卡', baseUserInfo)
return this.navigateToMiniProgram({ return this.navigateToMiniProgram({
biz: baseUserInfo.biz, biz: baseUserInfo.biz,
encrypt_card_id: baseUserInfo.encryptCardId, encrypt_card_id: baseUserInfo.encryptCardId,
...@@ -980,7 +980,6 @@ class WXService extends Http { ...@@ -980,7 +980,6 @@ class WXService extends Http {
getCitysEnterty() { getCitysEnterty() {
const citys = citysData.default const citys = citysData.default
console.log('8888', citys)
let list = {} let list = {}
if (this.citysEntertys) { if (this.citysEntertys) {
list = this.citysEntertys list = this.citysEntertys
...@@ -988,7 +987,6 @@ class WXService extends Http { ...@@ -988,7 +987,6 @@ class WXService extends Http {
for (const key in citys) { for (const key in citys) {
if (citys.hasOwnProperty(key)) { if (citys.hasOwnProperty(key)) {
const element = citys[key] const element = citys[key]
console.log('element', element)
handler2citys({ handler2citys({
city: element, city: element,
result: { name: [], code: [] }, result: { name: [], code: [] },
......
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