Commit ff866d90 by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !34
2 parents b8161a46 ec5fa653
......@@ -3,7 +3,8 @@
import api from '../../restapi'
const util = require('../../../utils/util.js')
const app = getApp()
import { orderPosterImgUrl } from '~/config'
import { orderPosterImgUrl, envIndex } from '~/config'
// console.log(orderPosterImgUrl);
Page({
/**
* 页面的初始数据
......@@ -60,9 +61,13 @@ Page({
console.log(decodeURIComponent(options.scene))
let id = decodeURIComponent(options.scene).split('=')[1]
if (!id) {
throw new Error('id缺失')
}
// console.log(id)
//获取门店信息
this.getMerthcantInfo(id)
// 获取用户隐私协议配置
this.getTitleByModule()
// this.navToUserCollaboration()
......@@ -74,7 +79,40 @@ Page({
wx.$router.go('userCollaboration')
// console.log(wx.$router.getRouterList())
},
getMiniAppConfig(id) {
console.log(id, 'id');
let that = this
const target = ['develop', 'develop', 'test', 'production', 'beta']
wx.request({
// url: `${domain}${path}?method=${method}`,
url: `https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-weapp-smartshop-miniapp&env=${target[envIndex]}`,
// data,
method: 'GET',
// header,
dataType: 'json',
responseType: 'text',
success(response) {
// app.globalData.configInfo = response.data
let { statusCode, data: { disabledList } } = response
console.log(statusCode, 'statusCode');
if (statusCode == 200) {
let merchantDisabled = disabledList.some(item => item.merchantId == id)
that.setData({
merchantDisabled
})
}
// console.log(data.disabledList, 'response');
// resolve(response.data)
},
fail(error) {
console.log(error, 'error')
},
complete() {
// wx.stopPullDownRefresh()
// wx.hideNavigationBarLoading()
}
})
},
navWarrantyCard() {
// console.log('navWebview')
// console.log(wx.$router.getRouterList())
......@@ -126,6 +164,10 @@ Page({
})
// 区分是流量方还是园区店
let isYqType = Boolean(op?.merchantId)
// console.log(op.merchantId,op.shopMerchantId,'请求接口门店id缺失');
if (!op.merchantId && !op.shopMerchantId) {
throw new Error('请求接口门店id缺失')
}
this.setData({
...op,
isYqType
......@@ -133,7 +175,7 @@ Page({
// 获取质保卡配置
isYqType && this.getwxQrcode()
this.getMiniAppConfig(op.merchantId || op.shopMerchantId)
//util.showLoading('加载中...')
console.log(op)
// this.getInfo(op)
......@@ -240,8 +282,8 @@ Page({
// 支付
handlePay() {
let _this = this
const { payMoney, merchantId, isYqType, shopMerchantId, openId, unPayMoneyList, userCollaborationName, userCollaborationCheck } = this.data
if (userCollaborationName && !userCollaborationCheck) {
const { payMoney, merchantId, isYqType, shopMerchantId, openId, unPayMoneyList, userCollaborationName, userCollaborationCheck, merchantDisabled } = this.data
if (userCollaborationName && !userCollaborationCheck && !merchantDisabled) {
return util.showToast(`请先阅读并勾选《${userCollaborationName}》`)
}
if (payMoney === '' || unPayMoneyList.includes(payMoney)) return
......@@ -261,6 +303,10 @@ Page({
// 调用支付接口生成对应的微信支付参数
// console.log(params)
// return
if (!params.merchantId && !params.shopMerchantId) {
throw new Error('门店id缺失')
// throw '门店id缺失'
}
api.createWxPayOrderH5(
params,
res => {
......@@ -377,6 +423,6 @@ Page({
posterUrl: result.data
})
})
.catch(err => {})
.catch(err => { })
}
})
<!-- packagesPayment/pages/QRPayment/QRPayment.wxml -->
<!-- 二维码支付 -->
<view wx:if="{{ unpaid }}">
<!-- <web-view src="https://img02.glsx.com.cn/zfSPSBsHw1.txt" /> -->
<view class="pay-container" catchtap="handleHiddenKey">
<view class="pay-header payCompanyInfo">
<!-- <view class=""> -->
<image class="shopIcon" src="../../../images/shopIcon.png" />
<view class="company" wx:if="{{ isYqType }}">
<view class="company-name">深圳市嘀加智慧云服务有限公司</view>
<view class="company-yqd">{{merchantName}}</view>
</view>
<view class="company center" wx:else>
<!-- <view class="company-name" >深圳市嘀加智慧云服务有限公司</view> -->
<view class="company-name">{{shopMerchantName}}</view>
</view>
<!-- 付款给企业 -->
<!-- <view class="company-name">(深圳****公司)</view> -->
<!-- </view> -->
</view>
<view class="pay-main">
<!-- <view class="pay-money-title">付款金额</view> -->
<view class="pay-input-wrapper" catchtap="handleShowKey">
<!-- <text class="pay-icon">¥</text> -->
<text class="pay-icon">金额</text>
<view hidden="{{ !payMoney }}" class="pay-money">{{ payMoney }}</view>
<view hidden="{{ keyHidden }}" class="pay-cursor" />
<view class="pay-after-icon">元</view>
</view>
<view class="userCollaborationContainer" wx:if="{{ userCollaborationName }}">
<!-- <label class="radio"> value="{{userCollaborationCheck}}" -->
<radio class="radio" style="transform:scale(0.6)" checked="{{ userCollaborationCheck }}" catchtap="handleRadio" />
<view catchtap="handleRadio" class="label">我已阅读并同意</view>
<!-- </label> -->
<view class="linkText" catchtap="navToUserCollaboration">《{{userCollaborationName}}》</view>
</view>
</view>
</view>
<view class="keyboard {{ !keyHidden && 'hind_box' }}">
<view class="key-box">
<view class="number-box clearfix">
<view
wx:for="{{ KeyboardKeys }}"
wx:key="*this"
data-key="{{ item }}"
class="key {{ index === 9 ? 'key-zero' : '' }}"
hover-class="number-box-hover"
catchtap="handleKey"
>{{item}}</view>
</view>
<view class="btn-box">
<!-- TODO: 需要替换成删除icon -->
<view class="key deletKey" hover-class="number-box-hover" data-key="X" catchtap="handleKey">
<!-- X -->
<image class="deletIcon" src="../../../images/deleteIcon.png" />
</view>
<view class="key pay_btn {{ payMoney&&canPay ? '' : 'pay-btn-display' }}" hover-class="pay-btn-hover" catchtap="handlePay">付款</view>
</view>
</view>
</view>
<!-- <web-view src="https://img02.glsx.com.cn/zfSPSBsHw1.txt" /> -->
<view class="pay-container" catchtap="handleHiddenKey">
<view class="pay-header payCompanyInfo">
<!-- <view class=""> -->
<image class="shopIcon" src="../../../images/shopIcon.png" />
<view class="company" wx:if="{{ isYqType }}">
<view class="company-name">深圳市嘀加智慧云服务有限公司</view>
<view class="company-yqd">{{merchantName}}</view>
</view>
<view class="company center" wx:else>
<!-- <view class="company-name" >深圳市嘀加智慧云服务有限公司</view> -->
<view class="company-name">{{shopMerchantName}}</view>
</view>
<!-- 付款给企业 -->
<!-- <view class="company-name">(深圳****公司)</view> -->
<!-- </view> -->
</view>
<view class="pay-main">
<!-- <view class="pay-money-title">付款金额</view> -->
<view class="pay-input-wrapper" catchtap="handleShowKey">
<!-- <text class="pay-icon">¥</text> -->
<text class="pay-icon">金额</text>
<view hidden="{{ !payMoney }}" class="pay-money">{{ payMoney }}</view>
<view hidden="{{ keyHidden }}" class="pay-cursor" />
<view class="pay-after-icon">元</view>
</view>
<block wx:if="{{!merchantDisabled}}">
<view class="userCollaborationContainer" wx:if="{{ userCollaborationName }}">
<!-- <label class="radio"> value="{{userCollaborationCheck}}" -->
<radio class="radio" style="transform:scale(0.6)" checked="{{ userCollaborationCheck }}" catchtap="handleRadio" />
<view catchtap="handleRadio" class="label">我已阅读并同意</view>
<!-- </label> -->
<view class="linkText" catchtap="navToUserCollaboration">《{{userCollaborationName}}》</view>
</view>
</block>
</view>
</view>
<view class="keyboard {{ !keyHidden && 'hind_box' }}">
<view class="key-box">
<view class="number-box clearfix">
<view wx:for="{{ KeyboardKeys }}" wx:key="*this" data-key="{{ item }}" class="key {{ index === 9 ? 'key-zero' : '' }}" hover-class="number-box-hover" catchtap="handleKey">{{item}}</view>
</view>
<view class="btn-box">
<!-- TODO: 需要替换成删除icon -->
<view class="key deletKey" hover-class="number-box-hover" data-key="X" catchtap="handleKey">
<!-- X -->
<image class="deletIcon" src="../../../images/deleteIcon.png" />
</view>
<view class="key pay_btn {{ payMoney&&canPay ? '' : 'pay-btn-display' }}" hover-class="pay-btn-hover" catchtap="handlePay">付款</view>
</view>
</view>
</view>
</view>
<view wx:if="{{ !unpaid }}">
<!-- <view>支付成功</view> -->
<view class="success-Container">
<view class="poster">
<image class="posetrimg" show-menu-by-longpress="true" mode="widthFix" src="{{ posterUrl }}" />
</view>
<!-- <view class="amountOfMoney">¥ {{payMoney}}</view>
<!-- <view>支付成功</view> -->
<view class="success-Container">
<view class="poster">
<image class="posetrimg" show-menu-by-longpress="true" mode="widthFix" src="{{ posterUrl }}" />
</view>
<!-- <view class="amountOfMoney">¥ {{payMoney}}</view>
<view class="success-tips">
<image class="successIcon" src="../../../images/successIcon.png" />
支付成功
......@@ -87,30 +82,26 @@
<view class="label">支付时间</view>
<view class="info">{{dataTime}}</view>
</view> -->
<!-- <block wx:for="{{orderInfoList}}" wx:for-item="item" wx:key="index">
<!-- <block wx:for="{{orderInfoList}}" wx:for-item="item" wx:key="index">
<view class="orderInfo" wx:if="{{item.info}}">
<view class="label">{{item.label}}</view>
<view class="info">{{item.info}}</view>
</view>
</block> -->
<view class="footerCon">
<!-- bindlongpress="navWebview" show-menu-by-longpress="true" -->
<!-- <image bindlongpress="navWarrantyCard" class="wxqrCon" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/minizhibaoka.png" /> -->
<!-- <image show-menu-by-longpress="true" class="wxqrCon" src="https://dj.glsx.com.cn/dj-wxaqrcode/aeabc3a60a328e8c536588686eec016b.png" /> -->
<!-- wx:if="{{workWechatQrcode}}" -->
<block wx:if="{{ qrcodeType== 1 }}">
<view class="wxTips">长按识别扫码领取质保卡</view>
<image
bindlongpress="navWarrantyCard"
class="wxqrCon"
src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/minizhibaoka.png"
/>
</block>
<block wx:if="{{ qrcodeType== 2 }}">
<view class="wxTips">长按识别添加客服</view>
<image show-menu-by-longpress="true" class="wxqrCon" src="{{ workWechatQrcode }}" />
</block>
<image class="logoIcon" src="../../../images/djLogin.png" />
</view>
</view>
<view class="footerCon">
<!-- bindlongpress="navWebview" show-menu-by-longpress="true" -->
<!-- <image bindlongpress="navWarrantyCard" class="wxqrCon" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/minizhibaoka.png" /> -->
<!-- <image show-menu-by-longpress="true" class="wxqrCon" src="https://dj.glsx.com.cn/dj-wxaqrcode/aeabc3a60a328e8c536588686eec016b.png" /> -->
<!-- wx:if="{{workWechatQrcode}}" -->
<block wx:if="{{ qrcodeType== 1 }}">
<view class="wxTips">长按识别扫码领取质保卡</view>
<image bindlongpress="navWarrantyCard" class="wxqrCon" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/minizhibaoka.png" />
</block>
<block wx:if="{{ qrcodeType== 2 }}">
<view class="wxTips">长按识别添加客服</view>
<image show-menu-by-longpress="true" class="wxqrCon" src="{{ workWechatQrcode }}" />
</block>
<image class="logoIcon" src="../../../images/djLogin.png" />
</view>
</view>
</view>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!