Commit 056a36a3 by 赵雅纹

Merge branch 'dev_7.1.0' into fixbug-ZYW

parents 999f6494 dd43fccb
......@@ -8,6 +8,7 @@ var cityJson = require('utils/city.js')
var wxService = require('utils/wxService')
let config = require('./configScreen/configScreen');
const envInfo = require('config/index').envInfo
let isPlusVip = false
App({
onLaunch: function (e) {
......@@ -38,8 +39,14 @@ App({
},
onShow: function (options = {}) {
console.log('app-onshow', options)
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
const { registerTime ='' } = baseUserInfo.member
// ios 兼容 是不是plus vip
let currentEndTime = (new Date(registerTime.replace(/-/g, '/'))).getTime(); // 过期时间
let currentTime = (new Date()).getTime(); // 现在时间
this.globalData.isPlusVip = currentTime >= currentEndTime ? true : false
if (options.referrerInfo && options.referrerInfo.extraData!=null){
const { activate_ticket, card_id, code, errCode, wx_activate_after_submit_url } = options.referrerInfo.extraData
let urlData = wx_activate_after_submit_url.split("?");
......@@ -114,7 +121,7 @@ App({
isFullSucreen: false, // 当前设备是否为 FullSucreen
commonFunc: commonFunc,
contants: contants,
isPlusVip: isPlusVip,
cityJson: cityJson,
// brandId: 2711,
// brandId: 2005,
......
......@@ -18,6 +18,7 @@
"pages/cart/cart",
"pages/my/my",
"pages/my_1/my",
"pages/my_11/my",
"pages/wantToBuyDetail/wantToBuyDetail",
"pages/myShare/myShare",
"pages/productDetail/productDetail",
......
......@@ -22,7 +22,6 @@ Component({
*/
methods: {
selectCoupon() {
console.log('2222')
this.setData({
isSelect: !this.data.isSelect
})
......
......@@ -5,6 +5,10 @@ const envInfo = require('../../config/index').envInfo
Component({
properties: {
currentHasUserInfo:{
type: Boolean,
type: false
},
personData: {
type: Object,
value: {},
......@@ -21,16 +25,6 @@ Component({
type: Object,
value: {},
observer: '_userInfoChange'
// observer(newVal, oldVal){
// console.log('---newVal',newVal,oldVal)
// if (newVal !== oldVal) {
// this.setData({
// memberActivateStatus: newVal && newVal.memberActivateStatus || false,
// memberCardNo: newVal && newVal.memberCardNo || '',
// currentMobile: newVal && newVal.member && newVal.member.mobile || '',
// })
// }
// }
},
couponNum: {
type: Number,
......@@ -60,7 +54,9 @@ Component({
_token: '',
currentMobile: '',
baseImgUrl: '',
storgeUserInfo: wx.getStorageSync('_baseUserInfo')
storgeUserInfo: wx.getStorageSync('_baseUserInfo'),
isPlusVip: false,
currentPlusStyle: null
},
observers: {
'**': function(e) {
......@@ -68,17 +64,24 @@ Component({
},
},
attached() {
const { isPlusVip, imageUrl } = app.globalData
const { personData } = this.data
this.setData({
personCenter: this.data.personData,
baseImgUrl: app.globalData.imageUrl
personCenter: personData,
baseImgUrl: imageUrl,
isPlusVip,
currentPlusStyle: isPlusVip ? personData.plus.filter(item=> item.purchased == 1)[0] : personData.plus.filter(item=> item.purchased == 0)[1]
},()=> {
console.log('aaaaaaaaaa', this.data.currentPlusStyle)
})
// let base64 = wx.getFileSystemManager().readFileSync(this.data.baseUrl, "base64");
// this.setData({
// baseUrl: "data:image/png;base64," + base64
// })
},
methods: {
_getUserInfo(res = {}) {
wxService.nextTick(() => {
this.triggerEvent('getAuth', res);
})
},
_userInfoChange(newVal, oldVal) {
if (newVal !== oldVal) {
this.setData({
......
<!--component/personCenter/personCenter.wxml-->
<wxs src="../../wxs/utils.wxs" module="utils" />
<view wx:if='{{!currentMobile}}' class="member-unActive {{personCenter.noactiveBackgroundImageUrl ?'':'member-unActive-bgc'}}" bindtap="handleTtoActiveMemebr">
<image src="{{utils.formateUrl(personCenter.noactiveBackgroundImageUrl,baseImgUrl)}}" class="no-active-img" mode="widthFix" />
<image
wx:if="{{currentHasUserInfo}}"
src="{{utils.formateUrl(personCenter.noactiveBackgroundImageUrl,baseImgUrl)}}"
class="no-active-img"
mode="widthFix"
/>
<button
wx:if="{{!currentHasUserInfo}}"
bindgetuserinfo="_getUserInfo"
data-jflag="false"
open-type='getUserInfo'
class='btn df'
hover-class="btn-hover"
style="height:100%"
>
<image src="{{utils.formateUrl(personCenter.noactiveBackgroundImageUrl,baseImgUrl)}}" class="no-active-img" mode="widthFix" />
</button>
</view>
<view
wx:if='{{currentMobile}}'
......@@ -42,8 +58,6 @@
</view>
<!--plus-->
<view class='df tc person-num' wx:if='{{currentMobile}}'>
<!--plus-->
<image class="" src='{{currentPlusStyle.imageUrl}}' mode="widthFix" />
</view>
<authorization-modal isAuthorization='{{isAuthorization}}' />
......@@ -57,7 +57,6 @@ Component({
// 获取当前帐号信息
const userInfo = wx.getStorageSync('_baseUserInfo')
console.log('curItemType', curItemType)
// link row
if (curItemType.link) {
let currentClickType = app.globalData.commonFunc.getLink(curItemType.link.type, curItemType)
......
......@@ -44,10 +44,4 @@
</view>
</view>
<authorization-modal
isAuthorization='{{isAuthorization}}'
bind:activeTocard="activeTocard"
isAuthorizationType="{{isAuthorizationType}}"
isAuthorizationActiveText="{{isAuthorizationActiveText}}"
/>
......@@ -241,8 +241,8 @@ wxService.page({
// let parmas = {
// trolleySku2Buy: JSON.stringify(trolleySku2Buy)
// }
let tradeDto = {
couponId: '',
trolleySku2Buy:JSON.stringify(trolleySku2Buy)
}
const parmas = tradeDto
......@@ -250,6 +250,18 @@ wxService.page({
wxService
.router('/pages/confirmOrder/confirmOrder')
.search(parmas)
// let tradeDto = {
// couponId: '',
// trolleySku2Buy:JSON.stringify(trolleySku2Buy)
// }
// const parmas = tradeDto
// wxService
// .router('/pages/confirmOrder/confirmOrder')
// .search(parmas)
// 直接调支付
// this.handleGoBuy(skuIds)
},
......
......@@ -7,6 +7,8 @@ wxService.page({
* 页面的初始数据
*/
data: {
couponId: null,
checkByPremium: false,
addressInfo: [],
showSelectCoupon: false,
skuIds: [],
......@@ -30,10 +32,16 @@ wxService.page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
const { couponId, trolleySku2Buy } = this.options
// const { couponId, trolleySku2Buy } = this.options
// let tradeDto = {
// couponId: couponId,
// trolleySku2Buy: JSON.parse(trolleySku2Buy)
// }
const { trolleySku2Buy } = this.options
let tradeDto = {
couponId: couponId,
trolleySku2Buy: JSON.parse(trolleySku2Buy)
}
......@@ -41,8 +49,13 @@ wxService.page({
// 下单 && 计算优惠价
this.setData({ trolleySku2Buy: tradeDto }, () => {
this.calPreferentialPrice(tradeDto) // 计算优惠价
this.setData({ trolleySku2Buy: tradeDto.trolleySku2Buy }, () => {
const { trolleySku2Buy, checkByPremium } = this.data
let params = {
checkByPremium,
trolleySku2Buy
}
this.calPreferentialPrice(params) // 计算优惠价
})
this.initCitys()
......@@ -178,6 +191,20 @@ wxService.page({
handelChangeSelectVip() {
this.setData({
isSelect: !this.data.isSelect
}, () => {
const { isSelect } = this.data
console.log('isSelect', isSelect)
this.setData({
checkByPremium: isSelect
}, () => {
const { trolleySku2Buy, checkByPremium } = this.data
let params = {
checkByPremium,
trolleySku2Buy
}
this.calPreferentialPrice(params) // 重新计算优惠价
})
})
},
// 默认地址
......@@ -185,11 +212,11 @@ wxService.page({
wxService.router('/pages/myAddress/myAddress')
},
// 计算优惠价
calPreferentialPrice(tradeDto) {
calPreferentialPrice(params) {
wx.showLoading({
title: '加载中'
})
wxService.post(`/sale/trade/buyer/preview`, tradeDto).then(res => {
wxService.post(`/sale/trade/buyer/preview`, params).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
......@@ -200,22 +227,25 @@ wxService.page({
})
},
handelGobuy() {
const { trolleySku2Buy } = this.data
this.getBill(trolleySku2Buy) // 下单
const { trolleySku2Buy, couponId } = this.data
let params = {
couponId,
trolleySku2Buy
}
this.getBill(params) // 下单
},
// 下单
getBill(trolleySku2Buy) {
getBill(params) {
wx.showLoading({
title: '加载中'
})
wxService.post(`/sale/trade/buyer/bill`, trolleySku2Buy).then(res => {
wxService.post(`/sale/trade/buyer/bill`, params).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
delete data.appId
wx.requestPayment(Object.assign({
success(res) {
console.log('000000', res)
wx.hideLoading()
// 支付成功页面
wxService.router('/subPackage/page/pages/paymentStatus/paymentStatus')
......@@ -223,12 +253,12 @@ wxService.page({
fail(res) {
wx.hideLoading()
wx.showToast({
title: '支付失败',
title: '已取消',
icon: 'none',
mask: true
})
}
}, data))
}, data.wxParams))
}
}
})
......
......@@ -65,6 +65,7 @@
.pro-list{
border-bottom: 1px solid rgba(151,151,151,0.3);
padding:31rpx 0 25rpx;
display: flex;
}
.pro-list:last-child{
border-bottom: none;
......
......@@ -24,7 +24,7 @@ wxService.page({
memberLevel: false,
showCardModal: false,
currentShareContent: null,
fromZc : false,
fromZc: false,
},
/**
......@@ -35,10 +35,10 @@ wxService.page({
if (options && options.id) {
this.setData({
productId: options.id,
fromZc: options.fromZc == 1
fromZc: options.fromZc == 1
});
//不是从种草过来的, 需要清除本地临时的触点信息
if (!options.fromZc){
if (!options.fromZc) {
wx.removeStorageSync('TEMP_TENTACLE_INFO');
wx.removeStorageSync('TIME_EXPIRATION');
}
......@@ -239,8 +239,9 @@ wxService.page({
let parmas = {
trolleySku2Buy: JSON.stringify(trolleySku2Buy)
}
const { fromZc } = this.data
//判断是否从种草商品过来购买
if (fromZc){
if (fromZc) {
wxService.updateLocalTentacleInfo();
}
wxService
......
......@@ -101,7 +101,7 @@
formType="submit"
open-type="navigate"
>
<image src="https://hwimagecdn.ihotwind.cn/hotwind-mini/images/hotnewicon/bottom-index.png" mode="widthFix" />
<image src="/assets/imgs/7_1_0/home_un.png" mode="widthFix" />
<view>首页</view>
</navigator>
</form>
......@@ -112,22 +112,21 @@
name='nav'
>
<navigator class='get-formId--btn footer-icon' open-type="navigate" url="/pages/cart/cart">
<image class="contact-share-img" src="https://hwimagecdn.ihotwind.cn/hotwind-mini/images/hotnewicon/bottom-shop-cart.png" />
<image class="contact-share-img" src="/assets/imgs/7_1_0/cart_un.png" />
<view class="add-car-text">购物车</view>
</navigator>
</form>
<form
<!-- <form
class='get-formId'
bindsubmit="nav"
report-submit
name='home'
>
<!-- <navigator class="get-formId--btn footer-icon">
<navigator class="get-formId--btn footer-icon">
<image src="https://hwimagecdn.ihotwind.cn/hotwind-mini/images/hotnewicon/bottom-kefu.png" mode="widthFix" />
<view class="tab-text">分享</view>
</navigator> -->
</form>
</navigator>
</form> -->
</view>
<block>
<view class="footer-buttons clearfix">
......
......@@ -36,7 +36,6 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad() {
console.log('onlod', this.options)
this.setData(
{
pages: [],
......@@ -78,7 +77,6 @@ wxService.page({
// 取会员卡号
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
console.log('会员信息------------', baseUserInfo)
const cardMember = wx.getStorageSync('_cardMember')
// 登录接口返回err
const reLoginErrFlag = wx.getStorageSync('reLoginErr')
......
......@@ -6,7 +6,7 @@
<image-swiper image-data="{{pItem.rotationchart.images}}" />
</view>
<view class="" wx:if="{{pItem.type == 2}}">
<person-center base-user-info="{{baseUserInfo}}" person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/>
<person-center bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" base-user-info="{{baseUserInfo}}" person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/>
</view>
<view class="" wx:if="{{pItem.type == 3}}">
<pic-nav pic-nav="{{pItem.navigation.images}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/>
......
......@@ -39,7 +39,7 @@
"list": []
},
"miniprogram": {
"current": 42,
"current": 44,
"list": [
{
"id": -1,
......@@ -144,14 +144,14 @@
"id": 16,
"name": "商品详情页",
"pathName": "pages/productDetail/productDetail",
"query": "productId=1008190",
"query": "id=621372413208301568",
"scene": null
},
{
"id": 17,
"name": "确认订单",
"pathName": "pages/confirmOrder/confirmOrder",
"query": "couponId=&trolleySku2Buy=[{\"count\":1,\"skuId\":613473098901098500}]",
"query": "trolleySku2Buy=[{\"count\":1,\"skuId\":621372628724224000}]",
"scene": null
},
{
......@@ -325,6 +325,21 @@
"id": -1,
"name": "subPackage/page/pages/goToHome /goToHome",
"pathName": "subPackage/page/pages/goToHome/goToHome",
"query": "",
"scene": null
},
{
"id": -1,
"name": "plus页面",
"pathName": "pages/my_1/my",
"query": "",
"scene": null
},
{
"id": -1,
"name": "plus页面11",
"pathName": "pages/my_11/my",
"query": "",
"scene": null
}
]
......
......@@ -36,7 +36,6 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad() {
console.log('onlod', this.options)
this.setData(
{
pages: [],
......
......@@ -6,7 +6,7 @@
<image-swiper image-data="{{pItem.rotationchart.images}}" />
</view>
<view class="" wx:if="{{pItem.type == 2}}">
<person-center base-user-info="{{baseUserInfo}}" person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/>
<person-center bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" base-user-info="{{baseUserInfo}}" person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/>
</view>
<view class="" wx:if="{{pItem.type == 3}}">
<pic-nav pic-nav="{{pItem.navigation.images}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/>
......
......@@ -567,9 +567,7 @@ class WXService extends Http {
_self.initAppGlobalDataSync()
//修改参数
let pageIsFromShare = false, tentacleId = null;
console.log('args', args)
args.forEach(item => {
console.log('item===',item)
if (item['t']) {
pageIsFromShare = true;
tentacleId = Integer.digit(item['t'], 64, 10);
......@@ -593,7 +591,6 @@ class WXService extends Http {
config.onLoad && config.onLoad.apply(page, args);
},
onShow: function (...args) {
console.log('________',args)
const page = this
_self.currentPage = page
config.onShow && config.onShow.apply(page, args)
......
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