Commit c4dd258a by 谢中龙

Merge branch 'mall_dev_7.9.0' into 'mall_dev_7.9.2'

合并种草优化功能到7.9.2

See merge request !180
parents 5c8232c9 7c6192f5
......@@ -132,6 +132,10 @@
"contactPlugin": {
"version": "1.3.0",
"provider": "wx104a1a20c3f81ec2"
},
"live-player-plugin": {
"version": "1.0.2",
"provider": "wx2b03c6e691cd7370"
}
},
"permission": {
......
......@@ -59,6 +59,10 @@ Component({
this.setData({
show: false
})
//关闭事件
wxService.nextTick(() => {
this.triggerEvent('modalClose')
})
},
_selectCoupon(e){
this.setData({
......@@ -113,7 +117,6 @@ Component({
this.setData({
proList: data
})
console.log(data)
}
}).finally(() => {
})
......
......@@ -19,7 +19,10 @@
</view>
<view class="coupon-list">
<relate-order-item wx:if="{{proList && proList.length > 0}}" bind:_selectCoupon="_selectCoupon" selectShow="{{show}}" proList="{{proList}}" />
<relate-order-item wx:if="{{proList && proList.length > 0}}"
bind:_selectCoupon="_selectCoupon"
selectShow="{{show}}"
proList="{{proList}}" />
</view>
<view class="empty-coupon" wx:if="{{!proList || proList.length < 1}}">
......
......@@ -100,7 +100,7 @@
margin-top: 95rpx;
}
.modal-info {
min-height: 900rpx;
min-height: 800rpx;
overflow: scroll;
}
.empty-coupon {
......
......@@ -59,6 +59,11 @@ Component({
this.setData({
showSelectTabModal: false
})
//关闭事件
wxService.nextTick(() => {
this.triggerEvent('modalClose')
})
},
confirm() {
......
......@@ -7,7 +7,7 @@
<view class="modal-info">
<view class="tab-wrap">
<view class="tab-list" wx:for="{{tabList}}" wx:key="{{index}}">
<view class="tab-list" wx:for="{{tabList}}" wx:key="*this">
<view class="tab-title" >
<view class="tab-item-title">{{item.name}}</view>
<view class="more-tab" wx:if="{{item.contentTagsList.length > 3}}">
......@@ -15,10 +15,24 @@
<image class="arrow-right" src="/assets/imgs/7_1_0/arrow-right.png" mode="widthFix"></image>
</view>
</view>
<view wx:if="{{idx<3}}" class="tab-item {{currentTab == tagItem.id ? 'active' : ''}}" wx:for="{{item.contentTagsList}}" wx:for-index="idx" wx:for-item="tagItem" wx:key="{{idx}}" bindtap="selectTab" data-id="{{tagItem.id}}" data-name="{{tagItem.name}}">{{tagItem.name}}</view>
<view wx:if="{{idx>3 && item.flag}}" class="tab-item {{currentTab == tagItem.id ? 'active' : ''}}" wx:for="{{item.contentTagsList}}" wx:for-index="idx" wx:for-item="tagItem" wx:key="{{idx}}" bindtap="selectTab" data-id="{{tagItem.id}}" data-name="{{tagItem.name}}">{{tagItem.name}}</view>
<!-- <view class="tab-item" wx:for="{{tabItems}}" wx:for-index="tabIndex" wx:for-item="moreTabItem" wx:key="{{tabIndex}}" bindtap="selectTab" data-id="{{moreTabItem.id}}" data-name="{{moreTabItem.name}}">{{moreTabItem.name}}</view> -->
<!-- <view class="tab-item">默认选项</view> -->
<view wx:if="{{idx<3}}"
class="tab-item {{currentTab == tagItem.id ? 'active' : ''}}"
wx:for="{{item.contentTagsList}}"
wx:for-index="idx"
wx:for-item="tagItem"
wx:key="*this"
bindtap="selectTab"
data-id="{{tagItem.id}}"
data-name="{{tagItem.name}}">{{tagItem.name}}</view>
<view wx:if="{{idx>3 && item.flag}}"
class="tab-item {{currentTab == tagItem.id ? 'active' : ''}}"
wx:for="{{item.contentTagsList}}"
wx:for-index="idx"
wx:for-item="tagItem"
wx:key="*this"
bindtap="selectTab"
data-id="{{tagItem.id}}"
data-name="{{tagItem.name}}">{{tagItem.name}}</view>
</view>
</view>
......
......@@ -70,6 +70,7 @@ const prod_brand_config = {
orderingMustOpenCard : false, //下单是否必须卡开
canUseWechatAddress : true,//是否使用获取微信地址
isOpenSelfMention : true, // 是否开启门店自提
canRefundDaysAfterDelivery : 15,//发货后多少天之内可显示申请退款按钮
isNeedGetLocation : true,//是否开启小程序获取位置(提交订单时获取门店信息)
guiderCanScanQrcode : true,//导购是否有扫一扫功能
shareTitle: '【舞象星品荟-社交商城】',
......@@ -90,6 +91,7 @@ const prod_brand_config = {
hasLiveVideo: true,//是否有直播功能
orderingMustOpenCard: true,
isOpenSelfMention: true, // 是否开启门店自提
canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮
guiderCanScanQrcode: true,//导购是否有扫一扫功能
isNeedGetLocation: false,//是否开启小程序获取位置(提交订单时获取门店信息)
shareTitle: '【泰华微商城】',
......@@ -108,6 +110,7 @@ const prod_brand_config = {
isMall: isMall,
hasLiveVideo: false,//是否有直播功能
orderingMustOpenCard: true,
canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮
isOpenSelfMention: false, // 是否开启门店自提
guiderCanScanQrcode: true,//导购是否有扫一扫功能
isNeedGetLocation: false,//是否开启小程序获取位置(提交订单时获取门店信息)
......@@ -127,6 +130,7 @@ const prod_brand_config = {
isMall: isMall,
hasLiveVideo: false,//是否有直播功能
orderingMustOpenCard: false,
canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮
guiderCanScanQrcode: true,//导购是否有扫一扫功能
isOpenSelfMention: false, // 是否开启门店自提
isNeedGetLocation: false,//是否开启小程序获取位置(提交订单时获取门店信息)
......@@ -146,6 +150,7 @@ const prod_brand_config = {
hasLiveVideo: false,//是否有直播功能
isMall: isMall,
orderingMustOpenCard: false,
canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮
guiderCanScanQrcode: true,//导购是否有扫一扫功能
isOpenSelfMention: false, // 是否开启门店自提
isNeedGetLocation: false,//是否开启小程序获取位置(提交订单时获取门店信息)
......@@ -166,6 +171,7 @@ const prod_brand_config = {
isMall: isMall,// 商城或门户 true 商城 false 门户
orderingMustOpenCard: false,//下单是否必须卡开
isOpenSelfMention: false, // 是否开启门店自提
canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮
guiderCanScanQrcode: true,//导购是否有扫一扫功能
isNeedGetLocation: false,//是否开启小程序获取位置(提交订单时获取门店信息)
shareTitle: '【LA RUTA DE VIA】',//分享海报上显示的小程序title
......@@ -185,6 +191,7 @@ const prod_brand_config = {
canUseWechatAddress: false,//是否使用获取微信地址
orderingMustOpenCard: false,
guiderCanScanQrcode: false,//导购是否有扫一扫功能
canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮
isOpenSelfMention: false, // 是否开启门店自提
isNeedGetLocation: false,//是否开启小程序获取位置(提交订单时获取门店信息)
shareTitle: '【hotwind热风微商城】',
......@@ -203,6 +210,7 @@ const prod_brand_config = {
hasLiveVideo: true,//是否有直播功能
isMall: isMall,
orderingMustOpenCard: true,
canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮
guiderCanScanQrcode: true,//导购是否有扫一扫功能
isOpenSelfMention: true, // 是否开启门店自提
isNeedGetLocation: true,//是否开启小程序获取位置(提交订单时获取门店信息)
......@@ -222,6 +230,7 @@ const prod_brand_config = {
isMall: isMall,
canUseWechatAddress: true,//是否使用获取微信地址
orderingMustOpenCard: false,
canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮
isOpenSelfMention: false, // 是否开启门店自提
guiderCanScanQrcode: true,//导购是否有扫一扫功能
isNeedGetLocation: false,//是否开启小程序获取位置(提交订单时获取门店信息)
......@@ -238,6 +247,7 @@ const prod_brand_config = {
contactUsPluginId: '',
hasLiveVideo: false,//是否有直播功能
hasTrial: false,
canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮
canUseWechatAddress: true,//是否使用获取微信地址
isMall: isMall,
orderingMustOpenCard: false,
......@@ -260,6 +270,7 @@ const prod_brand_config = {
hasLiveVideo: false,//是否有直播功能
canUseWechatAddress: true,//是否使用获取微信地址
orderingMustOpenCard: false,
canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮
isOpenSelfMention: false, // 是否开启门店自提
guiderCanScanQrcode: true,//导购是否有扫一扫功能
isNeedGetLocation: false,//是否开启小程序获取位置(提交订单时获取门店信息)
......@@ -279,6 +290,7 @@ const prod_brand_config = {
hasLiveVideo: false,//是否有直播功能
canUseWechatAddress: true,//是否使用获取微信地址
orderingMustOpenCard: false,
canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮
isOpenSelfMention: false, // 是否开启门店自提
guiderCanScanQrcode: true,//导购是否有扫一扫功能
isNeedGetLocation: false,//是否开启小程序获取位置(提交订单时获取门店信息)
......@@ -297,6 +309,7 @@ const prod_brand_config = {
hasTrial: false,
canUseWechatAddress: true,//是否使用获取微信地址
isMall: isMall,
canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮
orderingMustOpenCard: true,
guiderCanScanQrcode: true,//导购是否有扫一扫功能
isOpenSelfMention: false, // 是否开启门店自提
......@@ -316,6 +329,7 @@ const prod_brand_config = {
isMall: isMall,
canUseWechatAddress: true,//是否使用获取微信地址
orderingMustOpenCard: true,
canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮
isOpenSelfMention: true, // 是否开启门店自提
hasLiveVideo: false,//是否有直播功能
guiderCanScanQrcode: true,//导购是否有扫一扫功能
......@@ -335,6 +349,7 @@ const prod_brand_config = {
isMall: isMall,
canUseWechatAddress: true,//是否使用获取微信地址
orderingMustOpenCard: false,
canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮
isOpenSelfMention: true, // 是否开启门店自提
hasLiveVideo : false,//是否有直播功能
guiderCanScanQrcode: true,//导购是否有扫一扫功能
......@@ -436,6 +451,7 @@ let isNeedGetLocation = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].isN
let canUseWechatAddress = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].canUseWechatAddress : true;
let hasLiveVideo = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].hasLiveVideo : false;
let guiderCanScanQrcode = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].guiderCanScanQrcode : true;
let canRefundDaysAfterDelivery = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].canRefundDaysAfterDelivery : 15;
//配置信息导出
const envInfo = (() => {
return {
......@@ -459,6 +475,7 @@ const envInfo = (() => {
canUseWechatAddress: canUseWechatAddress,
hasLiveVideo: hasLiveVideo,
guiderCanScanQrcode: guiderCanScanQrcode,
canRefundDaysAfterDelivery: canRefundDaysAfterDelivery,
}
})()
......
......@@ -73,6 +73,25 @@ wxService.page({
this.getPageData();
this.updateFavoriteAndShareNumById();
},
//发布种草按钮
onTapToReleaseContent() {
//判断当前登录用户是不是有导购身份
let userInfo = wx.getStorageSync('_baseUserInfo') ? wx.getStorageSync('_baseUserInfo') : null;
if (!userInfo) {
wx.showToast({
title: '请先登录!',
icon: 'none'
});
}
else if (!userInfo.member.qiyeInfo) {
wxService.router(`/subPackage/page/pages/grassCommunity/grassCommunity`)
}
else {
wxService.router(`/shoppingGuid/page/pages/releaseContent/releaseContent`);
}
},
//根据详情那边过来的点赞分享数据 更改列表中对应的数据
updateFavoriteAndShareNumById(){
let articleInfo = wx.getStorageSync('articleInfo');
......
......@@ -39,11 +39,9 @@
<view wx:if="{{currentHasUserInfo}}">
<block wx:if="{{contentPermission}}">
<navigator open-type="navigate" url="/subPackage/page/pages/grassCommunity/grassCommunity">
<view class="add">
<image src='/assets/imgs/icon_plus.png' mode='aspectFit'></image>
</view>
</navigator>
<view class="add" bindtap="onTapToReleaseContent">
<image src='/assets/imgs/icon_plus.png' mode='aspectFit'></image>
</view>
</block>
</view>
<card-modal
......
......@@ -43,7 +43,7 @@
"list": []
},
"miniprogram": {
"current": 81,
"current": 13,
"list": [
{
"id": -1,
......@@ -128,7 +128,7 @@
"id": 13,
"name": "subPage",
"pathName": "subPackage/page/pages/subPage/subPage",
"query": "pageId=26",
"query": "pageId=106&t=cKG2AoWZ00",
"scene": null
},
{
......@@ -233,7 +233,7 @@
"id": 28,
"name": "我的发布_种草详情",
"pathName": "subPackage/page/pages/myReleaseDetail/myReleaseDetail",
"query": "id=690150609835417600",
"query": "id=691599391294898176",
"scene": null
},
{
......
......@@ -238,7 +238,6 @@ wxService.page({
*/
onShow: function () {
let chooseProducts = wx.getStorageSync('guiderReleaseProducts') ? wx.getStorageSync('guiderReleaseProducts') : [];
console.log(chooseProducts)
if(chooseProducts.length > 0){
this.setData({
proGoods: chooseProducts,
......@@ -328,7 +327,7 @@ wxService.page({
sspList.forEach(item => {
if (isFirst == 0 && item.url){
item.cover = 1;
count++
isFirst ++ ;
}
else{
item.cover = 0;
......@@ -349,8 +348,8 @@ wxService.page({
let param = {};
param.article = this.data.article;
param.headline = this.data.headline;
param.sspList = this.data.sspList;
param.stcList = this.data.checkedProducts;
param.sspList = sspList;
param.stcList = checkedProducts;
param.tagsId = this.data.tagsId;
param.userId = memberId;
param.id = this.data.id;
......@@ -362,6 +361,8 @@ wxService.page({
title: '发布成功',
});
wx.removeStorageSync('guiderReleaseProducts');
wx.redirectTo({
url: '/subPackage/page/pages/myRelease/myRelease',
});
......
......@@ -18,7 +18,7 @@
<view class="flex-wrp">
<view class="flex-item" wx:for="{{uploadImgs}}" wx:key="*this" wx:for-index="index" wx:for-item="item">
<icon size="16" type="clear" bindtap="deleteImage" data-index="{{index}}" />
<image class="item-img" src="{{item}}" />
<image class="item-img" src="{{item}}" mode="aspectFit" />
</view>
<view class="flex-item" hidden="{{pics.length >= 5}}">
<view class="upload-wrap" bindtap="uploadImg">
......
......@@ -26,7 +26,8 @@ wxService.page({
pageNo: 1,
pageSize: 100,
requesting: false,
showSelectTabModal: false
showSelectTabModal: false,
isHidden : false,
},
/**
......@@ -124,9 +125,9 @@ wxService.page({
// 关联商品
handleRelatedGoods() {
console.log('关联商品')
this.setData({
showSelectRelatedGoods: true
showSelectRelatedGoods: true,
isHidden : true,
})
},
uploadImg() {
......@@ -148,7 +149,6 @@ wxService.page({
that.setData({
pics: pics
});
// console.log(',..............',that.data.pics)
that.moreImgUpload({
url: url,//这里是你图片上传的接口
path: imgsrcs//这里是选取的图片的地址数组
......@@ -165,34 +165,41 @@ wxService.page({
// 关联商品
_selectGoods(e) {
this.setData({
proGoods: e.detail
})
this.data.proGoods = e.detail;
let stcList = []
for (var i in this.data.proGoods) {
stcList.push({
commodityId: this.data.proGoods[i].productId
})
this.setData({
'params.stcList': stcList
})
}
this.setData({
'params.stcList': stcList,
isHidden: false,
proGoods: this.data.proGoods,
})
},
//选择商品关闭事件
modalClose(){
this.setData({
isHidden: false,
})
},
//关联标签
_selectTab(e) {
console.log(e)
this.setData({
'params.tagsId': e.detail.id,
tabName: e.detail.name
tabName: e.detail.name,
isHidden: false,
})
},
// 标签选择
selectTab() {
this.setData({
showSelectTabModal: true
showSelectTabModal: true,
isHidden : true,
})
},
......@@ -232,8 +239,7 @@ wxService.page({
i++;
if (i == data.path.length) { //当图片传完时,停止调用
} else {//若图片还没有传完,则继续调用函数
console.log('00000', i);
} else {//若图片还没有传完,则继续调用函数
data.i = i;
data.success = success;
data.fail = fail;
......@@ -277,7 +283,6 @@ wxService.page({
var sspList = this.data.params.sspList
for (var i in sspList) {
if (sspList[i].videoUrl) {
console.log(i)
sspList.splice(i, 1)
}
}
......@@ -303,25 +308,9 @@ wxService.page({
},
// 发布笔记
formSubmit(e) {
console.log('e', this.data.requesting)
if (this.data.requesting) {
return;
}
// if (!this.data.params.sspList || this.data.params.sspList.length < 1) {
// wx.showToast({
// title: '请上传至少一张图片',
// icon: 'none'
// })
// return;
// }
// if (this.data.params.sspList && this.data.params.sspList[0].videoUrl && !this.data.params.sspList[1]) {
// wx.showToast({
// title: '请上传视频',
// // title: '请上传至少一张图片',
// icon: 'none'
// })
// return;
// }
const { sspList } = this.data.params
if (!sspList.length) {
wx.showToast({
......
......@@ -24,10 +24,14 @@
</view>
<view class="title-border-text">
<!--<input placeholder="这一刻想说什么..." name="article" value="{{params.article}}" />-->
<textarea bindblur="bindWordLimit"
<view class="span-textarea" hidden="{{!isHidden}}">{{params.article}}</view>
<textarea
bindblur="bindWordLimit"
style="width: 100%;"
class='textarea-text' name="article"
class='textarea-text'
name="article"
value="{{params.article}}"
hidden="{{isHidden}}"
auto-height
placeholder="这一刻想说什么..." />
</view>
......@@ -54,7 +58,7 @@
<!--goHome-->
<go-home />
<floatNav bind:getAuth="_getUserInfo" bind:updatePage="updatePage"/>
<select-tab showSelectTabModal="{{showSelectTabModal}}" bind:_selectTab="_selectTab" />
<select-related-goods show="{{showSelectRelatedGoods}}" bind:_selectGoods="_selectGoods" pro-goods="{{proGoods}}"/>
<select-tab showSelectTabModal="{{showSelectTabModal}}" bind:modalClose="modalClose" bind:_selectTab="_selectTab" />
<select-related-goods show="{{showSelectRelatedGoods}}" bind:modalClose="modalClose" bind:_selectGoods="_selectGoods" pro-goods="{{proGoods}}"/>
<go-guid/>
\ No newline at end of file
......@@ -16,6 +16,11 @@ page{
min-height: 300rpx;
}
.span-textarea{
width: 100%;
min-height: 300rpx;
}
.upload-tip {
height: 28prx;
color: rgba(170, 170, 170, 1);
......
......@@ -84,6 +84,24 @@ wxService.page({
},
//发布种草按钮
onTapToReleaseContent(){
//判断当前登录用户是不是有导购身份
let userInfo = wx.getStorageSync('_baseUserInfo') ? wx.getStorageSync('_baseUserInfo') : null;
if (!userInfo) {
wx.showToast({
title: '请先登录!',
icon : 'none'
});
}
else if (!userInfo.member.qiyeInfo) {
wxService.router(`/subPackage/page/pages/grassCommunity/grassCommunity`)
}
else {
wxService.router(`/shoppingGuid/page/pages/releaseContent/releaseContent`);
}
},
// 发布内容权限
getContentPermission() {
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
......
......@@ -26,12 +26,9 @@
</button>
<view wx:if="{{currentHasUserInfo}}">
<block wx:if="{{contentPermission}}">
<navigator open-type="navigate" url="/subPackage/page/pages/grassCommunity/grassCommunity">
<view class="add">
<image src="/assets/imgs/icon_plus.png" mode="aspectFit"></image>
<!-- <text>+</text> -->
</view>
</navigator>
<view class="add" bindtap="onTapToReleaseContent">
<image src="/assets/imgs/icon_plus.png" mode="aspectFit"></image>
</view>
</block>
</view>
<!--goHome-->
......
......@@ -44,7 +44,7 @@
<text class="share-number">{{contentInfo.enjoySum || 0}}</text>
</view>
<view class="share-oprate" bindtap="onTapShare">
<image class="share-img" src="https://img3.bigaka.com/prd/3001/202003/20200309/3001843570f0-4ff8-4e72-8d69-9710269420bf.png" />
<image class="share-img" src="/assets/imgs/7_1_0/08_22/share.png" />
<text class="share-number">{{contentInfo.transmitSum || 0}}</text>
</view>
</view>
......@@ -52,9 +52,6 @@
<view class="weui-flex">
<view class="action-del" bindtap="handleDel"> 删除 </view>
<view class="action-edit" bindtap='onTapEdit' data-item="{{contentInfo}}"> 编辑 </view>
<!-- <navigator url="/subPackage/page/pages/grassCommunity/grassCommunity?id={{contentInfo.id}}" hover-class="none">
</navigator> -->
</view>
<navigator url="/subPackage/page/pages/orderBenefit/orderBenefit?id={{contentInfo.id}}" hover-class="none">
<view class="action-check"> 查看收益 </view>
......
......@@ -47,6 +47,7 @@ page{
position: fixed;
bottom: 0;
width: 100%;
background: #ffffff;
}
.action-share {
border-bottom: 1rpx solid rgba(151, 151, 151, 0.5);
......@@ -54,6 +55,11 @@ page{
.action, .action-share{
padding: 10rpx 30rpx;
}
.action-share{
padding: 30rpx;
}
.action {
height: 88rpx;
background-color: rgba(255, 255, 255, 1);
......
......@@ -37,7 +37,7 @@ wxService.page({
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
onLoad(options) {
this.setData(
{
pages: [],
......@@ -56,18 +56,31 @@ wxService.page({
handlerDataOnPage = new utils.HandlerDataOnPage()
renderPage = require('../../../../utils/renderPage').getRenderPage()
handlerDataOnPage.init(this, 'pages')
if (this.options['scene']) {
let idParam = decodeURIComponent(this.options['scene']).split('&')[0];
// let hasPageId = idParam ? (idParam.indexOf('pageId') > -1 ? true : false) : false;
let shareId = idParam && idParam.split('=')[1] || 0;
this.options.pageId = shareId;
}
// 判断
if(options.pageId){
this.data.pageId = options.pageId;
this.setData({
pageId: this.data.pageId
});
this.setData({
pageId: this.options.pageId
},()=>{
this.initPage(this.data.pageId)
})
}
else{
let pageId = shareId;
if (options['scene']) {
let idParam = decodeURIComponent(options['scene']).split('&')[0];
// let hasPageId = idParam ? (idParam.indexOf('pageId') > -1 ? true : false) : false;
let shareId = idParam && idParam.split('=')[1] || 0;
pageId = shareId;
}
this.data.pageId = pageId;
this.setData({
pageId: this.data.pageId
});
this.initPage(this.data.pageId);
}
},
/**
......
......@@ -161,6 +161,38 @@ function parseUrl(query) {
return result;
}
/**
* 计算传入时间和当前时间差
* @param d 时间 格式:2010 - 04 - 10 10: 22: 36
* @return
*/
function getDateDiff(d){
var now = new Date().getTime();
var diffValue = now - Date.parse(d.replace(/-/g, '/').replace(/:/g, ":"));
if (diffValue < 0) {
return null;
}
var minute = 1000 * 60;
var hour = minute * 60;
var day = hour * 24;
var halfamonth = day * 15;
var month = day * 30;
var monthC = diffValue / month;
var weekC = diffValue / (7 * day);
var dayC = diffValue / day;
var hourC = diffValue / hour;
var minC = diffValue / minute;
let result = {};
result.month = parseInt(monthC);
result.week = parseInt(weekC);
result.days = parseInt(dayC);
result.hours = parseInt(hourC);
result.minutes = parseInt(minC);
return result;
}
function getCurrentRouter() {
var pages = getCurrentPages() // 获取加载的页面
......@@ -401,6 +433,7 @@ module.exports = {
getUserInfoByBtn,
moment,
parseUrl,
getDateDiff,
_,
// _: underscore,
HandlerDataOnPage,
......
......@@ -656,6 +656,8 @@ class WXService extends Http {
config.data.speadProductsBanner = envInfo.speadProductsBanner;
config.data.canUseWechatAddress = envInfo.canUseWechatAddress;
config.data.guiderCanScanQrcode = envInfo.guiderCanScanQrcode;
config.data.canRefundDaysAfterDelivery = envInfo.canRefundDaysAfterDelivery;
//默认
config.data.loading = true;
......
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