Commit 23ebe04a by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !19
2 parents 9adea726 053518b5
...@@ -260,7 +260,7 @@ App({ ...@@ -260,7 +260,7 @@ App({
* 登录成功回调 * 登录成功回调
*/ */
loginSuccessCallback: function (userInfo) { loginSuccessCallback: function (userInfo) {
console.log(userInfo) // console.log(userInfo)
this.globalData.userInfo = userInfo this.globalData.userInfo = userInfo
this.globalData.accountId = userInfo.accountId this.globalData.accountId = userInfo.accountId
// this.getCustomerMessageNew(userInfo.accountId) // this.getCustomerMessageNew(userInfo.accountId)
......
/**
* 用来配置小程序项目的变量
* 统一管理
*/
/**
* 环境指定
* 0本地
* 1开发
* 2测试
* 3生产环境
*/
let index = 1
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
const envName = accountInfo.miniProgram.envVersion
//手动控制体验版环境的请求 true就依据下面index false就默认为2
const manual = false
const release = false
// 判断小程序环境
// develop:开发版 trial:体验版 release:正式版
if (systemInfo.platform != 'devtools') {
switch (envName) {
case 'develop':
break
case 'trial':
index = manual ? index : 2
break
case 'release':
index = release ? index : 3
break
default:
index = 3
break
}
}
export const env = envName
export const envIndex = index
const createOrderPosterImgUrl = {
develop: `http://192.168.1.178:9528/dj-scrm-wx-work-main-zhangls/#/orderDetailPoster?`,
trial: `http://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/orderDetailPoster?`,
release: `https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/orderDetailPoster?`
}
const target = ['ip', 'develop', 'trial', 'release', 'preRelease']
// 订单详情地址
export const orderPosterImgUrl = createOrderPosterImgUrl[target[envIndex]]
// 配置预发布的小程序aapId
// export const preReleaseAppId = 'wx24ebae5768e74138'
// 小程序id
// export const appId = 'wx570d9331f9ace0bd'
// sentry Dsn 地址
// export const dsnUrl = 'https://ddaadc52bf8d4ecc92eca632683d456a@sentry.glsx.com.cn/23'
// 图片基地址
// export const ImgUrl = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat'
// packageCrowdfunding/components/createImage/index.js
import Draw from '~/utils/Draw'
import { IMG_URL } from '~/utils/constantData'
Component({
externalClasses: ['custom-class', 'class'],
/**
* 组件的属性列表
*/
properties: {
mode: {
type: String,
value: 'widthFix'
},
orderInfo: {
type: Object,
value: {},
observer: function (n) {
if (n) {
const fn = wx.getFileSystemManager()
fn.readdir({
dirPath: wx.env.USER_DATA_PATH,
success({ files }) {
files.length &&
files.map(e => {
fn.unlink({
filePath: `${wx.env.USER_DATA_PATH}/${e}`
})
})
}
})
let _this = this
_this.drawOrderImg()
}
}
}
},
/**
* 组件的初始数据
*/
data: {
ctx: '',
imagePath: ''
},
/**
* 组件的方法列表
*/
methods: {
// 画图
async drawOrderImg(callBack) {
let _this = this
let { plateNo, payPrice, userName, goodsName, orderNumber, orderStatus, goodsNumber, createdDate, vehicleBrandName, vehicleShapeName, formContentFirst, vehicleSeriesName, formDescribeFirst, formContentSecond, formDescribeSecond, vehicleSubBrandName, phone } = this.data.orderInfo
let valueX = 95,
labelX = 17,
fontSize = 14,
valueEndX = 320 - fontSize / 2,
textBaseline = 'top',
canvasWidth = 337,
canvasHeight = 561,
carText = '',
labelList = ['客户姓名:'],
spacing = 0,
textYList = [],
labelEndX = 80,
lineNum = 2,
lineHeight = 24,
valueList = [userName]
const draw = new Draw(
{
width: canvasWidth,
height: canvasHeight
},
_this
)
if (phone) {
labelList.push('手机号:')
valueList.push(phone)
}
if (plateNo) {
labelList.push('车牌号:')
valueList.push(plateNo)
}
if (vehicleBrandName) {
carText = `${vehicleBrandName || ''} ${vehicleSubBrandName || ''} ${vehicleSeriesName || ''} ${vehicleShapeName || ''}`
labelList.push('车型:')
valueList.push(carText)
}
console.log(new Date(createdDate).format('yyyy年M月d日 hh:mm:ss'))
labelList = [...labelList, '商品名称:', '支付时间:']
// valueList = [...valueList, `${goodsName}${goodsNumber > 1 ? `*${goodsNumber}` : ''}` , new Date(createdDate).format('yyyy年M月d日 hh:mm:ss')]
valueList = [...valueList, goodsName, new Date(createdDate).format('yyyy年M月d日 hh:mm:ss')]
if (orderStatus != 10 && orderNumber) {
labelList.push('订单号:')
valueList.push(orderNumber)
}
if (formContentFirst) {
labelList.push(formDescribeFirst)
valueList.push(formContentFirst)
}
if (formContentSecond) {
labelList.push(formDescribeSecond)
valueList.push(formContentSecond)
}
labelList.push('支付定金')
valueList.push(`${payPrice}元`)
labelList.map((e, index) => {
if (e == '商品名称:' && draw.getTextWidth(carText, fontSize) > valueEndX - valueX) spacing = lineHeight
if ((e == formDescribeSecond && draw.getTextWidth(formContentFirst, fontSize) > valueEndX - valueX) || (e === formDescribeSecond && draw.getTextWidth(formDescribeFirst, fontSize) > labelEndX - labelX)) spacing = lineHeight * 2
if (index == labelList.length - 1) textYList.push(493)
else textYList.push(index * 32 + 109 + spacing)
})
const imgName = {
8: '-2',
10: '-3'
}[orderStatus]
let textList = []
;(labelList || []).map((e, index) => {
let y = textYList[index] + fontSize / 2
let label = {
text: e,
x: labelX,
y,
color: '#999',
fontSize,
textBaseline
}
let value = {
text: valueList[index],
x: valueX,
y,
color: '#282829',
fontSize,
textBaseline,
width: valueEndX
}
if (e === '商品名称:') {
value.color = '#FC5B32'
value.lineNum = 3
}
if ((formDescribeFirst && e === formDescribeFirst) || (formDescribeSecond && e === formDescribeSecond) || e === '品牌车型:') {
value.lineNum = lineNum
value.lineHeight = lineHeight
if ((formDescribeFirst && e === formDescribeFirst) || (formDescribeSecond && e === formDescribeSecond)) {
label.lineNum = lineNum
label.lineHeight = lineHeight
label.width = labelEndX
label.lastFont = ':'
}
}
if (e === '支付定金') {
label.color = '#282829'
value.color = orderStatus == 8 ? '#3162E6' : '#F13C3D'
value.fontWeight = '600'
value.fontSize = 18
value.y = textYList[index] + 5
}
if (orderStatus == 10) {
textList.push({
text: '订单号',
x: labelX - 1,
y: 24,
color: '#282829',
fontSize,
textBaseline,
lineNum: 3
})
textList.push({
text: orderNumber || '',
x: labelX - 1,
y: 54,
color: '#282829',
fontSize,
textBaseline,
lineNum: 3
})
}
textList.push(label)
textList.push(value)
})
let res = await draw.begin({
imageList: [
{
url: `${IMG_URL}crowdfunding/order-bg${imgName || ''}.png`,
x: 0,
y: 0,
width: canvasWidth,
height: canvasHeight
}
],
textList: textList,
lineList: [
{
startX: labelX,
startY: 478,
endX: 320,
endY: 478,
width: 0.1,
color: '#F1F1F1'
}
]
})
this.setData({
imagePath: res.path
})
console.log(res.path)
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageCrowdfunding/components/createImage/index.wxss */
\ No newline at end of file \ No newline at end of file
<!--packageCrowdfunding/components/createImage/index.wxml-->
<image src="{{imagePath}}" class="custom-class" mode="{{mode}}" show-menu-by-longpress />
\ No newline at end of file \ No newline at end of file
/** // /**
* // *
0本地 // 0本地
1开发 // 1开发
2测试 // 2测试
3生产环境 // 3生产环境
*/ // */
const accountInfo = wx.getAccountInfoSync() // const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync() // const systemInfo = wx.getSystemInfoSync()
// console.log(systemInfo); // // console.log(systemInfo);
// console.log(accountInfo.miniProgram.envVersion) // // console.log(accountInfo.miniProgram.envVersion)
//手动控制体验版环境的请求 true就依据下面index false就默认为2 // //手动控制体验版环境的请求 true就依据下面index false就默认为2
const manual = false // const manual = false
const release = false // const release = false
let index = 3 // let index = 3
// 判断小程序环境 // // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // // develop:开发版(正常开发工具,测试时)
// trial:体验版 // // trial:体验版
// release:正式版 // // release:正式版
// console.log( systemInfo.platform); // // console.log( systemInfo.platform);
// console.log(accountInfo.miniProgram.envVersion); // // console.log(accountInfo.miniProgram.envVersion);
if (systemInfo.platform != 'devtools') { // if (systemInfo.platform != 'devtools') {
switch (accountInfo.miniProgram.envVersion) { // switch (accountInfo.miniProgram.envVersion) {
case 'develop': // case 'develop':
// this.globalData.url = 'http://192.168.0.252:3000/api'; // // // this.globalData.url = 'http://192.168.0.252:3000/api'; //
break // break
case 'trial': // case 'trial':
index = manual ? index : 2 // index = manual ? index : 2
break // break
case 'release': // case 'release':
index = release? index : 3 // index = release? index : 3
break // break
default: // default:
index = 3 // index = 3
break // break
} // }
} // }
import { envIndex } from '~/config'
let index = envIndex
// console.log(index); // console.log(index);
const secretKey_items = { const secretKey_items = {
...@@ -60,7 +62,7 @@ const secretKey_items = { ...@@ -60,7 +62,7 @@ const secretKey_items = {
} }
const domain_items = { const domain_items = {
// ip: 'http://192.168.2.59:8292', // ip: 'http://192.168.2.59:8292',
ip:'http://192.168.1.129:8392', ip: 'http://192.168.1.129:8392',
// ip: 'http://192.168.2.3:8292', // ip: 'http://192.168.2.3:8292',
dev: 'https://dj.dev.glsx.com.cn', dev: 'https://dj.dev.glsx.com.cn',
uat: 'https://dj.test.glsx.com.cn', uat: 'https://dj.test.glsx.com.cn',
......
...@@ -28,6 +28,7 @@ const sign = (params, secret, noSignAttr = []) => { ...@@ -28,6 +28,7 @@ const sign = (params, secret, noSignAttr = []) => {
} }
realObj[key] = obj realObj[key] = obj
} }
// console.log(noSignAttr,'noSignAttr');
keys.forEach(e => { keys.forEach(e => {
!noSignAttr.includes(e) && str.push(e + realObj[e]) !noSignAttr.includes(e) && str.push(e + realObj[e])
}) })
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
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'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -26,6 +27,7 @@ Page({ ...@@ -26,6 +27,7 @@ Page({
{ name: 'tradeNo', label: '流水号', info: '' }, { name: 'tradeNo', label: '流水号', info: '' },
{ name: 'payTime', label: '支付时间', info: '' } { name: 'payTime', label: '支付时间', info: '' }
], ],
posterUrl: '',
openId: 'oQ6Sh5cGirPd55Oc1J1oJSRpboFM', openId: 'oQ6Sh5cGirPd55Oc1J1oJSRpboFM',
// openId: '', // openId: '',
outTradeNo: '', outTradeNo: '',
...@@ -42,7 +44,8 @@ Page({ ...@@ -42,7 +44,8 @@ Page({
onLoad: function (options) { onLoad: function (options) {
// console.log('app', app.globalData.login()) // console.log('app', app.globalData.login())
// console.log(aa) // console.log(aa)
// 开发用
// this.getOrderScreenShot()
this.gteOpenId() this.gteOpenId()
wx.hideHomeButton({ wx.hideHomeButton({
success: function () { success: function () {
...@@ -317,7 +320,7 @@ Page({ ...@@ -317,7 +320,7 @@ Page({
}) })
_this.setData({ _this.setData({
unpaid: false, unpaid: false,
dataTime: new Date().format('yyyy/MM/dd hh:mm') dataTime: new Date().format('yyyy年MM月dd hh:mm:ss')
// showOrderInfo: data ? true : false, // showOrderInfo: data ? true : false,
// orderInfoList // orderInfoList
}) })
...@@ -335,31 +338,39 @@ Page({ ...@@ -335,31 +338,39 @@ Page({
}, },
// 支付成功获取订单回调信息 // 支付成功获取订单回调信息
successInfo() { // successInfo() {
let { outTradeNo, orderInfoList, showOrderInfo } = this.data // let { outTradeNo, orderInfoList, showOrderInfo } = this.data
api.queryPayOrderStatus( // api.queryPayOrderStatus(
{ outTradeNo }, // { outTradeNo },
res => { // res => {
util.hideLoading() // util.hideLoading()
console.log(res) // console.log(res)
let { data, returnCode } = res // let { data, returnCode } = res
if (returnCode == 0) { // if (returnCode == 0) {
data && // this.setData({
orderInfoList.forEach(element => { // orderCode: data.orderCode
element['info'] = data[element['name']] // })
}) // this.getOrderScreenShot()
this.setData({ // }
unpaid: false, // },
showOrderInfo: data ? true : false, // rej => {
orderInfoList // console.log(rej)
}) // util.hideLoading()
} // }
// let { returnCode, data } = res // )
}, // },
rej => { getOrderScreenShot() {
console.log(rej) let { merchantName, dataTime, outTradeNo } = this.data
util.hideLoading() let params = JSON.stringify({ merchantName, formatAccountDate: dataTime, selectPayType: 1, outTradeNo, payMoney })
} api
) .orderScreenShot({ url: orderPosterImgUrl + 'orderInfo=' + params })
.then(result => {
// this.poster = res.data
console.log(result, 'poster')
this.setData({
posterUrl: result.data
})
})
.catch(err => {})
} }
}) })
...@@ -73,7 +73,10 @@ ...@@ -73,7 +73,10 @@
<view wx:if="{{!unpaid}}"> <view wx:if="{{!unpaid}}">
<!-- <view>支付成功</view> --> <!-- <view>支付成功</view> -->
<view class="success-Container"> <view class="success-Container">
<view class="amountOfMoney">¥ {{payMoney}}</view> <view class="poster">
<image class="posetrimg" mode="widthFix" src="{{posterUrl}}" />
</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" />
支付成功 支付成功
...@@ -94,7 +97,7 @@ ...@@ -94,7 +97,7 @@
<view class="orderInfo"> <view class="orderInfo">
<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>
......
...@@ -233,7 +233,7 @@ ...@@ -233,7 +233,7 @@
} }
.success-Container { .success-Container {
padding: 100rpx 76rpx 0; padding: 10rpx 0 0;
text-align: center; text-align: center;
background-color: #fff; background-color: #fff;
height: 100vh; height: 100vh;
...@@ -324,4 +324,19 @@ ...@@ -324,4 +324,19 @@
width: 200rpx; width: 200rpx;
height: 50rpx; height: 50rpx;
}
.poster {
box-sizing: border-box;
margin: 20rpx auto;
width: 710rpx;
/* height: 964rpx; */
background: #FFFFFF;
box-shadow: 0 4rpx 20rpx 0 #0000001a;
border-radius: 16rpx;
}
.posetrimg {
width: 100%;
/* height: 100%; */
} }
\ No newline at end of file \ No newline at end of file
...@@ -3,167 +3,186 @@ const filter = require('../../../utils/filter.js') ...@@ -3,167 +3,186 @@ const filter = require('../../../utils/filter.js')
var app = getApp() var app = getApp()
import api from '../../restapi' import api from '../../restapi'
import util from '../../../utils/util.js' import util from '../../../utils/util.js'
import { orderPosterImgUrl } from '~/config'
Page( Page(
// { // {
filter.identityFilter({ filter.identityFilter({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
authToast: false, // 是否显示授权提示框 authToast: false, // 是否显示授权提示框
authType: true, // 授权类型(true:授权用户信息;false:授权手机号) authType: true, // 授权类型(true:授权用户信息;false:授权手机号)
sceneId: '', sceneId: '',
ajaxing: false, ajaxing: false,
paySuccess: false paySuccess: false,
// paySuccess: true posterUrl: 'https://wx.glsx.com.cn/upload/biz/646958380279271424.png'
}, },
onLogin() { onLogin() {
util.showLoading('加载中...') // util.showLoading('加载中...')
this.getScenInfo() this.data.sceneId && this.getScenInfo()
console.log(app.globalData) // console.log(app.globalData)
// if (app.globalData.userInfo || app.globalData.userInfo.phone) { // if (app.globalData.userInfo || app.globalData.userInfo.phone) {
// } // }
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
// options.scene = 'sceneId=10689' // 开发用
// this.getOrderDetail()
// this.getOrderScreenShot()
// options.scene = 'sceneId=10689'
// let options = { // let options = {
// scene: 'sceneId=6783' // scene: 'sceneId=6783'
// } // }
// console.log(options, 'options') // console.log(options, 'options')
wx.hideHomeButton({ wx.hideHomeButton({
success: function () { success: function () {
console.log('隐藏成功!') // console.log('隐藏成功!')
} }
}) })
console.log(options) // console.log(options)
let id = decodeURIComponent(options.scene).split('=')[1] let id = decodeURIComponent(options.scene).split('=')[1]
console.log(id, 'id') // console.log(id, 'id')
this.setData({ this.setData({
sceneId: id sceneId: id
}) })
util.showLoading('加载中...')
this.getScenInfo()
},
/** id && this.getScenInfo()
* 生命周期函数--监听页面初次渲染完成 },
*/
onReady: function () {},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面初次渲染完成
*/ */
onShow: function () {}, onReady: function () {},
onUnload: function () { /**
this.setData({ * 生命周期函数--监听页面显示
ajaxing: false */
}) onShow: function () {},
},
// 获取订单信息 onUnload: function () {
getInfo: function (row) {
let _this = this
let oParams = {}
oParams.orderCode = row.orderCode
oParams.workWxSessionId = row.workWxSessionId
api.GETORDERINFO(oParams, res => {
util.hideLoading()
console.log(JSON.parse(res.data))
let o = res.data ? JSON.parse(res.data) : {}
this.setData({ this.setData({
o ajaxing: false
}) })
_this.wxPayment(o) },
}) getOrderScreenShot() {
}, const { orderCode } = this.data
api
// 调用微信支付 .orderScreenShot({ url: orderPosterImgUrl + 'orderCode='(orderCode || '230407155523620') })
wxPayment: function (row) { .then(result => {
let _this = this // this.poster = res.data
if (this.data.ajaxing) { console.log(result, 'poster')
return false this.setData({
} posterUrl: result.data
_this.setData({ })
ajaxing: true
})
wx.requestPayment({
nonceStr: row.nonceStr,
package: row.package,
paySign: row.paySign,
timeStamp: row.timeStamp,
signType: 'MD5',
success: function (res) {
console.log(res)
_this.setData({
paySuccess: true,
dataTime: new Date().format('yyyy/MM/dd hh:mm')
}) })
wx.setNavigationBarTitle({ .catch(err => {})
title: '支付成功' },
// 获取订单信息
getInfo: function (row) {
let _this = this
let oParams = {}
oParams.orderCode = row.orderCode
oParams.workWxSessionId = row.workWxSessionId
api.GETORDERINFO(oParams, res => {
util.hideLoading()
console.log(JSON.parse(res.data))
let o = res.data ? JSON.parse(res.data) : {}
this.setData({
o
}) })
// wx.redirectTo({ _this.wxPayment(o)
// url: '/packagePersonal/pages/boutiqueList/boutiqueList' })
// }) },
},
fail: function (error) {
// wx.switchTab({
// url: '/pages/tab/index/index'
// })
wx.showToast({
title: '支付失败',
icon: 'error'
})
// wx.showToast({
// title: '支付请求失败',
// icon: 'error'
// })
}
})
},
// 获取订单信息 // 调用微信支付
getScenInfo() { wxPayment: function (row) {
let id = this.data.sceneId let _this = this
console.log(this.data) if (this.data.ajaxing) {
// console.log(); return false
console.log(id) }
// debugger _this.setData({
if (id) { ajaxing: true
//let id = decodeURIComponent(options.scene).split('=')[1] })
//let id = options.sceneId; wx.requestPayment({
api.qrCodeScene( nonceStr: row.nonceStr,
{ package: row.package,
id paySign: row.paySign,
timeStamp: row.timeStamp,
signType: 'MD5',
success: function (res) {
console.log(res)
_this.setData({
paySuccess: true
// dataTime: new Date().format('yyyy/MM/dd hh:mm')
})
wx.setNavigationBarTitle({
title: '支付成功'
})
// 获取订单截图
_this.getOrderScreenShot()
// wx.redirectTo({
// url: '/packagePersonal/pages/boutiqueList/boutiqueList'
// })
}, },
res => { fail: function (error) {
let { returnCode, data } = res // wx.switchTab({
let op = {} // url: '/pages/tab/index/index'
console.log('dddddddddddddddddd') // })
if (returnCode == '0') { wx.showToast({
if (data) { title: '支付失败',
data.split('&').map(item => { icon: 'error'
const [key, val] = item.split('=') })
op[key] = val // wx.showToast({
}) // title: '支付请求失败',
this.setData({ // icon: 'error'
...op // })
}) }
//util.showLoading('加载中...') })
console.log(op) },
this.getInfo(op)
// 获取订单信息
getScenInfo() {
util.showLoading('加载中...')
let id = this.data.sceneId
console.log(this.data)
// console.log();
console.log(id)
// debugger
if (id) {
//let id = decodeURIComponent(options.scene).split('=')[1]
//let id = options.sceneId;
api.qrCodeScene(
{
id
},
res => {
let { returnCode, data } = res
let op = {}
console.log('dddddddddddddddddd')
if (returnCode == '0') {
if (data) {
data.split('&').map(item => {
const [key, val] = item.split('=')
op[key] = val
})
this.setData({
...op
})
//util.showLoading('加载中...')
console.log(op)
this.getInfo(op)
}
} }
} }
} )
) }
} }
} })
}) // }
// }
) )
{ {
"usingComponents": {}, "usingComponents": {
},
"navigationBarTitleText": "支付" "navigationBarTitleText": "支付"
} }
\ No newline at end of file \ No newline at end of file
<!--支付--> <!-- 支付 -->
<view class="page"> <!-- wx:if="{{orderInfo}}" -->
<view class="success-Container" wx:if="{{paySuccess}}"> <block wx:if="{{paySuccess}}">
<!-- <view class="amountOfMoney">¥ {{payMoney}}</view> --> <view class="poster">
<view class="success-tips"> <image class="posetrimg" mode="widthFix" src="{{posterUrl}}" />
<image class="successIcon" src="../../../images/successIcon.png" />
支付成功
</view>
<view class="line" />
<view class="orderInfo">
<view class="label">收款主体</view>
<view class="info">深圳市嘀加智慧云服务有限公司</view>
</view>
<!-- <view class="orderInfo">
<view class="label">商户名称</view>
<view class="info">{{merchantName || shopMerchantName}}</view>
</view> -->
<view class="orderInfo">
<view class="label">支付订单号</view>
<view class="info">{{orderCode}}</view>
</view>
<view class="orderInfo">
<view class="label">支付时间</view>
<view class="info">{{dataTime}}</view>
</view>
</view> </view>
</view>
<auth-setting auth='{{authToast}}' type='{{authType}}' index />
\ No newline at end of file \ No newline at end of file
<view class="footerCon">
<view class="wxTips">长按识别扫码领取质保卡</view>
<image bindlongpress="navWarrantyCard" class="wxqrCon" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/minizhibaoka.png" />
<image class="logoIcon" src="../../../images/djLogin.png" />
</view>
</block>
<auth-setting auth='{{authToast}}' type='{{authType}}' />
/* packagesPayment/pages/payment/index.wxss */ /* packagesPayment/pages/payment/index.wxss */
.success-Container { /* page {
padding: 100rpx 76rpx 0; padding: 20rpx;
text-align: center; } */
background-color: #fff;
height: 100vh;
}
.amountOfMoney {
font-size: 80rpx;
font-weight: 600;
}
.success-tips {
display: flex;
align-items: center;
justify-content: center;
font-size: 48rpx;
margin-bottom: 30rpx;
}
.successIcon {
width: 64rpx;
height: 64rpx;
margin-right: 30rpx;
}
.orderInfo {
display: flex;
justify-content: space-between;
}
.success-Container { .poster {
box-sizing: border-box; box-sizing: border-box;
display: flex; margin: 20rpx auto;
flex-direction: column; width: 710rpx;
/* justify-content: center; */ /* height: 964rpx; */
align-items: center; background: #FFFFFF;
} box-shadow: 0 4rpx 20rpx 0 #0000001a;
border-radius: 16rpx;
.success-Container .line {
height: 1px;
width: 100%;
margin: 28rpx 0;
background: #E5E5E5;
} }
.success-Container .orderInfo { .posetrimg {
width: 100%; width: 100%;
margin-bottom: 28rpx; /* height: 100%; */
}
.success-Container .label {
font-size: 30rpx;
color: #999;
}
.success-Container .info {
font-size: 30rpx;
color: #333;
flex: 1;
text-align: right;
max-width: 80%;
overflow: hidden;
text-overflow: ellipsis;
/* display: -webkit-box; */
white-space: nowrap;
} }
.footerCon { .footerCon {
margin-top: auto; box-sizing: border-box;
margin-bottom: 200rpx; width: 710rpx;
height: 558rpx;
background: #FFFFFF;
box-shadow: 0 4rpx 20rpx 0 #0000001a;
border-radius: 16rpx;
/* margin-top: auto; */
margin: auto auto 0rpx;
/* margin-bottom: 200rpx; */
padding: 44rpx 0 58rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
...@@ -84,7 +43,7 @@ ...@@ -84,7 +43,7 @@
.wxqrCon { .wxqrCon {
width: 306rpx; width: 306rpx;
height: 305rpx; height: 305rpx;
margin: 12rpx 0 84rpx; margin: 16rpx 0 50rpx;
Object-fit: contain; Object-fit: contain;
} }
......
...@@ -5,7 +5,33 @@ module.exports = { ...@@ -5,7 +5,33 @@ module.exports = {
GETORDERINFO: function (oParams, success, fail) { GETORDERINFO: function (oParams, success, fail) {
restapi.req('/web-dj-weapp/smartcarlife/goodsOrder/createWxPayOrder', oParams, {}, 'GET', 'json', 'text', success, fail) restapi.req('/web-dj-weapp/smartcarlife/goodsOrder/createWxPayOrder', oParams, {}, 'GET', 'json', 'text', success, fail)
}, },
/** 精品交付单订单详情列表 */
// getBoutiqueOrderDetail(data, success, fail) {
// api.get('boutiquedelivery/order/getDetail', data, success, fail)
// },
// req(`/web-dj-weapp/${link}`, data, header, method, 'json', 'text',
/** 精品交付单订单详情列表 */
// getBoutiqueOrderDetail: function (params, success, fail) {
// restapi.req(
// '/web-dj-weapp/boutiquedelivery/order/getDetail',
// // JSON.stringify(code),
// params, {},'GET', 'json', 'text', success,fail
// )
// },
getDetailByOrderCode(params, success, fail) {
// api.get('smartcarlife/goodsOrder/getDetailByOrderCode', data, success)
restapi.req(
'/web-dj-weapp/smartcarlife/goodsOrder/getDetailByOrderCode',
// JSON.stringify(code),
params,
{},
'GET',
'json',
'text',
success,
fail
)
},
/** /**
* 根据场景id获取场景值 * 根据场景id获取场景值
*/ */
...@@ -88,5 +114,9 @@ module.exports = { ...@@ -88,5 +114,9 @@ module.exports = {
/** 获取用户协议配置 */ /** 获取用户协议配置 */
getTitleByModule(data) { getTitleByModule(data) {
return api.post('dj.api.smartcarlife.privacyAgreement.getTitleByModule', data) return api.post('dj.api.smartcarlife.privacyAgreement.getTitleByModule', data)
},
/** 订单截图 */
orderScreenShot(data) {
return api.post('dj.api.smartcarlife.common.screenShot', data)
} }
} }
...@@ -116,9 +116,6 @@ module.exports = { ...@@ -116,9 +116,6 @@ module.exports = {
restapi.req( restapi.req(
'/web-dj-weapp/smartcarlife/goodsOrder/queryPayOrderStatus', '/web-dj-weapp/smartcarlife/goodsOrder/queryPayOrderStatus',
params, params,
// {
// 'content-type': 'application/x-www-form-urlencoded'
// },
{ {
'content-type': 'application/json' 'content-type': 'application/json'
}, },
......
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
{ {
"name": "支付", "name": "支付",
"pathName": "packagesPayment/pages/payment/index", "pathName": "packagesPayment/pages/payment/index",
"query": "sceneId='sceneId=10683'", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
...@@ -280,5 +280,5 @@ ...@@ -280,5 +280,5 @@
}, },
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "dj-car-weapp-smartshop", "projectname": "dj-car-weapp-smartshop",
"libVersion": "2.10.4" "libVersion": "2.24.4"
} }
\ No newline at end of file \ No newline at end of file
// export const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/'
import getAppId from '~/utils/utils_wx'
import util from '~/utils/util'
export const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/'
// 缓存get方法为空的默认指定值
export const DEFAULT_GET_STORAGEKEY = ['sessionId', 'merchantId', 'userInfo']
export const appId = getAppId.getAppId()
// 缓存get方法key的对应才映射值
export const STORAGE_OBJECTkEY = {
DEFAULT_GET_STORAGEKEY,
sessionId: 'sessionId',
userInfo: 'userInfo',
system_info: 'system_info',
app_title: 'appTitle',
auto_login_object: 'auto_login_object',
address_info: 'address_info',
wx_user_info: 'wx_user_info',
isVIP: 'isVIP',
edjurl: 'edjurl',
isNeedShowModal: 'isNeedShowModal',
bindInfo: 'bindInfo',
isShowPreModal: 'isShowPreModal',
unauthorized: 'unauthorized',
activityId: 'activityId',
shareStaff: 'shareStaff',
miaoshatrack: 'miaoshatrack',
lastCouponIds: 'lastCouponIds',
merchant_info: 'merchant_info',
refresh_oil_oage: 'refresh_oil_oage',
shareStaffTracker: 'shareStaffTracker',
srcm_shopmall_merchant_id: 'srcm_shopmall_merchant_id',
srcm_shopmall_city_list: 'srcm_shopmall_city_list',
srcm_shopmall_brand_list: 'srcm_shopmall_brand_list',
newCarBrandList: 'newCarBrandList',
scrm_shopmall_car_brand_list: 'scrm_shopmall_car_brand_list',
srcm_shopmall_user_info: 'srcm_shopmall_user_info',
scrm_shopmall_sessionId: 'scrm_shopmall_sessionId',
closeMask: 'closeMask',
activity_options: 'activity_options',
closePYQTip: 'closePYQTip',
user_profile: 'user_profile',
srcm_shopmall_customer_id: 'srcm_shopmall_customer_id',
mock_data: 'mock_data'
}
export const IMG_VERSION = async () => {
const accountInfo = await util.getMockData()
return accountInfo?.version || Date.now()
}
\ No newline at end of file \ No newline at end of file
...@@ -14,7 +14,7 @@ const systemInfo = wx.getSystemInfoSync() ...@@ -14,7 +14,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false const manual = false
const release = false const release = false
let index =3 let index =1
// 判断小程序环境 // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
......
import $router from '../router/index'
/**
* 微信校验通知类工具封装
*/
const tipsObj = {
phone: {
icon: 'error',
title: '请输入手机号'
},
username: {
icon: 'error',
title: '请输入用户名'
},
password: {
icon: 'error',
title: '请输入密码'
}
}
/**
* 禁止滑动
*/
const noScroll = () => {}
/**设置粘贴板内容 */
const setCopyData = (data, callBack) => {
wx.setClipboardData({
data: data,
success(res) {
if (callBack && typeof callBack === 'function') callBack(res)
}
})
}
/** 获取小程序 appId */
const getAppId = () => {
return wx.getAccountInfoSync().miniProgram.appId
}
/**
* 防止重复点击
*/
const showLoading = (title = '') => {
if (wx.showLoading) {
// 基础库 1.1.0 微信6.5.6版本开始支持,低版本需做兼容处理
wx.showLoading({
title,
mask: true
})
} else {
// 低版本采用Toast兼容处理并将时间设为20秒以免自动消失
wx.showToast({
title,
icon: 'loading',
mask: true,
duration: 20000
})
}
}
const hideLoading = () => {
if (wx.hideLoading) {
// 基础库 1.1.0 微信6.5.6版本开始支持,低版本需做兼容处理
wx.hideLoading()
} else {
wx.hideToast()
}
}
const showToast = val => {
let obj = {}
if (val && typeof val === 'object') {
obj = val
} else {
obj.title = String(val)
obj.icon = 'none'
}
return wx.showToast(obj)
}
/**
*
* @param {* string | object} name 信息名称
* @param {* object | null} [params] 信息名称参数
*/
const wxShowToast = (name, params) => {
if (arguments.length == 2) {
wx.showToast({
title: tipsObj[name]['title'],
icon: tipsObj[name]['icon'],
...params
})
} else {
wx.showToast({
...params
})
}
}
/**获取设备信息 */
const getSystemInfo = callBack => {
wx.getSystemInfo({
success(res) {
callBack(res)
},
fail(err) {
callBack(err)
}
})
}
/**拨打电话 */
const phoneCall = phoneNumber => {
wx.makePhoneCall({
phoneNumber: `${phoneNumber}`
})
}
/**查看大图 */
const previewImage = params => {
wx.previewImage(params)
}
/**是否全面屏 */
const isFullSucreen = isComponents => {
const thisPage = $router.getPageInstance()
const routerList = $router.getRouterList()
const router = routerList.find(item => item.url === `/${thisPage.route}`)
let key = `${router.url.replace('/', '')}.html`
let val = false
if (__wxConfig && __wxConfig.page && __wxConfig.page[key]) {
let {
navigationStyle
} = __wxConfig.page[key].window
wx.getSystemInfo({
success(res) {
if (res.platform != 'android') {
let {
statusBarHeight,
screenHeight,
windowHeight
} = res
if (navigationStyle && navigationStyle == 'custom') {
windowHeight = windowHeight - thisPage.data.navHeight || 0
}
//兼容自定义标题
val = router.isTab ? screenHeight - windowHeight - statusBarHeight - 32 > 72 : screenHeight - windowHeight > 72
if (isComponents) val = screenHeight - windowHeight > 72
}
},
fail(err) {
return false
}
})
}
return val
}
/**获取节点信息
* name(id获取class)
* callBack 回调函数
* isComponents是否在组件
*/
const getViewInfo = (name, callBack, isComponents) => {
const query = !isComponents ? wx.createSelectorQuery() : wx.createSelectorQuery().in(isComponents)
query
.select(name)
.boundingClientRect(res => {
callBack(res)
})
.exec()
}
/**触底加载 */
const onReachBottom = (obj, callBack) => {
let _this = $router.getPageInstance()
let {
pageNum,
total,
pageSize,
nothing
} = obj
if (!total && !pageNum) {
console.error('total&&pageNum为必传')
return
}
if (!pageSize) pageSize = 10
if (!nothing) nothing = 'nothing'
if (Math.ceil(total / pageSize) > pageNum) {
_this.setData({
pageNum: pageNum + 1
})
callBack()
} else {
_this.setData({
[nothing]: true
})
}
}
const wxApi = {
previewImage,
getSystemInfo,
showLoading,
hideLoading,
setCopyData,
showToast,
phoneCall,
noScroll,
wxShowToast,
getAppId,
isFullSucreen,
getViewInfo,
onReachBottom
}
export default wxApi
\ 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!