Compare commits

...

44 Commits

Author SHA1 Message Date
msb_39367 550ea9ddf9 feature: 添加打包资源
2 weeks ago
王景 a83f41c883 feat: update package-lock
1 year ago
王景 0237f70511 docs: 添加Node版本描述
1 year ago
ch 24df19af14 Merge branch 'fix/0714-ch'
2 years ago
ch fad9ff6ccb fix:修改服务启动名
2 years ago
ch f360233caa Merge branch 'fix/0714-ch' of https://internel-git.mashibing.cn/yanxuan-frontend/shop-app
2 years ago
ch 0508a6d9df pref:固定端口号
2 years ago
ch 041e15495d fix:下架商品
2 years ago
ch 2a42d55fb6 fix:static地址
2 years ago
ch d1f0e5fbd4 支付回调页面
2 years ago
ch 874340f948 修改打包方式
2 years ago
ch 39f379875b pay
2 years ago
ch 5d8a42f48c pay
2 years ago
ch b59d0698ae clear
2 years ago
ch 194587ba1b fix: 商品已下架
2 years ago
ch 9f195f09b7 fix: 商品已下架
2 years ago
ch a35cb72501 fix:点赞提示,已够吗问题
2 years ago
ch c010790f96 Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch 03dab5bd96 Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch 24ba55fa25 Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch 5832a43169 Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch 0ce97eb86b Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch 325bee7e80 Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch 0ce7d20886 Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch 774b4f4064 Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch 251d091312 Merge branch 'feature/alipay-0629-ch' into msb_test
2 years ago
ch 987566558d 增长支付订单状态查询
2 years ago
ch ffdb3e549f Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch 1e6de755bd APP支付
2 years ago
ch d4a93fed3d Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch 6cc4720315 Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch df1a27323d Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch 0391e24745 Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch 907bcabad2 Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch 5dc332c05f Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch 410a721436 Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch 03e27975b4 Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch b2d1f2d9c0 Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch e5634eeacb 配置支付宝支付
2 years ago
ch d1ba4b1842 Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch 46a6767afb Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch 96def57eaa Merge branch 'feature/comment-0620-ch' into msb_test
2 years ago
ch 2f1332b05d Merge branch 'feature/alipay-0629-ch' into msb_test
2 years ago
ch ec932a429b 支付宝支付
2 years ago

@ -1,4 +1,3 @@
VUE_APP_BASE_URL = https://k8s-horse-gateway.mashibing.cn VUE_APP_BASE_URL = https://k8s-horse-gateway.mashibing.cn
VUE_APP_STATIC_URL = https://k8s-shop-app.mashibing.cn VUE_APP_STATIC_URL = https://k8s-shop-app.mashibing.cn
#VUE_APP_IM_URL = ws://192.168.10.94:8090
VUE_APP_IM_URL = wss://k8s-horse-gateway.mashibing.cn VUE_APP_IM_URL = wss://k8s-horse-gateway.mashibing.cn

@ -1,3 +1,3 @@
VUE_APP_BASE_URL = https://you-gateway.mashibing.com VUE_APP_BASE_URL = https://you-gateway.mashibing.com
VUE_APP_STATIC_URL = https://you-gateway.mashibing.com VUE_APP_STATIC_URL = https://you-app.mashibing.com
VUE_APP_IM_URL = wss://you-gateway.mashibing.com VUE_APP_IM_URL = wss://you-gateway.mashibing.com

@ -1,3 +1,3 @@
VUE_APP_BASE_URL = https://you-gateway.mashibing.com VUE_APP_BASE_URL = https://you-gateway.mashibing.com
VUE_APP_STATIC_URL = https://you-gateway.mashibing.com VUE_APP_STATIC_URL = https://you-app.mashibing.com
VUE_APP_IM_URL = wss://you-gateway.mashibing.com VUE_APP_IM_URL = wss://you-gateway.mashibing.com

