Merge branch 'develop-ecshopx' of git.ishopex.cn:onex/ecshopx-vshop into develop-ecshopx

* 'develop-ecshopx' of git.ishopex.cn:onex/ecshopx-vshop:
  修复结算页报错返回上一层
  fix:增加判断
  fix:修改微信支付
  优化页面样式
  fix:订单详情页点击立即支付有误
  fix:去除point参数
  fix: h5头部标题
  点击头像去授权微信头像
  编译问题
  fix:修改付费会员点击“立即支付”,没有反应

# Conflicts:
#	package-lock.json
#	src/api/req.js
#	src/pages/member/index.js
This commit is contained in:
bentz
2021-11-23 16:22:41 +08:00
22 changed files with 1268 additions and 1314 deletions

2356
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -48,7 +48,7 @@
"nerv-devtools": "^1.5.7",
"nervjs": "^1.5.7",
"qiniu-js": "^2.5.4",
"qs": "^6.6.0",
"qs": "6.6.0",
"redux": "^4.0.1",
"redux-create-reducer": "^1.2.0",
"redux-logger": "^3.0.6",

View File

@@ -238,10 +238,10 @@ class App extends Component {
'pages/member/qrcode'
],
plugins: {
"live-player-plugin": {
"version": "1.2.10", // 填写该直播组件版本号
"provider": "wx2b03c6e691cd7370" // 必须填该直播组件appid
}
// "live-player-plugin": {
// "version": "1.3.0", // 填写该直播组件版本号
// "provider": "wx2b03c6e691cd7370" // 必须填该直播组件appid
// }
// "meiqia": {
// "version": "1.1.0",
// "provider": "wx2d2cd5fd79396601"

View File

@@ -5,7 +5,7 @@
.member-address-list {
padding: 53px 30px 120px 40px;
/* #ifdef h5 */
padding: 145px 30px 120px 40px;
padding: 48px 30px;
/* #endif */
}
.address-item {
@@ -36,7 +36,7 @@
background: #ffffff;
box-shadow: 0px 8px 26px 0px rgba(0, 0, 0, 0.07);
border-radius: 18px;
margin-left: 12px;
// margin-left: 12px;
padding: 30px 23px 10px;
}
&__title {

View File

@@ -4,7 +4,7 @@ $item-img-size: 240px !default;
.page-my-group-list {
/* #ifdef h5 */
padding-top: $navigate-height-h5;
// padding-top: $navigate-height-h5;
/* #endif */
.groups-list__scroll {
box-sizing: border-box;

View File

@@ -104,7 +104,7 @@ export default class SettingIndex extends Component {
return (
<View className='member-setting'>
<SpNavBar title='设置' />
<View className='page-member-section'>
<View className='member-setting-section'>
<SpCell title='个人信息' isLink onClick={this.handleClickInfo.bind(this)}></SpCell>
<SpCell
title='地址管理'

View File

@@ -6,9 +6,9 @@
padding-top: 0px;
height: 100vh;
/* #endif */
.page-member-section {
.member-setting-section {
width: 92vw;
margin: 0 auto 25px auto;
margin: 20px auto 25px auto;
background: #fff;
overflow: hidden;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);

View File

@@ -33,12 +33,12 @@ export default class UserInfo extends Component {
avatarClickNum: 0,
showCheckboxPanel: false,
// 是否显示隐私协议
showPrivacy: false,
showTimes: 0,
// showPrivacy: false,
// showTimes: 0,
// 是否获取微信用户信息授权
wxUserInfo: true,
// wxUserInfo: true,
// 是否同意隐私协议
isAgree: Taro.getStorageSync('Privacy_agress')
// isAgree: Taro.getStorageSync('Privacy_agress')
}
// option的type
@@ -55,8 +55,8 @@ export default class UserInfo extends Component {
// 上传头像
handleAvatar = async () => {
const { showTimes, userInfo, isAgree } = this.state
if (showTimes >= 1) {
const { userInfo } = this.state
if (userInfo.avatar) {
try {
const { tempFiles = [] } = await Taro.chooseImage({
count: 1
@@ -78,19 +78,19 @@ export default class UserInfo extends Component {
console.log(err)
}
} else {
if (isAgree == 1) {
// if (isAgree == 1) {
S.OAuthWxUserProfile(() => {
this.setState({
showTimes: this.state.showTimes + 1
})
// this.setState({
// showTimes: this.state.showTimes + 1
// })
this.getFormItem()
}, true)
} else {
this.setState({
showPrivacy: true,
wxUserInfo: true
})
}
// } else {
// this.setState({
// showPrivacy: true,
// wxUserInfo: true
// })
// }
}
}
@@ -234,7 +234,7 @@ export default class UserInfo extends Component {
saveInfo = async (e) => {
// e && e.stopPropagation();
const { userInfo, regParams, isAgree } = this.state
if (isAgree == 1) {
// if (isAgree == 1) {
try {
Object.keys(regParams).forEach((key) => {
if (regParams[key].is_required) {
@@ -256,25 +256,25 @@ export default class UserInfo extends Component {
} catch (e) {
showToast(`请完善${e}`)
}
} else {
this.setState({
showPrivacy: true,
wxUserInfo: false
})
}
// } else {
// this.setState({
// showPrivacy: true,
// wxUserInfo: false
// })
// }
}
privacyOnChange() {
this.setState({
isAgree: true
}, () => {
if (this.state.wxUserInfo) {
this.getFormItem()
} else {
this.saveInfo()
}
})
}
// privacyOnChange() {
// this.setState({
// isAgree: true
// }, () => {
// if (this.state.wxUserInfo) {
// this.getFormItem()
// } else {
// this.saveInfo()
// }
// })
// }
render() {
const {
@@ -283,8 +283,8 @@ export default class UserInfo extends Component {
regParams,
showCheckboxPanel,
option_list,
showPrivacy,
wxUserInfo
// showPrivacy,
// wxUserInfo
} = this.state
const { colors, memberData } = this.props
@@ -460,7 +460,7 @@ export default class UserInfo extends Component {
</View>
) : null}
<SpFloatPrivacy
{/* <SpFloatPrivacy
isOpened={showPrivacy}
wxUserInfo={wxUserInfo}
onClose={() =>
@@ -470,7 +470,7 @@ export default class UserInfo extends Component {
})
}
onChange={this.privacyOnChange.bind(this)}
/>
/> */}
</View>
)
}

View File

@@ -35,7 +35,7 @@
.coupon-list-ticket {
padding-top: 45px;
/* #ifdef h5 */
padding-top: $navigate-height-h5 + 45px;
padding-top: 55px;
/* #endif */
}

View File

@@ -683,19 +683,6 @@ export default class CartCheckout extends Component {
data = await api.cart.total(params)
} catch (e) {
this.resolvePayError(e)
// let pages = pages = Taro.getCurrentPages()
// let currentPage = pages[pages.length - 2]
// let option = currentPage.options
// console.log(pages, 'page', currentPage.route, currentPage.options)
// let arr = []
// Object.keys(option).forEach((key) => {
// arr.push(key+ '=' + option[key])
// })
// console.log(arr, 'att', currentPage.route + '?' + arr.join('&'))
// Taro.redirectTo({
// url: currentPage.route + '?' + arr.join('&')
// })
if (init) Taro.navigateBack()
}
if (!data) return
@@ -1068,6 +1055,8 @@ export default class CartCheckout extends Component {
}
}
})
} else if (e.res.status_code === 422) {
Taro.navigateBack()
}
}
@@ -1257,7 +1246,7 @@ export default class CartCheckout extends Component {
...params,
pay_type: this.state.total.freight_type === 'point' ? 'point' : 'wxpay'
})
redirectUrl(api, `/subpage/pages/cashier/index?order_id=${config.order_id}&type=pointitem`)
redirectUrl(api, `/subpage/pages/cashier/index?order_id=${config.order_id}`)
// Taro.redirectTo({
// url: `/subpage/pages/cashier/index?order_id=${config.order_id}&payType=${payType}&type=pointitem`

View File

@@ -12,7 +12,8 @@ import {
GoodsItem,
SpLogin
} from "@/components";
import { log, navigateTo, pickBy, classNames,showLoading,hideLoading } from '@/utils'
import { log, navigateTo, pickBy, classNames, showLoading, hideLoading } from '@/utils'
import { setPageTitle } from '@/utils/platform'
import debounce from 'lodash/debounce'
import api from '@/api'
import S from '@/spx'
@@ -75,7 +76,7 @@ export default class CartIndex extends Component {
}
componentDidMount() {
console.log(this.$router.params, 48);
setPageTitle('购物车')
if (this.$router.params && this.$router.params.path === "qrcode") {
this.setState({
isPathQrcode: true

View File

@@ -14,8 +14,8 @@ import {
} from '@/components'
import req from '@/api/req'
import api from '@/api'
import { pickBy, classNames, isArray, isAlipay, payTypeField } from '@/utils'
import { platformTemplateName } from '@/utils/platform'
import { pickBy, classNames, isArray, isAlipay, isWeixin, payTypeField } from '@/utils'
import { platformTemplateName, setPageTitle } from '@/utils/platform'
import entry from '@/utils/entry'
import { withPager, withBackToTop } from '@/hocs'
import S from '@/spx'
@@ -86,8 +86,9 @@ export default class Home extends Component {
}
}
componentDidMount() {
componentDidMount() {
setPageTitle('微商城')
this.protocolUpdateTime();
this.getShareSetting();
this.isShowTips();
@@ -777,7 +778,7 @@ export default class Home extends Component {
{/* 返回顶部 */}
<BackToTop show={showBackToTop} onClick={this.scrollBackToTop.bind(this)} />
{/* addTip */}
{isShowAddTip && !isAlipay && (
{isShowAddTip && isWeixin && (
<View className='add_tip'>
<View class='tip-text'>点击添加到我的小程序微信首页下拉即可快速访问店铺</View>
<View className='icon-close icon-view' onClick={this.handleClickCloseAddTip.bind(this)}>

View File

@@ -42,6 +42,7 @@ import {
isAlipay,
isWeixin
} from '@/utils'
import { setPageTitle } from '@/utils/platform'
import entry from '@/utils/entry'
import S from '@/spx'
import { Tracker } from '@/service'
@@ -439,10 +440,11 @@ export default class EspierDetail extends Component {
}
}
if (this.$router.path === '/pages/item/espier-detail') {
Taro.setNavigationBarTitle({
title: info.item_name
})
if ( this.$router.path === '/pages/item/espier-detail' ) {
setPageTitle(info.item_name)
// Taro.setNavigationBarTitle({
// title: info.item_name
// })
}
if (marketing === 'group' || marketing === 'seckill' || marketing === 'limited_time_sale') {

View File

@@ -4,20 +4,20 @@
background: $color-bg-gray;
/* #ifdef h5 */
padding-top: $navigate-height-h5;
&.inWeixin{
padding-top:0;
// &.inWeixin{
// padding-top:0;
.goods-list{
&__toolbar{
top: 0;
}
&__scroll{
&.with-tag-bar{
@include page-scroll($tabs-height + $searchbar-height + $tags-height + 8, 0);
}
}
}
}
// .goods-list{
// &__toolbar{
// top: 0;
// }
// &__scroll{
// &.with-tag-bar{
// @include page-scroll($tabs-height + $searchbar-height + $tags-height + 8, 0);
// }
// }
// }
// }
/* #endif */
.goods-list {
margin: 0 -10px;
@@ -92,9 +92,9 @@
@include page-scroll($tabs-height + $searchbar-height + $navigate-height-h5 + 8, 0);
/* #endif */
&.with-tag-bar {
@include page-scroll($tabs-height + $searchbar-height + $tags-height + $navigate-height + 8, 0);
@include page-scroll($tabs-height + $searchbar-height + $navigate-height + 20, 0);
/* #ifdef h5 */
@include page-scroll($tabs-height + $searchbar-height + $tags-height + $navigate-height-h5 + 8, 0);
@include page-scroll($tabs-height + $searchbar-height + $tags-height + $navigate-height-h5 + 15, 0);
/* #endif */
}
}

View File

@@ -14,6 +14,7 @@ import {
classNames,
isWeixin
} from '@/utils'
import { setPageTitle } from '@/utils/platform'
import { customName } from '@/utils/point'
import userIcon from '@/assets/imgs/user-icon.png'
import MemberBanner from './comps/member-banner'
@@ -77,6 +78,7 @@ export default class MemberIndex extends Component {
}
componentWillMount() {
setPageTitle('会员中心')
this.fetch();
this.getSetting();
this.getPrivacyTitle();

View File

@@ -32,7 +32,7 @@ class Spx {
constructor(options = {}) {
this.hooks = []
this.options = {
autoRefreshToken: true,
autoRefreshToken: false, // 关闭主动刷新token
...options
}

View File

@@ -74,6 +74,7 @@
}
}
.pay-rule-style {
word-break: break-word;
padding: 30px;
}
@@ -115,8 +116,8 @@
margin-right: 8px;
font-family: SimSun, sans-serif;
}
.page-member-integral {
/* #ifdef h5 */
padding-top: $navigate-height-h5;
/* #endif */
}
// .page-member-integral {
// /* #ifdef h5 */
// padding-top: $navigate-height-h5;
// /* #endif */
// }

View File

@@ -35,9 +35,7 @@ export default class WeappBtn extends Component {
order_type: orderType
}
const res = await api.cashier.getPayment(params)
console.log('res-------------')
console.log(res)
const res = await api.cashier.getPayment(params)
// eslint-disable-next-line
const loc = location
const redirect_url = `${loc.protocol}//${loc.host}/subpage/pages/cashier/cashier-result?order_id=${order_id}`

View File

@@ -21,10 +21,7 @@ export default class Cashier extends Component {
this.fetch()
}
async componentDidMount(){
console.log("aaa")
// let res = await api.member.getTradePaymentList({platform:'h5'});
// console.log("===res==",res)
async componentDidMount(){
const { isHasAlipay } = await getPaymentList();
this.setState({
isHasAlipay

View File

@@ -16,7 +16,9 @@ import {
getPointName,
classNames,
isNavbar,
isWbWechat
isWbWechat,
isWeb,
redirectUrl
} from '@/utils'
import { transformTextByPoint } from '@/utils/helper'
import { Tracker } from '@/service'
@@ -297,6 +299,12 @@ export default class TradeDetail extends Component {
order_id,
order_type
}
if(isWeb){
redirectUrl(api, `/subpage/pages/cashier/index?order_id=${order_id}`)
return ;
}
const config = await api.cashier.getPayment(paymentParams)
this.setState({

View File

@@ -29,7 +29,7 @@
z-index: $z-index-toolbar;
}
&__item {
height: $tabs-height;
// height: $tabs-height;
color: $color-brand-accent-light;
}
&__item-underline {

View File

@@ -14,8 +14,7 @@ import {
isNavbar,
formatTime
} from '@/utils'
import PaymentPicker from '@/pages/cart/comps/payment-picker'
import { customName } from '@/utils/point'
import PaymentPicker from '@/pages/cart/comps/payment-picker'
import userIcon from '@/assets/imgs/user-icon.png'
import './vipgrades.scss'
@@ -137,7 +136,8 @@ export default class VipIndex extends Component {
})
}
async handleCharge() {
handleCharge=async ()=>{
if (!S.getAuthToken()) {
Taro.showToast({
title: '请先登录再购买',
@@ -150,8 +150,9 @@ export default class VipIndex extends Component {
return
}
const { list, curTabIdx, curCellIdx, payType } = this.state
const vip_grade = list[curTabIdx]
const params = {
vip_grade_id: vip_grade.vip_grade_id,
@@ -159,13 +160,15 @@ export default class VipIndex extends Component {
distributor_id: Taro.getStorageSync('trackIdentity').distributor_id || '',
pay_type: payType
}
showLoading({ mask: true })
const data = await api.vip.charge(params)
hideLoading()
var config = data
var that = this
wx.requestPayment({
@@ -286,9 +289,9 @@ export default class VipIndex extends Component {
tabList={tabList}
onClick={this.handleClickTab}
>
{tabList.map((panes, pIdx) => (
{/* {tabList.map((panes, pIdx) => (
<AtTabsPane current={curTabIdx} key={panes.title} index={pIdx}></AtTabsPane>
))}
))} */}
</AtTabs>
</View>
<View className='pay-box'>