Commit ff866d90 by 前端

Merge branch 'develop' into 'master'

Develop

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