@ -5,18 +5,28 @@
* @LastEditTime: 2022-05-23 21:18:34 * @LastEditTime: 2022-05-23 21:18:34
* @Description: file content * @Description: file content
--> -->
# shopping-app # shopping-app
严选移动端 严选移动端
## 前置环境
由于项目依赖问题,开发 `node` 版本必须是 `14` or `16`
如果想安装多个版本,可以通过使用 `nvm` 进行版本管理。然具体安装可以参考下面教程
[window install nvm](https://juejin.cn/post/7074108351524634655)
[mac install nvm](https://juejin.cn/post/7206882855200047161)
## 公共方法utils ## 公共方法 utils
- 公共方法统一放置utils文件夹内可以按分类建方法文件 如验证类verify.js 请求类request.js
- 公共方法统一放置 utils 文件夹内,可以按分类建方法文件 如:验证类 verify.js 请求类 request.js
- 所有公共方法采用大驼峰命名法 - 所有公共方法采用大驼峰命名法
- 所有的方法都从index.js输出引入时统一引入index不允许直接引入方法文件 - 所有的方法都从 index.js 输出,引入时统一引入 index不允许直接引入方法文件
- 所有方法文件如果导出的是多个方法,不允许在定义方法时导出,必须在文件底部一一导出,并附上方法简单的注释 - 所有方法文件如果导出的是多个方法,不允许在定义方法时导出,必须在文件底部一一导出,并附上方法简单的注释
``` js
```js
// 正确 // 正确
import {Req, IsPhone} from '@/common/utils'; import {Req, IsPhone} from '@/common/utils';
@ -39,17 +49,20 @@ export const IsPhone = (str) => {....}
export const IsEmail = (str) => {....} export const IsEmail = (str) => {....}
``` ```
## 组件 ## 组件
- 请务必使用easycom模式引入第三方组件
- 根目录的components 只放置真正的组件某个页面的业务模块应该在pages的相应目录下新建components目录放置
- 所有的自定义组件文件名以大驼峰命名且在templet中使用也用大驼峰形式使用
- 请务必使用 easycom 模式引入第三方组件
- 根目录的 components 只放置真正的组件,某个页面的业务模块应该在 pages 的相应目录下新建 components 目录放置
- 所有的自定义组件文件名以大驼峰命名,且在 templet 中使用也用大驼峰形式使用
## 请求 ## 请求
- 所有请求方法命名以Api+请求类型+具体方) 法命名 - 所有请求方法命名以Api+请求类型+具体方) 法命名
- 所有请求使用ToAsyncAwait 包裹 - 所有请求使用 ToAsyncAwait 包裹
- 不允许使用try catch 和 then 处理返回结果 - 不允许使用 try catch 和 then 处理返回结果
``` js
```js
// 使用示例 // 使用示例
// xxapi.js // xxapi.js
import {ToAsyncAwait, ReqestTk} from '@/common/utils' import {ToAsyncAwait, ReqestTk} from '@/common/utils'
@ -60,7 +73,7 @@ export const IsEmail = (str) => {....}
} }
// user.vue // user.vue
improt {ApiGetUserInfo} from '@/common/api/xxapi.js'; improt {ApiGetUserInfo} from '@/common/api/xxapi.js';
const getUserInfo = async () =>{ const getUserInfo = async () =>{
const {error, result} = await ApiGetUserInfo(); const {error, result} = await ApiGetUserInfo();
if(error){ if(error){
@ -71,6 +84,8 @@ export const IsEmail = (str) => {....}
} }
``` ```
## 图片 ## 图片
- 按pages目录结果放置图片
- 有公共使用的图片请放到static/common文件夹内 - 按 pages 目录结果放置图片
- 有公共使用的图片请放到 static/common 文件夹内

@ -1,49 +0,0 @@
/*
* @Author: ch
* @Date: 2022-05-05 14:40:00
* @LastEditors: ch
* @LastEditTime: 2022-06-28 10:59:13
* @Description: 根据git分支生成对应环境的环境变量
* 开发时如果环境变量换了可以不用重启服务直接运行node env.config.js即可
*/
const fs = require('fs');
const path = require('path');
const envConfig = {
dev : {
// baseUrl: 'https://you-gateway.mashibing.com',
baseUrl: 'https://k8s-horse-gateway.mashibing.cn',
// baseUrl: '',
staticUrl : 'https://k8s-shop-app.mashibing.cn',
// imUrl : 'ws://192.168.10.94:8090'
imUrl : 'wss://k8s-horse-gateway.mashibing.cn'
},
test : {
baseUrl: 'https://k8s-horse-gateway.mashibing.cn',
staticUrl : 'https://k8s-shop-app.mashibing.cn',
imUrl : 'wss://k8s-horse-gateway.mashibing.cn'
},
beta : {
baseUrl: 'https://you-gateway.mashibing.com',
staticUrl : 'https://you-app.mashibing.com',
imUrl : 'wss://you-gateway.mashibing.com'
},
prod : {
baseUrl: 'https://you-gateway.mashibing.com',
staticUrl : 'https://you-app.mashibing.com',
imUrl : 'wss://you-gateway.mashibing.com'
}
}
let curEnvConfig = null;
const argv = global.process.argv;
for(key in envConfig){
if(argv.includes(`--ENV:${key}`)){
curEnvConfig = envConfig[key];
break;
}
}
if(!curEnvConfig){
curEnvConfig = envConfig.dev;
}
fs.writeFileSync(`${path.resolve(__dirname, './src/common/config')}/env.js`,
`const ENV = ${JSON.stringify(curEnvConfig)}; export default ENV;`);

23183
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -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", "server": "npm run dev:h5",
"serve:bate": "node env.config.js --ENV:beta & npm run dev:h5", "server:test": "npm run dev:h5-test",
"serve:prod": "node env.config.js --ENV:prod & npm run dev:h5", "server:bate": "npm run dev:h5-bate",
"build": "npm run build:h5", "server: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",
@ -71,35 +77,36 @@
"@dcloudio/uni-quickapp-webview": "^2.0.1-34720220422002", "@dcloudio/uni-quickapp-webview": "^2.0.1-34720220422002",
"@dcloudio/uni-stat": "^2.0.1-34720220422002", "@dcloudio/uni-stat": "^2.0.1-34720220422002",
"@vue/shared": "^3.0.0", "@vue/shared": "^3.0.0",
"caniuse-lite": "^1.0.30001640",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"flyio": "^0.6.2", "flyio": "^0.6.2",
"regenerator-runtime": "^0.12.1",
"vue": "^2.6.11",
"vuex": "^3.2.0",
"js-util-all": "^1.0.6", "js-util-all": "^1.0.6",
"mp-html": "^2.2.2", "mp-html": "^2.2.2",
"regenerator-runtime": "^0.12.1",
"uni-read-pages": "^1.0.5", "uni-read-pages": "^1.0.5",
"uni-simple-router": "^2.0.7", "uni-simple-router": "^2.0.7",
"uview-ui": "^2.0.29" "uview-ui": "^2.0.29",
"vue": "^2.6.11",
"vuex": "^3.2.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/runtime": "~7.12.0", "@babel/runtime": "~7.12.0",
"@dcloudio/types": "^2.6.7", "@dcloudio/types": "^2.6.7",
"@dcloudio/uni-automator": "^2.0.1-34720220422002", "@dcloudio/uni-automator": "2.0.2-4010520240507001",
"@dcloudio/uni-cli-i18n": "^2.0.1-34720220422002", "@dcloudio/uni-cli-i18n": "2.0.2-4010520240507001",
"@dcloudio/uni-cli-shared": "^2.0.1-34720220422002", "@dcloudio/uni-cli-shared": "2.0.2-4010520240507001",
"@dcloudio/uni-migration": "^2.0.1-34720220422002", "@dcloudio/uni-migration": "2.0.2-4010520240507001",
"@dcloudio/uni-template-compiler": "^2.0.1-34720220422002", "@dcloudio/uni-template-compiler": "2.0.2-4010520240507001",
"@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.1-34720220422002", "@dcloudio/vue-cli-plugin-hbuilderx": "2.0.2-4010520240507001",
"@dcloudio/vue-cli-plugin-uni": "^2.0.1-34720220422002", "@dcloudio/vue-cli-plugin-uni": "2.0.2-4010520240507001",
"@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.1-34720220422002", "@dcloudio/vue-cli-plugin-uni-optimize": "2.0.2-4010520240507001",
"@dcloudio/webpack-uni-mp-loader": "^2.0.1-34720220422002", "@dcloudio/webpack-uni-mp-loader": "2.0.2-4010520240507001",
"@dcloudio/webpack-uni-pages-loader": "^2.0.1-34720220422002", "@dcloudio/webpack-uni-pages-loader": "2.0.2-4010520240507001",
"@vue/cli-plugin-babel": "~4.5.15", "@vue/cli-plugin-babel": "~4.5.15",
"@vue/cli-service": "~4.5.15", "@vue/cli-service": "~4.5.15",
"babel-plugin-import": "^1.11.0", "babel-plugin-import": "1.13.8",
"cross-env": "^7.0.2", "cross-env": "7.0.3",
"jest": "^25.4.0", "jest": "25.5.4",
"mini-types": "*", "mini-types": "*",
"miniprogram-api-typings": "*", "miniprogram-api-typings": "*",
"postcss-comment": "^2.0.0", "postcss-comment": "^2.0.0",

@ -0,0 +1,51 @@
/*
* @Author: ch
* @Date: 2022-04-28 16:30:54
* @LastEditors: ch
* @LastEditTime: 2022-07-09 10:16:00
* @Description: file content
*/
import {ToAsyncAwait, MsbRequest, MsbRequestTk} from '@/common/utils';
const BASE_URL = '/mall/trade';
export const ApiPostCashierPrepay = (data) =>
ToAsyncAwait(MsbRequestTk.post(`${BASE_URL}/payCenter/cashierPrepay`, data));
/**
* 微信h5支付获取支付URL
* @param {*} data
*/
export const ApiPostWxH5Pay = (data) =>
ToAsyncAwait(MsbRequestTk.post(`${BASE_URL}/payCenter/wxPay/h5`, data));
/**
* 微信JSAPI支付获取支付参数
* @param {*} data
*/
export const ApiPostWxJsApiPay = (data) =>
ToAsyncAwait(MsbRequestTk.post(`${BASE_URL}/payCenter/wxPay/jsapi`, data));
/**
* 微信APP支付
* @param {*} data
*/
export const ApiPostWxAppPay = (data) =>
ToAsyncAwait(MsbRequestTk.post(`${BASE_URL}/payCenter/wxPay/app`, data));
/**
* 支付宝APP支付
* @param {*} data
*/
export const ApiPostAliAppPay = (data) =>
ToAsyncAwait(MsbRequestTk.post(`${BASE_URL}/payCenter/aliPay/app`, data));
/**
* 支付宝h5支付获取支付URL
* @param {*} data
*/
export const ApiPostAliH5Pay = (data) =>
ToAsyncAwait(MsbRequestTk.post(`${BASE_URL}/payCenter/aliPay/wap`, data));

@ -2,13 +2,12 @@
* @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-15 14:29:03 * @LastEditTime: 2022-06-29 17:16:50
* @Description: file content * @Description: file content
*/ */
import {ToAsyncAwait, MsbRequest, MsbRequestTk} from '@/common/utils'; import {ToAsyncAwait, MsbRequest, MsbRequestTk} from '@/common/utils';
const BASE_URL = '/mall/trade';
// 第三方鉴权服务 // 第三方鉴权服务
const AUTH_URL = '/third'; const AUTH_URL = '/third';
const APPID = 'wxd2015f0c56defa02'; const APPID = 'wxd2015f0c56defa02';
@ -33,24 +32,3 @@ export const ApiGetOpenId = ({code}) =>
*/ */
export const ApiPostThirdInfo = (data) => export const ApiPostThirdInfo = (data) =>
ToAsyncAwait(MsbRequestTk.post(`${AUTH_URL}/third/saveThirdInfo`, {...data, appId:APPID})); ToAsyncAwait(MsbRequestTk.post(`${AUTH_URL}/third/saveThirdInfo`, {...data, appId:APPID}));
/**
* 微信h5支付获取支付URL
* @param {*} data
*/
export const ApiPostWxH5Pay = (data) =>
ToAsyncAwait(MsbRequestTk.post(`${BASE_URL}/payCenter/wxPay/h5`, data));
/**
* 微信JSAPI支付获取支付参数
* @param {*} data
*/
export const ApiPostWxJsApiPay = (data) =>
ToAsyncAwait(MsbRequestTk.post(`${BASE_URL}/payCenter/wxPay/jsapi`, data));
/**
* 微信APP支付
* @param {*} data
*/
export const ApiPostWxAppPay = (data) =>
ToAsyncAwait(MsbRequestTk.post(`${BASE_URL}/payCenter/wxPay/app`, data));

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-03-18 11:11:05 * @Date: 2022-03-18 11:11:05
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-29 21:53:26 * @LastEditTime: 2022-07-12 18:31:15
* @Description: file content * @Description: file content
*/ */
import {RouterMount,createRouter} from 'uni-simple-router'; import {RouterMount,createRouter} from 'uni-simple-router';
@ -14,7 +14,8 @@ const router = createRouter({
//全局路由前置守卫 //全局路由前置守卫
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// 兼容页面刷新body样式丢失问题 // 兼容页面刷新body样式丢失问题
if (document.body) { // console.log(document);
if (document) {
document.body.setAttribute('class', `uni-body ${to.path.replace('/', '').replace(/\//g, '-')}`) document.body.setAttribute('class', `uni-body ${to.path.replace('/', '').replace(/\//g, '-')}`)
} }
next(); next();

@ -0,0 +1,50 @@
/*
* @Author: ch
* @Date: 2022-04-29 14:26:10
* @LastEditors: ch
* @LastEditTime: 2022-07-13 10:37:21
* @Description: file content
*/
import { ApiPostAliH5Pay, ApiPostAliAppPay } from '@/common/api/pay';
const ENV = process.env;
export const Alipay = async ({orderId})=>{
// #ifdef APP-PLUS
const {error, result} = await ApiPostAliAppPay({orderId});
if(error){
uni.$u.toast(error.message);
return false;
}
const par = result.payDataInfo;
uni.requestPayment({
provider: 'alipay',
orderInfo :par.payData,
success(res) {
uni.navigateTo({
url : `/payResult?orderId=${orderId}&payType=appWx`
});
},
fail(e) {
uni.navigateTo({
url : `/payResult?orderId=${orderId}&payType=appWx`
});
}
}).then(res => {
console.log('res',res);
})
// #endif
// #ifdef H5
const { error, result } = await ApiPostAliH5Pay({
orderId,
returnUrl : decodeURIComponent(`${ENV.VUE_APP_STATIC_URL}/payResult?orderId=${orderId}&payType=alih5`)
});
if(error){
uni.$u.toast(error.message);
return false;
}
window.location.href = result.payDataInfo.payUrl;
// #endif
}

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-05-20 11:00:07 * @Date: 2022-05-20 11:00:07
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-13 10:11:33 * @LastEditTime: 2022-07-13 10:37:52
* @Description: file content * @Description: file content
*/ */
@ -11,7 +11,7 @@ import { ToAsyncAwait, FormatJsonSearch } from '@/common/utils';
import { ApiGetCurrentUser } from '@/common/api/account'; import { ApiGetCurrentUser } from '@/common/api/account';
import { ApiGetSoketTicket } from '@/common/api/im'; import { ApiGetSoketTicket } from '@/common/api/im';
import $store from '@/common/store'; import $store from '@/common/store';
import ENV from '@/common/config/env'; const ENV = process.env;
const Im = new MsbIm({ const Im = new MsbIm({
reconnect: true, reconnect: true,
@ -31,7 +31,7 @@ const ImInit = async () => {
avatar : $store.state.userInfo.avatar avatar : $store.state.userInfo.avatar
}) })
await ToAsyncAwait(Im.init({ await ToAsyncAwait(Im.init({
url: `${ENV.imUrl}/ws${par}` url: `${ENV.VUE_APP_IM_URL}/ws${par}`
})) }))
}; };

@ -2,7 +2,8 @@
* @Author: ch * @Author: ch
* @Date: 2022-03-22 16:52:28 * @Date: 2022-03-22 16:52:28
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-21 15:12:11 * @LastEditTime: 2022-06-29 17:28:39
* @LastEditTime: 2022-06-29 17:22:32
* @Description: 所有工具类统一在这输出 * @Description: 所有工具类统一在这输出
*/ */
import * as util from './utils'; import * as util from './utils';
@ -10,11 +11,13 @@ import * as requset from './requset';
import * as im from './im'; import * as im from './im';
import * as wxpay from './wxpay'; import * as wxpay from './wxpay';
import * as uploadFileOss from './uploadFileOss'; import * as uploadFileOss from './uploadFileOss';
import * as alipay from './alipay';
export * from './utils'; export * from './utils';
export * from './requset'; export * from './requset';
export * from './im'; export * from './im';
export * from './wxpay'; export * from './wxpay';
export * from './uploadFileOss'; export * from './uploadFileOss';
export * from './alipay';
export default { ...util, ...requset, ...im, ...wxpay, ...uploadFileOss} export default { ...util, ...requset, ...im, ...wxpay, ...uploadFileOss, ...alipay}

@ -2,10 +2,9 @@
* @Author: ch * @Author: ch
* @Date: 2022-05-06 15:33:55 * @Date: 2022-05-06 15:33:55
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-15 14:26:16 * @LastEditTime: 2022-07-13 10:38:34
* @Description: file content * @Description: file content
*/ */
import ENV from '@/common/config/env';
import { Wxpay } from './wxpay'; import { Wxpay } from './wxpay';
export const pay = ({orderId, openId, payType})=>{ export const pay = ({orderId, openId, payType})=>{
if(payType === 'wxpay'){ if(payType === 'wxpay'){

@ -2,14 +2,14 @@
* @Author: ch * @Author: ch
* @Date: 2022-03-17 17:42:32 * @Date: 2022-03-17 17:42:32
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-29 17:43:49 * @LastEditTime: 2022-07-13 10:39:07
* @Description: 项目接口请求统一处理器返回一个需要token和不需要token的请求封装方法 * @Description: 项目接口请求统一处理器返回一个需要token和不需要token的请求封装方法
*/ */
import MsbUniRequest from '@/common/plugins/msbUniRequest'; import MsbUniRequest from '@/common/plugins/msbUniRequest';
import $store from '@/common/store'; import $store from '@/common/store';
import ENV from '@/common/config/env';
import { CreateUUID } from '@/common/utils'; import { CreateUUID } from '@/common/utils';
const ENV = process.env;
// 获取已有的UUID没则创建一个并保存到locaStorage中下次使用 // 获取已有的UUID没则创建一个并保存到locaStorage中下次使用
let uuid = $store.state.uuid let uuid = $store.state.uuid
@ -82,7 +82,7 @@ const clearRepeat = (option) =>{
// 不需要token的接口封装 // 不需要token的接口封装
const MsbRequest = new MsbUniRequest(); const MsbRequest = new MsbUniRequest();
MsbRequest.baseUrl = ENV.baseUrl; MsbRequest.baseUrl = ENV.VUE_APP_BASE_URL;
MsbRequest.use('request', (option) => { MsbRequest.use('request', (option) => {
if(option.header.repeat){ if(option.header.repeat){
@ -102,7 +102,7 @@ MsbRequest.use('error', errorIntercept);
// 需要token的接口封装 // 需要token的接口封装
const MsbRequestTk = new MsbUniRequest(); const MsbRequestTk = new MsbUniRequest();
MsbRequestTk.baseUrl = ENV.baseUrl; MsbRequestTk.baseUrl = ENV.VUE_APP_BASE_URL;
MsbRequestTk.use('request', (option) => { MsbRequestTk.use('request', (option) => {
const token = $store.state.token; const token = $store.state.token;

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-03-17 19:15:10 * @Date: 2022-03-17 19:15:10
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-22 10:39:15 * @LastEditTime: 2022-07-13 10:39:35
* @Description: 一些无法归类的公共方法容器 * @Description: 一些无法归类的公共方法容器
*/ */
@ -15,7 +15,6 @@ import {
formatJsonSearch as FormatJsonSearch formatJsonSearch as FormatJsonSearch
} from "js-util-all"; } from "js-util-all";
import ENV from '@/common/config/env';
import {AD_JUMP_TYPE} from '@/common/dicts/ad'; import {AD_JUMP_TYPE} from '@/common/dicts/ad';
/** /**

@ -2,12 +2,12 @@
* @Author: ch * @Author: ch
* @Date: 2022-04-29 14:26:10 * @Date: 2022-04-29 14:26:10
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-15 14:43:50 * @LastEditTime: 2022-07-13 10:40:10
* @Description: file content * @Description: file content
*/ */
import { ApiPostWxH5Pay, ApiPostWxJsApiPay, ApiPostWxAppPay } from '@/common/api/wx'; import { ApiPostWxH5Pay, ApiPostWxJsApiPay, ApiPostWxAppPay } from '@/common/api/pay';
import ENV from '@/common/config/env'; const ENV = process.env;
export const Wxpay = async ({orderId,openId})=>{ export const Wxpay = async ({orderId,openId})=>{
// #ifdef APP-PLUS // #ifdef APP-PLUS
@ -74,7 +74,7 @@ export const Wxpay = async ({orderId,openId})=>{
uni.$u.toast(error.message); uni.$u.toast(error.message);
return false; return false;
} }
const redirect_url = decodeURIComponent(`${ENV.staticUrl}/payResult?orderId=${orderId}&payType=wxh5`); const redirect_url = decodeURIComponent(`${ENV.VUE_APP_STATIC_URL}/payResult?orderId=${orderId}&payType=wxh5`);
window.location.href = `${result.payDataInfo.h5Url}&redirect_url=${redirect_url}`; window.location.href = `${result.payDataInfo.h5Url}&redirect_url=${redirect_url}`;
} }
// #endif // #endif

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-06-21 16:01:19 * @Date: 2022-06-21 16:01:19
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-29 10:20:40 * @LastEditTime: 2022-07-01 17:55:01
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -19,7 +19,7 @@
</view> </view>
</template> </template>
<script> <script>
import {Debounce} from '@/common/utils'; import {Debounce, HandleApiError} from '@/common/utils';
import {ApiPutCommentUseful} from '@/common/api/comment' import {ApiPutCommentUseful} from '@/common/api/comment'
export default { export default {
props : { props : {
@ -36,13 +36,18 @@ export default {
} }
}, },
watch :{ watch :{
commentDetail (){ commentDetail :{
this.isLike = this.commentDetail.isLike; handler(){
this.usefulCount = this.commentDetail.usefulCount; this.isLike = this.commentDetail.isLike;
this.usefulCount = this.commentDetail.usefulCount;
},
deep:true
} }
}, },
mounted(){ mounted(){
this.isLike = this.commentDetail.isLike; this.isLike = this.commentDetail.isLike;
// console.log('---',this.isLike,this.commentDetail.usefulCount);
this.usefulCount = this.commentDetail.usefulCount; this.usefulCount = this.commentDetail.usefulCount;
}, },
methods:{ methods:{
@ -66,6 +71,7 @@ export default {
commentId : this.commentDetail.id, commentId : this.commentDetail.id,
isLike : this.isLike isLike : this.isLike
}); });
HandleApiError(error);
} }
} }

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-06-21 22:27:52 * @Date: 2022-06-21 22:27:52
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-21 22:29:18 * @LastEditTime: 2022-07-01 17:14:36
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -10,7 +10,7 @@
<image class="comment-user--avatr" :src="userData.userAvatar" shape="circle"/> <image class="comment-user--avatr" :src="userData.userAvatar" shape="circle"/>
<view> <view>
<view class="comment-user--name">{{userData.userName}}</view> <view class="comment-user--name">{{userData.userName}}</view>
<text class="comment-user--sku">已购买{{userData.skuName}}</text> <text class="comment-user--sku" v-if="userData.skuName">{{userData.skuName}}</text>
</view> </view>
</view> </view>
</template> </template>

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-04-19 11:37:50 * @Date: 2022-04-19 11:37:50
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-05 11:08:44 * @LastEditTime: 2022-06-29 17:27:12
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -12,7 +12,7 @@
<script> <script>
import UiRadioPicker from './UiRadioPicker.vue' import UiRadioPicker from './UiRadioPicker.vue'
import { ApiPostWxPay } from '@/common/api/order'; import { ApiPostWxPay } from '@/common/api/order';
import { Wxpay } from '@/common/utils'; import { Wxpay, Alipay } from '@/common/utils';
export default { export default {
components: { UiRadioPicker }, components: { UiRadioPicker },
props : { props : {
@ -32,13 +32,19 @@ export default {
label : '微信支付', label : '微信支付',
value : 'wxpay' value : 'wxpay'
}, },
// {
// label : '',
// value : 'alipay'
// }
] ]
} }
}, },
mounted(){
// APP
if(!this.$store.state.openId){
this.options.push({
label : '支付宝支付',
value : 'alipay'
})
}
},
methods:{ methods:{
confirm(val){ confirm(val){
const orderId = this.order.orderId; const orderId = this.order.orderId;
@ -46,7 +52,8 @@ export default {
Wxpay({orderId, openId: this.$store.state.openId}); Wxpay({orderId, openId: this.$store.state.openId});
this.close(); this.close();
}else{ }else{
uni.$u.toast('暂不支持支付宝支付'); // uni.$u.toast('');
Alipay({orderId})
} }
}, },
close(){ close(){

@ -1,6 +1,6 @@
{ {
"name" : "马士兵严选", "name" : "马士兵严选",
"appid" : "__UNI__3FB31B6", "appid" : "__UNI__5FEB250",
"description" : "", "description" : "",
"versionName" : "1.0.1", "versionName" : "1.0.1",
"versionCode" : "100", "versionCode" : "100",
@ -40,10 +40,14 @@
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
] ],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
"minSdkVersion" : 21
}, },
/* ios */ /* ios */
"ios" : {}, "ios" : {
"dSYMs" : false
},
/* SDK */ /* SDK */
"sdkConfigs" : { "sdkConfigs" : {
"ad" : {}, "ad" : {},
@ -52,39 +56,18 @@
"__platform__" : [ "android" ], "__platform__" : [ "android" ],
"appid" : "wx17b34a4a90ef18f7", "appid" : "wx17b34a4a90ef18f7",
"UniversalLinks" : "" "UniversalLinks" : ""
},
"alipay" : {
"__platform__" : [ "android" ]
} }
} }
}, },
"icons" : { "icons" : {
"android" : { "android" : {
"hdpi" : "unpackage/res/icons/72x72.png", "hdpi" : "src/static/app-icon/72.png",
"xhdpi" : "unpackage/res/icons/96x96.png", "xhdpi" : "src/static/app-icon/96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png", "xxhdpi" : "src/static/app-icon/144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png" "xxxhdpi" : "src/static/app-icon/192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
} }
} }
} }
@ -118,21 +101,7 @@
"base" : "" "base" : ""
}, },
"devServer" : { "devServer" : {
"proxy" : { "port" : 8080
"/uc/" : {
// "target" : "https://k8s-horse-gateway.mashibing.cn"
"target" : "http://192.168.10.118:8090"
},
"/mall/" : {
"target" : "http://192.168.10.118:8090"
},
"/pay/" : {
"target" : "https://k8s-horse-gateway.mashibing.cn"
},
"/oss/" : {
"target" : "https://k8s-horse-gateway.mashibing.cn"
}
}
}, },
"optimization" : { "optimization" : {
"treeShaking" : { "treeShaking" : {

@ -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",
@ -58,6 +65,13 @@
"navigationBarTitleText": "马士兵严选" "navigationBarTitleText": "马士兵严选"
} }
}, },
{
"path": "pages/goods/enable",
"aliasPath" : "/enable",
"style": {
"navigationBarTitleText": "商品详情"
}
},
{ {
"path": "pages/goods/comment/list", "path": "pages/goods/comment/list",
"aliasPath" : "/goodsCommentList", "aliasPath" : "/goodsCommentList",

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-06-21 18:19:13 * @Date: 2022-06-21 18:19:13
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-30 17:58:44 * @LastEditTime: 2022-07-01 17:12:16
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -164,6 +164,7 @@ export default {
isLike : this.isLike isLike : this.isLike
}); });
HandleApiError(error);
} }
} }
} }

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-06-22 15:15:22 * @Date: 2022-06-22 15:15:22
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-30 17:59:59 * @LastEditTime: 2022-07-01 17:14:16
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -19,7 +19,7 @@
<image class="preview--avatar" :src="data.userAvatar"></image> <image class="preview--avatar" :src="data.userAvatar"></image>
<view> <view>
<view>{{data.userName}}</view> <view>{{data.userName}}</view>
<view>已购买{{data.skuName}}</view> <view v-if="data.skuName">{{data.skuName}}</view>
</view> </view>
</view> </view>
<view> <view>
@ -46,7 +46,7 @@
import BsCommentUserInfo from '@/components/BsCommentUserInfo.vue'; import BsCommentUserInfo from '@/components/BsCommentUserInfo.vue';
import BsCommentThumbup from '../../../components/BsCommentThumbup.vue'; import BsCommentThumbup from '../../../components/BsCommentThumbup.vue';
import {ApiPutCommentUseful} from '@/common/api/comment' import {ApiPutCommentUseful} from '@/common/api/comment'
import { Debounce,FormatDate} from '@/common/utils' import { Debounce,FormatDate, HandleApiError} from '@/common/utils'
export default { export default {
components: { BsCommentUserInfo,BsCommentThumbup }, components: { BsCommentUserInfo,BsCommentThumbup },
@ -96,6 +96,7 @@ export default {
isLike : this.isLike isLike : this.isLike
}); });
HandleApiError(error);
} }
} }
} }

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-03-23 17:27:21 * @Date: 2022-03-23 17:27:21
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-22 22:08:16 * @LastEditTime: 2022-07-04 16:26:33
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -107,6 +107,10 @@ export default {
if(HandleApiError(error, 'getGoodsDetail')){ if(HandleApiError(error, 'getGoodsDetail')){
return false; return false;
} }
if(!result.isEnable){
this.$Router.replace('/enable')
return false;
}
this.goods = {...result, this.goods = {...result,
images : result.pictureList || [], images : result.pictureList || [],
}; };

@ -0,0 +1,83 @@
<!--
* @Author: ch
* @Date: 2022-03-28 17:16:44
* @LastEditors: ch
* @LastEditTime: 2022-07-13 20:05:42
* @Description: file content
-->
<template>
<view>
<UiWhiteBox class="main">
<image class="icon" src="@/static/goods/cart.png"/>
<view class="title">商品已下架</view>
<view class="btns">
<UiButton class="btn" @click="$Router.pushTab('/')"></UiButton>
</view>
</UiWhiteBox>
<view class="recommend-title">为您推荐</view>
<BsChoiceGoods/>
</view>
</template>
<script>
import UiButton from '@/components/UiButton.vue'
import BsChoiceGoods from '../../components/BsChoiceGoods.vue'
import UiWhiteBox from '../../components/UiWhiteBox.vue'
export default {
components: { UiButton, BsChoiceGoods, UiWhiteBox }
}
</script>
<style lang="scss">
page {
background: $color-grey1;
text-align: center;
}
</style>
<style lang="scss" scoped>
.main{
padding-bottom: 40rpx;
}
.icon{
width: 400rpx;
height: 256rpx;
margin: 169rpx auto 42rpx;
}
.title{
font-size: $font-size-lg;
line-height: 44rpx;
color: $color-grey6;
}
.desc{
font-size: $font-size-sm;
line-height: 34rpx;
color: $color-grey4;
}
.btns{
margin: 74rpx 105rpx 0;
display: flex;
justify-content: space-between;
}
.recommend-title{
font-size: $font-size-lg;
text-align: center;
margin: 51rpx auto 30rpx auto;
display: flex;
align-items: center;
justify-content: space-between;
width: 500rpx;
&::after,&::before{
display: inline-block;
content: '';
width: 160rpx;
height: 2rpx;
background: linear-gradient(90deg, $color-grey3 0%, rgba(204, 204, 204, 0) 100%);
}
&::before{
background: linear-gradient(270deg, $color-grey3 0%, rgba(204, 204, 204, 0) 100%);
}
}
</style>

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-04-15 17:46:10 * @Date: 2022-04-15 17:46:10
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-29 20:39:45 * @LastEditTime: 2022-07-13 18:20:38
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -23,7 +23,7 @@
<!-- 待支付可以取消支付订单 --> <!-- 待支付可以取消支付订单 -->
<template v-if="orderInfo.orderStatus === 1"> <template v-if="orderInfo.orderStatus === 1">
<UiButton class="footer--btn" @click="cancelShow = true">取消订单</UiButton> <UiButton class="footer--btn" @click="cancelShow = true">取消订单</UiButton>
<UiButton class="footer--btn" type="gradual" @click="payShow = true">去支</UiButton> <UiButton class="footer--btn" type="gradual" @click="handlePay"></UiButton>
</template> </template>
<u-popup class="cancel" :show="cancelShow" @close="closeCancel" round="16rpx" closeable> <u-popup class="cancel" :show="cancelShow" @close="closeCancel" round="16rpx" closeable>
<view class="cancel--title">取消订单原因</view> <view class="cancel--title">取消订单原因</view>
@ -49,15 +49,17 @@
<UiButton type="gradual" :disabed="cancelValue == 0" @click="cancelOrder"></UiButton> <UiButton type="gradual" :disabed="cancelValue == 0" @click="cancelOrder"></UiButton>
</view> </view>
</u-popup> </u-popup>
<BsPay class="modal" :show.sync="payShow" :order="orderInfo"></BsPay> <!-- <BsPay class="modal" :show.sync="payShow" :order="orderInfo"></BsPay> -->
</view> </view>
</template> </template>
<script> <script>
import UiButton from '@/components/UiButton.vue' import UiButton from '@/components/UiButton.vue'
import UiCell from '@/components/UiCell.vue' import UiCell from '@/components/UiCell.vue'
import {ApiPutCancelOrder,ApiPutOrderReceive} from '@/common/api/order' import {ApiPutCancelOrder,ApiPutOrderReceive} from '@/common/api/order';
import {ApiPostCashierPrepay} from '@/common/api/pay';
import BsPay from '../../../../components/BsPay.vue'; import BsPay from '../../../../components/BsPay.vue';
import ORDER from '@/common/dicts/order'; import ORDER from '@/common/dicts/order';
const ENV = process.env;
export default { export default {
components: { UiButton, UiCell, BsPay }, components: { UiButton, UiCell, BsPay },
props : { props : {
@ -72,8 +74,6 @@ export default {
// //
cancelShow : false, cancelShow : false,
cancelValue : 0, cancelValue : 0,
//
payShow : false
} }
}, },
methods : { methods : {
@ -119,29 +119,39 @@ export default {
} }
} }
}) })
// this.$msb.confirm({
// content : '',
// confirm : async ()=>{
// const {error} = await ApiPutOrderReceive({
// orderId : this.$Route.query.id
// });
// if(error){
// uni.$toast(error.message);
// return false;
// }
// this.$Router.push('/orderSuccess');
// }
// })
}, },
service(){ service(){
// uni.$u.toast('')
this.$Router.push({ this.$Router.push({
path : '/messageChat', path : '/messageChat',
query : { query : {
orderId : this.orderInfo.orderId orderId : this.orderInfo.orderId
} }
}) })
},
async handlePay(){
let payType = 'wxjsapi'
if(!this.$store.state.openId){
payType = 'h5'
}
const {error, result} = await ApiPostCashierPrepay({
orderId:this.orderInfo.orderId,
returnUrl : `${ENV.VUE_APP_STATIC_URL}/payResult?orderId=${this.orderInfo.orderId}&payType=${payType}`
});
if(error){
uni.$u.toast(error.message);
return false;
}
// #ifdef H5
window.location.href = result.wapCashierUrl;
// #endif
// #ifndef H5
this.$Router.push(`/webView?url=${encodeURIComponent(result.wapCashierUrl)}`);
// #endif
} }
} }
} }

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-03-22 10:58:24 * @Date: 2022-03-22 10:58:24
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-29 20:29:48 * @LastEditTime: 2022-07-13 18:21:13
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -32,7 +32,7 @@
<view class="orders--footer"> <view class="orders--footer">
<UiButton size="min" type="gradual" <UiButton size="min" type="gradual"
v-if="item.orderStatus === ORDER.STATUS.AWAIT_PAY" @click="pay(item)">去支付</UiButton> v-if="item.orderStatus === ORDER.STATUS.AWAIT_PAY" @click="handlePay(item)">去支付</UiButton>
<UiButton size="min" v-if="[ORDER.STATUS.CLOSE,ORDER.STATUS.AWAIT_PAY].includes(item.orderStatus)" <UiButton size="min" v-if="[ORDER.STATUS.CLOSE,ORDER.STATUS.AWAIT_PAY].includes(item.orderStatus)"
@click="$Router.push(`/orderDetail?id=${item.orderId}`)">查看详情</UiButton> @click="$Router.push(`/orderDetail?id=${item.orderId}`)">查看详情</UiButton>
<UiButton size="min" v-if="item.orderStatus >= ORDER.STATUS.FINISH_SEND_GOODS" <UiButton size="min" v-if="item.orderStatus >= ORDER.STATUS.FINISH_SEND_GOODS"
@ -49,18 +49,20 @@
</view> </view>
<u-loadmore :status="loadingStatus" v-if="loadingStatus !== 'nomore'"/> <u-loadmore :status="loadingStatus" v-if="loadingStatus !== 'nomore'"/>
<BsPay :show.sync="payShow" :order="payOrder"></BsPay> <!-- <BsPay :show.sync="payShow" :order="payOrder"></BsPay> -->
</view> </view>
</template> </template>
<script> <script>
import BsEmpty from '@/components/BsEmpty.vue'; import BsEmpty from '@/components/BsEmpty.vue';
import UiButton from '@/components/UiButton.vue'; import UiButton from '@/components/UiButton.vue';
import { ApiGetOrderList, ApiPutOrderReceive } from '@/common/api/order'; import { ApiGetOrderList, ApiPutOrderReceive } from '@/common/api/order';
import {ApiPostCashierPrepay} from '@/common/api/pay';
import BsPay from '../../components/BsPay.vue'; import BsPay from '../../components/BsPay.vue';
import UiGoodsInfo from '../../components/UiGoodsInfo.vue'; import UiGoodsInfo from '../../components/UiGoodsInfo.vue';
import UiGoodsInfoMax from '../../components/UiGoodsInfoMax.vue'; import UiGoodsInfoMax from '../../components/UiGoodsInfoMax.vue';
import UiMoney from '../../components/UiMoney.vue'; import UiMoney from '../../components/UiMoney.vue';
import ORDER from '@/common/dicts/order'; import ORDER from '@/common/dicts/order';
const ENV = process.env;
export default { export default {
components: { BsEmpty, UiButton, BsPay, UiGoodsInfo, UiGoodsInfoMax, UiMoney }, components: { BsEmpty, UiButton, BsPay, UiGoodsInfo, UiGoodsInfoMax, UiMoney },
@ -80,7 +82,6 @@ export default {
pageIndex : 1, pageIndex : 1,
pageSize : 10, pageSize : 10,
payShow : false,
payOrder : null payOrder : null
} }
}, },
@ -134,9 +135,25 @@ export default {
/** /**
* 立即支付 * 立即支付
*/ */
pay(item){ async handlePay(item){
this.payShow = true;
this.payOrder = item; let payType = 'wxjsapi'
if(!this.$store.state.openId){
payType = 'h5'
}
const {error, result} = await ApiPostCashierPrepay({
orderId:item.orderId,
returnUrl : `${ENV.VUE_APP_STATIC_URL}/payResult?orderId=${item.orderId}&payType=${payType}`
});
// #ifdef H5
window.location.href = result.wapCashierUrl
// #endif
// #ifndef H5
this.$Router.push(`/webView?url=${encodeURIComponent(result.wapCashierUrl)}`);
// #endif
}, },
/** /**

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-04-28 15:01:41 * @Date: 2022-04-28 15:01:41
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-22 14:53:43 * @LastEditTime: 2022-07-13 18:41:57
* @Description: file content * @Description: file content
--> -->
@ -58,7 +58,7 @@ export default {
uni.$u.toast(error.message); uni.$u.toast(error.message);
return false return false
} }
if(!result.isSuccess && this.reuqestNum < 5){ if(!result.isSuccess && this.reuqestNum < 10){
setTimeout(()=>{ setTimeout(()=>{
this.getOrderInfo(); this.getOrderInfo();
}, 1000) }, 1000)
@ -69,9 +69,11 @@ export default {
}, },
back(){ back(){
const payType = this.$Route.query.payType; const payType = this.$Route.query.payType;
if(payType !== 'wxjsapi'){ if(payType === 'wxjsapi'){
this.$Router.back(2); this.$Router.back();
}else{ }else if(payType === 'h5'){
history.back(2);
}else if(payType === 'appWx'){
this.$Router.back(); this.$Router.back();
} }
} }

@ -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-05-26 16:33:14 * @LastEditTime: 2022-07-13 18:18:18
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -34,21 +34,6 @@
maxlength="50" placeholder="填写您想要备注的信息50字以内" /> maxlength="50" placeholder="填写您想要备注的信息50字以内" />
</UiCell> </UiCell>
</UiWhiteBox> </UiWhiteBox>
<UiWhiteBox>
<text class="play--title">支付方式</text>
<radio-group>
<u-cell title="微信支付" :border="false" @click="payType = 'wxpay'">
<image class="play--icon" slot="icon" src="@/static/order/wx.png"/>
<radio class="play--radio" slot="right-icon" color="#FF875B"
:checked="payType == 'wxpay'" ></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>
@ -71,11 +56,13 @@
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} from '@/common/utils'; import {Wxpay, Alipay} from '@/common/utils';
import UiButton from '@/components/UiButton.vue'; import UiButton from '@/components/UiButton.vue';
import UiWhiteBox from '../../components/UiWhiteBox.vue'; import UiWhiteBox from '../../components/UiWhiteBox.vue';
import UiGoodsInfo from '../../components/UiGoodsInfo.vue'; import UiGoodsInfo from '../../components/UiGoodsInfo.vue';
const ENV = process.env;
export default { export default {
components : {UiCell, UiButton, UiWhiteBox, UiGoodsInfo }, components : {UiCell, UiButton, UiWhiteBox, UiGoodsInfo },
data(){ data(){
@ -84,7 +71,6 @@ export default {
address : {}, address : {},
userMessage : '', userMessage : '',
orderInfo : {}, orderInfo : {},
payType : 'wxpay',
productType : this.$Route.query.productType, productType : this.$Route.query.productType,
} }
}, },
@ -189,11 +175,28 @@ export default {
uni.$u.toast(error.message); uni.$u.toast(error.message);
return false; return false;
} }
if(this.payType === 'wxpay'){ let payType = 'wxjsapi'
Wxpay({orderId : result.orderId, openId : this.$store.state.openId}); if(!this.$store.state.openId){
}else{ payType = 'h5'
uni.$u.toast('暂不支持支付宝支付');
} }
const {error:er, result:res} = await ApiPostCashierPrepay({
orderId:result.orderId,
returnUrl : `${ENV.VUE_APP_STATIC_URL}/payResult?orderId=${result.orderId}&payType=${payType}`
});
if(er){
uni.$u.toast(er.message);
return false;
}
// #ifdef H5
window.location.replace(res.wapCashierUrl)
// #endif
// #ifndef H5
this.$Router.push(`/webView?url=${encodeURIComponent(res.wapCashierUrl)}`);
// #endif
} }
} }
} }

@ -0,0 +1,35 @@
<!--
* @Author: ch
* @Date: 2022-07-12 17:19:59
* @LastEditors: ch
* @LastEditTime: 2022-07-12 18:35:24
* @Description: file content
-->
<template><view>
<web-view :src="url"></web-view>
</view>
</template>
<script>
export default {
data (){
return {
url : ''
}
},
onLoad(){
this.url = decodeURIComponent(this.$Route.query.url);
},
onReady() {
var currentWebview = this.$scope.$getAppWebview() //html5plusplus.webview.currentWebview()uni-appvue使plus.webview.currentWebview()
setTimeout(function() {
let wv = currentWebview.children()[0];
wv.addEventListener('loaded',function() {
console.log('xxxxx',wv.getURL())
console.log(wv.getURL()) //url
console.log(wv.getTitle()) //
}, false);
}, 1000); //
}
}
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Loading…
Cancel
Save