Commit 846dcdb0 by 张立顺

Merge branch 'dev_v4.24.0' into 'develop'

Dev v4.24.0

See merge request !20
2 parents 053518b5 3228b9d5
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* 2测试 * 2测试
* 3生产环境 * 3生产环境
*/ */
let index = 1 let index = 2
const accountInfo = wx.getAccountInfoSync() const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync() const systemInfo = wx.getSystemInfoSync()
......
...@@ -312,7 +312,7 @@ Page({ ...@@ -312,7 +312,7 @@ Page({
timeStamp: row.timeStamp, timeStamp: row.timeStamp,
signType: 'MD5', signType: 'MD5',
success: function (res) { success: function (res) {
// console.log(res) console.log(res)
// 查询订单信息 // 查询订单信息
// util.showLoading('加载中...') // util.showLoading('加载中...')
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
...@@ -324,6 +324,7 @@ Page({ ...@@ -324,6 +324,7 @@ Page({
// showOrderInfo: data ? true : false, // showOrderInfo: data ? true : false,
// orderInfoList // orderInfoList
}) })
_this.getOrderScreenShot()
// 银盛接口取消调用(太慢没意义) // 银盛接口取消调用(太慢没意义)
// _this.successInfo() // _this.successInfo()
}, },
...@@ -350,7 +351,6 @@ Page({ ...@@ -350,7 +351,6 @@ Page({
// this.setData({ // this.setData({
// orderCode: data.orderCode // orderCode: data.orderCode
// }) // })
// this.getOrderScreenShot()
// } // }
// }, // },
// rej => { // rej => {
...@@ -360,8 +360,9 @@ Page({ ...@@ -360,8 +360,9 @@ Page({
// ) // )
// }, // },
getOrderScreenShot() { getOrderScreenShot() {
let { merchantName, dataTime, outTradeNo } = this.data let { merchantName,shopMerchantName, dataTime, outTradeNo,payMoney,isYqType } = this.data
let params = JSON.stringify({ merchantName, formatAccountDate: dataTime, selectPayType: 1, outTradeNo, payMoney }) let params = JSON.stringify({ merchantName:isYqType?merchantName:shopMerchantName, formatAccountDate: dataTime, selectPayType: 1, outTradeNo, payMoney })
console.log(params,'params');
api api
.orderScreenShot({ url: orderPosterImgUrl + 'orderInfo=' + params }) .orderScreenShot({ url: orderPosterImgUrl + 'orderInfo=' + params })
.then(result => { .then(result => {
......
...@@ -74,7 +74,11 @@ ...@@ -74,7 +74,11 @@
<!-- <view>支付成功</view> --> <!-- <view>支付成功</view> -->
<view class="success-Container"> <view class="success-Container">
<view class="poster"> <view class="poster">
<image class="posetrimg" 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">
......
// packagesPayment/pages/payment/index.js // packagesPayment/pages/payment/index.js
const filter = require('../../../utils/filter.js') // 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' import { orderPosterImgUrl } from '~/config'
Page( Page({
// { // filter.identityFilter({
filter.identityFilter({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -16,7 +15,8 @@ Page( ...@@ -16,7 +15,8 @@ Page(
sceneId: '', sceneId: '',
ajaxing: false, ajaxing: false,
paySuccess: false, paySuccess: false,
posterUrl: 'https://wx.glsx.com.cn/upload/biz/646958380279271424.png' posterUrl: '',
sceneType: true //默认是1.1的支付场景
}, },
onLogin() { onLogin() {
...@@ -31,13 +31,14 @@ Page( ...@@ -31,13 +31,14 @@ Page(
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.gteOpenId()
// 开发用 // 开发用
// this.getOrderDetail() // this.getOrderDetail()
// this.getOrderScreenShot() // this.getOrderScreenShot()
// options.scene = 'sceneId=10689' // options.scene = 'sceneId=11188'
// let options = { // options = {
// scene: 'sceneId=6783' // scene: 'sceneId=11188'
// } // }
// console.log(options, 'options') // console.log(options, 'options')
wx.hideHomeButton({ wx.hideHomeButton({
...@@ -51,8 +52,6 @@ Page( ...@@ -51,8 +52,6 @@ Page(
this.setData({ this.setData({
sceneId: id sceneId: id
}) })
id && this.getScenInfo()
}, },
/** /**
...@@ -70,10 +69,40 @@ Page( ...@@ -70,10 +69,40 @@ Page(
ajaxing: false ajaxing: false
}) })
}, },
navWarrantyCard() {
// console.log('navWebview')
// console.log(wx.$router.getRouterList())
wx.$router.go('warrantyCard')
},
gteOpenId() {
let that = this
// debugger
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
var self = this
// self.globalData.code = res.code
// console.log('login', res)
// console.log(api)
// restapi.jsTestLogin(res.code, self.globalData.appId, function (response) {
api.authOpenId({ code: res.code, appId: app.globalData.appId }, function (response) {
// console.log('response', response)
let { returnCode, data } = response
if (returnCode == 0) {
self.setData({
openId: data.openId
})
that.getScenInfo()
}
})
}
})
},
getOrderScreenShot() { getOrderScreenShot() {
const { orderCode } = this.data const { orderCode } = this.data
api api
.orderScreenShot({ url: orderPosterImgUrl + 'orderCode='(orderCode || '230407155523620') }) .orderScreenShot({ url: orderPosterImgUrl + 'orderCode=' + orderCode })
.then(result => { .then(result => {
// this.poster = res.data // this.poster = res.data
console.log(result, 'poster') console.log(result, 'poster')
...@@ -85,10 +114,12 @@ Page( ...@@ -85,10 +114,12 @@ Page(
}, },
// 获取订单信息 // 获取订单信息
getInfo: function (row) { getInfo: function (row) {
let { openId } = this.data
let _this = this let _this = this
let oParams = {} let oParams = {}
oParams.orderCode = row.orderCode oParams.orderCode = row.orderCode
oParams.workWxSessionId = row.workWxSessionId oParams.workWxSessionId = row.workWxSessionId
oParams.openId = openId
api.GETORDERINFO(oParams, res => { api.GETORDERINFO(oParams, res => {
util.hideLoading() util.hideLoading()
console.log(JSON.parse(res.data)) console.log(JSON.parse(res.data))
...@@ -103,6 +134,7 @@ Page( ...@@ -103,6 +134,7 @@ Page(
// 调用微信支付 // 调用微信支付
wxPayment: function (row) { wxPayment: function (row) {
let _this = this let _this = this
if (this.data.ajaxing) { if (this.data.ajaxing) {
return false return false
} }
...@@ -121,11 +153,12 @@ Page( ...@@ -121,11 +153,12 @@ Page(
paySuccess: true paySuccess: true
// dataTime: new Date().format('yyyy/MM/dd hh:mm') // dataTime: new Date().format('yyyy/MM/dd hh:mm')
}) })
// 获取订单截图
_this.getOrderScreenShot()
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: '支付成功' title: '支付成功'
}) })
// 获取订单截图
_this.getOrderScreenShot()
// wx.redirectTo({ // wx.redirectTo({
// url: '/packagePersonal/pages/boutiqueList/boutiqueList' // url: '/packagePersonal/pages/boutiqueList/boutiqueList'
// }) // })
...@@ -134,6 +167,7 @@ Page( ...@@ -134,6 +167,7 @@ Page(
// wx.switchTab({ // wx.switchTab({
// url: '/pages/tab/index/index' // url: '/pages/tab/index/index'
// }) // })
console.log(error)
wx.showToast({ wx.showToast({
title: '支付失败', title: '支付失败',
icon: 'error' icon: 'error'
...@@ -176,13 +210,57 @@ Page( ...@@ -176,13 +210,57 @@ Page(
}) })
//util.showLoading('加载中...') //util.showLoading('加载中...')
console.log(op) console.log(op)
this.getInfo(op) this.getOrderDetail(op)
} }
} }
} }
) )
} }
},
getOrderDetail(item) {
console.log(item, 'item')
let { orderCode } = item
api.getOrderDetail({ orderCode }).then(res => {
console.log(res, 'res')
let { code, data, errId } = res
// console.log(data, 'data')
// console.log(data.sceneType == 1);
// debugger
if (code == 0) {
this.setData({
sceneType: data.sceneType == 1
})
// 必须要订单 为待支付才能发起支付
if (data?.payOrder == null || data.payOrder.payStatus == 1) {
this.getInfo(item)
} else {
wx.showToast({
title: '非待支付订单',
icon: 'error'
})
}
} else if (errId == '-5003') {
wx.showToast({
title: '订单已失效',
icon: 'error'
})
} else {
wx.showToast({
title: '请求失败',
icon: 'error'
})
} }
}) })
// ,
// res => {
// // else {
// // util.showToast('系统异常')
// // }
// } // }
) // )
}
// })
})
...@@ -2,13 +2,19 @@ ...@@ -2,13 +2,19 @@
<!-- wx:if="{{orderInfo}}" --> <!-- wx:if="{{orderInfo}}" -->
<block wx:if="{{paySuccess}}"> <block wx:if="{{paySuccess}}">
<view class="poster"> <view class="poster">
<image class="posetrimg" mode="widthFix" src="{{posterUrl}}" /> <image
show-menu-by-longpress="true"
class="posetrimg"
mode="widthFix"
src="{{posterUrl}}" />
</view> </view>
<view class="footerCon"> <view class="footerCon" wx:if="{{sceneType}}">
<view class="wxTips">长按识别扫码领取质保卡</view> <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 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" /> <image class="logoIcon" src="../../../images/djLogin.png" />
</view> </view>
</block> </block>
<auth-setting auth='{{authToast}}' type='{{authType}}' /> <!-- <auth-setting auth='{{authToast}}' type='{{authType}}' /> -->
...@@ -4,7 +4,7 @@ Page({ ...@@ -4,7 +4,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
webpageUrl: '' webpageUrl: 'http://lexiangla.com/staff?company_from=f61c3d0c101f11ebb06e5254002f1020'
}, },
/** /**
...@@ -15,7 +15,7 @@ Page({ ...@@ -15,7 +15,7 @@ Page({
console.log(accountInfo, 'accountInfo') console.log(accountInfo, 'accountInfo')
this.setData({ this.setData({
// webpageUrl: accountInfo.miniProgram.envVersion == 'release' ? 'https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/' : 'http://192.168.1.178:8080/#/detail?cardCode=211027-2201AAA01' // webpageUrl: accountInfo.miniProgram.envVersion == 'release' ? 'https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/' : 'http://192.168.1.178:8080/#/detail?cardCode=211027-2201AAA01'
webpageUrl: accountInfo.miniProgram.envVersion == 'release' ? 'https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/' : 'https://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/' // webpageUrl: accountInfo.miniProgram.envVersion == 'release' ? 'https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/' : 'https://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/'
}) })
}, },
......
...@@ -3,7 +3,8 @@ import api from './request.js' ...@@ -3,7 +3,8 @@ import api from './request.js'
module.exports = { 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/createWxPayOrderWithNotLogin', oParams, {}, 'GET', 'json', 'text', success, fail)
// restapi.req('/web-dj-weapp/smartcarlife/goodsOrder/createWxPayOrder', oParams, {}, 'GET', 'json', 'text', success, fail)
}, },
/** 精品交付单订单详情列表 */ /** 精品交付单订单详情列表 */
// getBoutiqueOrderDetail(data, success, fail) { // getBoutiqueOrderDetail(data, success, fail) {
...@@ -118,5 +119,9 @@ module.exports = { ...@@ -118,5 +119,9 @@ module.exports = {
/** 订单截图 */ /** 订单截图 */
orderScreenShot(data) { orderScreenShot(data) {
return api.post('dj.api.smartcarlife.common.screenShot', data) return api.post('dj.api.smartcarlife.common.screenShot', data)
},
/** 新订单详情 */
getOrderDetail(data) {
return api.post('dj.api.smartcarlife.order.detail', data)
} }
} }
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
"minifyWXML": true, "minifyWXML": true,
"showES6CompileOption": false, "showES6CompileOption": false,
"useCompilerPlugins": false, "useCompilerPlugins": false,
"ignoreUploadUnusedFiles": true "ignoreUploadUnusedFiles": true,
"condition": false
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.8.3", "libVersion": "2.8.3",
......
{ {
"setting": { "setting": {
"compileHotReLoad": true, "compileHotReLoad": true,
"urlCheck": true "urlCheck": false
}, },
"condition": { "condition": {
"miniprogram": { "miniprogram": {
......
/** // /**
* // *
0本地 // 0本地
1开发 // 1开发
2测试 // 2测试
3生产环境 // 3生产环境
4预发布环境 // 4预发布环境
*/ // */
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 =1 // let index =1
// 判断小程序环境 // // 判断小程序环境
// 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
const domain_items = { const domain_items = {
ip: 'http://192.168.3.181:9182', ip: 'http://192.168.3.181:9182',
dev: 'https://dj.dev.glsx.com.cn', dev: 'https://dj.dev.glsx.com.cn',
...@@ -49,7 +51,6 @@ const domain_items = { ...@@ -49,7 +51,6 @@ const domain_items = {
const domain= domain_items[target[index]] const domain= domain_items[target[index]]
const app = getApp()
/** /**
* 通用请求 * 通用请求
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!