msb_test
ch 2 years ago
parent 194587ba1b
commit 5d8a42f48c

@ -3,15 +3,18 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "node env.config.js & npm run dev:h5", "serve": "npm run dev:h5",
"serve:bate": "node env.config.js --ENV:beta & npm run dev:h5", "serve:test": "npm run dev:h5-test",
"serve:prod": "node env.config.js --ENV:prod & npm run dev:h5", "serve:bate": "npm run dev:h5-bate",
"build": "npm run build:h5", "serve:prod": "npm run dev:h5-prod",
"build:test": "npm run build:h5-test",
"build:bate": "npm run build:h5-bate",
"build:prod": "npm run build:h5-prod",
"build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build", "build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build",
"build:custom": "cross-env NODE_ENV=production uniapp-cli custom", "build:custom": "cross-env NODE_ENV=production uniapp-cli custom",
"build:h5": "node env.config.js --ENV:test & cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build", "build:h5-test": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build --mode test",
"build:h5:bate": "node env.config.js --ENV:beta & cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build", "build:h5:bate": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build --mode bate",
"build:h5:prod": "node env.config.js --ENV:prod & cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build", "build:h5:prod": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build --mode prod",
"build:mp-360": "cross-env NODE_ENV=production UNI_PLATFORM=mp-360 vue-cli-service uni-build", "build:mp-360": "cross-env NODE_ENV=production UNI_PLATFORM=mp-360 vue-cli-service uni-build",
"build:mp-alipay": "cross-env NODE_ENV=production UNI_PLATFORM=mp-alipay vue-cli-service uni-build", "build:mp-alipay": "cross-env NODE_ENV=production UNI_PLATFORM=mp-alipay vue-cli-service uni-build",
"build:mp-baidu": "cross-env NODE_ENV=production UNI_PLATFORM=mp-baidu vue-cli-service uni-build", "build:mp-baidu": "cross-env NODE_ENV=production UNI_PLATFORM=mp-baidu vue-cli-service uni-build",
@ -29,6 +32,9 @@
"dev:app-plus": "cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch", "dev:app-plus": "cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch",
"dev:custom": "cross-env NODE_ENV=development uniapp-cli custom", "dev:custom": "cross-env NODE_ENV=development uniapp-cli custom",
"dev:h5": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve", "dev:h5": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve",
"dev:h5-test": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve --mode test",
"dev:h5-bate": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve --mode bate",
"dev:h5-prod": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve --mode prod",
"dev:mp-360": "cross-env NODE_ENV=development UNI_PLATFORM=mp-360 vue-cli-service uni-build --watch", "dev:mp-360": "cross-env NODE_ENV=development UNI_PLATFORM=mp-360 vue-cli-service uni-build --watch",
"dev:mp-alipay": "cross-env NODE_ENV=development UNI_PLATFORM=mp-alipay vue-cli-service uni-build --watch", "dev:mp-alipay": "cross-env NODE_ENV=development UNI_PLATFORM=mp-alipay vue-cli-service uni-build --watch",
"dev:mp-baidu": "cross-env NODE_ENV=development UNI_PLATFORM=mp-baidu vue-cli-service uni-build --watch", "dev:mp-baidu": "cross-env NODE_ENV=development UNI_PLATFORM=mp-baidu vue-cli-service uni-build --watch",

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-04-28 16:30:54 * @Date: 2022-04-28 16:30:54
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-29 17:15:57 * @LastEditTime: 2022-07-09 10:16:00
* @Description: file content * @Description: file content
*/ */
@ -10,6 +10,10 @@ import {ToAsyncAwait, MsbRequest, MsbRequestTk} from '@/common/utils';
const BASE_URL = '/mall/trade'; const BASE_URL = '/mall/trade';
export const ApiPostCashierPrepay = (data) =>
ToAsyncAwait(MsbRequestTk.post(`${BASE_URL}/payCenter/cashierPrepay`, data));
/** /**
* 微信h5支付获取支付URL * 微信h5支付获取支付URL
* @param {*} data * @param {*} data

@ -10,6 +10,13 @@
"backgroundColor" : "#69ADE5" "backgroundColor" : "#69ADE5"
} }
}, },
{
"path": "pages/webView",
"aliasPath" : "/webView",
"style": {
"navigationBarTitleText": "马士兵严选"
}
},
{ {
"path": "pages/login", "path": "pages/login",
"aliasPath" : "/login", "aliasPath" : "/login",

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-03-20 14:14:53 * @Date: 2022-03-20 14:14:53
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-29 17:23:04 * @LastEditTime: 2022-07-12 17:29:00
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -34,22 +34,6 @@
maxlength="50" placeholder="填写您想要备注的信息50字以内" /> maxlength="50" placeholder="填写您想要备注的信息50字以内" />
</UiCell> </UiCell>
</UiWhiteBox> </UiWhiteBox>
<UiWhiteBox>
<text class="play--title">支付方式</text>
<radio-group>
<u-cell v-for="item in payData" :title="item.label" :key="item.val"
:border="false" @click="payType = item.val">
<image class="play--icon" slot="icon" :src="item.icon"/>
<radio class="play--radio" slot="right-icon" color="#FF875B"
:checked="payType == item.val" ></radio>
</u-cell>
<!-- <u-cell title="支付宝支付" :border="false" @click="payType = 'alipay'">
<image class="play--icon" slot="icon" src="@/static/order/zfb.png"/>
<radio class="play--radio" slot="right-icon" color="#FF875B"
:checked="payType == 'alipay'"></radio>
</u-cell> -->
</radio-group>
</UiWhiteBox>
<UiWhiteBox class="amount"> <UiWhiteBox class="amount">
<u-cell title="商品总额" :value="`¥${orderInfo.productAmount}`" :border="false"></u-cell> <u-cell title="商品总额" :value="`¥${orderInfo.productAmount}`" :border="false"></u-cell>
@ -72,6 +56,7 @@
import {GOODS_TYPE} from '@/common/dicts/goods'; import {GOODS_TYPE} from '@/common/dicts/goods';
import UiCell from '@/components/UiCell'; import UiCell from '@/components/UiCell';
import {ApiPostSubmitOrder, ApiGetBeforeOrder, ApiGetBeforeCartOrder} from '@/common/api/order'; import {ApiPostSubmitOrder, ApiGetBeforeOrder, ApiGetBeforeCartOrder} from '@/common/api/order';
import {ApiPostCashierPrepay} from '@/common/api/pay';
import {ApiGetAddress } from '@/common/api/base'; import {ApiGetAddress } from '@/common/api/base';
import {Wxpay, Alipay} from '@/common/utils'; import {Wxpay, Alipay} from '@/common/utils';
import UiButton from '@/components/UiButton.vue'; import UiButton from '@/components/UiButton.vue';
@ -85,15 +70,6 @@ export default {
address : {}, address : {},
userMessage : '', userMessage : '',
orderInfo : {}, orderInfo : {},
payType : 'wxpay',
payData : [
{
label : '微信支付',
icon : require('@/static/order/wx.png'),
val : 'wxpay'
}
],
productType : this.$Route.query.productType, productType : this.$Route.query.productType,
} }
}, },
@ -102,14 +78,6 @@ export default {
uni.$on('changeAddress',(item)=>{ uni.$on('changeAddress',(item)=>{
this.address = item; this.address = item;
}); });
// APP
if(!this.$store.state.openId){
this.payData.push({
label : '支付宝支付',
icon : require('@/static/order/zfb.png'),
val : 'alipay'
})
}
}, },
onShow(){ onShow(){
// //
@ -206,11 +174,10 @@ export default {
uni.$u.toast(error.message); uni.$u.toast(error.message);
return false; return false;
} }
if(this.payType === 'wxpay'){ const {error:er, result:res} = await ApiPostCashierPrepay({orderId:result.orderId});
Wxpay({orderId : result.orderId, openId : this.$store.state.openId}); this.$Router.push(`/webView?url=${encodeURIComponent('http://www.baidu.com')}`)
}else{ // console.log(res);
Alipay({orderId : result.orderId});
}
} }
} }
} }

@ -0,0 +1,24 @@
<!--
* @Author: ch
* @Date: 2022-07-12 17:19:59
* @LastEditors: ch
* @LastEditTime: 2022-07-12 17:34:26
* @Description: file content
-->
<template><view>
<!-- <web-view src="http://www.baidu.com"></web-view> -->
</view>
</template>
<script>
export default {
data (){
return {
url : ''
}
},
onLoad(){
this.url = this.$Route.query.url
console.log();
}
}
</script>
Loading…
Cancel
Save