This commit is contained in:
weipengfei 2024-03-22 17:49:14 +08:00
commit 9d59bcd0e3
4 changed files with 170 additions and 138 deletions

View File

@ -96,7 +96,7 @@
action: 'payClose' action: 'payClose'
}); });
}, },
goPay: function(number, paytype) { goPay: async function(number, paytype) {
if (this.isCall) { if (this.isCall) {
return this.$emit('onChangeFun', { return this.$emit('onChangeFun', {
action: 'payCheck', action: 'payCheck',
@ -137,6 +137,17 @@
this.type = type; this.type = type;
if (paytype == 'balance' || paytype == 'merBalance') { if (paytype == 'balance' || paytype == 'merBalance') {
//
const result = await this.$util.checkPassword();
if (result.data.code == 101) { //
return this.$util.Tips({
title: "您暂未设置支付密码,请前往设置!"
}, () => {
uni.navigateTo({
url: "/pages/users/user_modify_pwd/index?type=payPwd"
});
})
}
this.$refs.popups.handleOpen(); this.$refs.popups.handleOpen();
} else { } else {
uni.showLoading({ uni.showLoading({
@ -147,26 +158,18 @@
}, },
// //
handleConfirm(e) { async handleConfirm(e) {
// const result = await this.$util.checkPassword(e);
verifyPwd({ //
withdrawal_pwd: e if (result.data.code == 100) {
}).then(res => { uni.showLoading({
// title: '订单支付中',
const code = res.data.code; mask: true
});
if (code == 100) { // this.trueOrderPay(e);
uni.showLoading({ } else {
title: '订单支付中', this.$refs.payPwd.handleOpen(result.data.code);
mask: true }
});
this.trueOrderPay();
} else {
this.$refs.payPwd.handleOpen(code);
}
}).catch(err => {
console.log(err)
})
}, },
handleClear() {}, handleClear() {},
@ -190,12 +193,13 @@
} }
}, },
trueOrderPay() { trueOrderPay(e) {
let that = this; let that = this;
let orderApi = that.order_type === 1 ? presellOrderPay : that.order_type === 2 ? integralOrderPay : let orderApi = that.order_type === 1 ? presellOrderPay : that.order_type === 2 ? integralOrderPay :
orderPay orderPay
orderApi(that.order_id, { orderApi(that.order_id, {
type: that.type, type: that.type,
withdrawal_pwd: e,
// #ifdef H5 // #ifdef H5
return_url: that.returnUrl !== '' ? 'http://' + window.location.host + that.returnUrl : return_url: that.returnUrl !== '' ? 'http://' + window.location.host + that.returnUrl :
'http://' + window.location.host + '/pages/users/order_list/index', 'http://' + window.location.host + '/pages/users/order_list/index',

View File

@ -480,7 +480,6 @@
}); });
}, },
fail: (e) => { fail: (e) => {
console.log(e, '111111111')
// //
let url = '/pages/order_pay_status/index?order_id=' + orderId + let url = '/pages/order_pay_status/index?order_id=' + orderId +
'&msg=取消支付' + '&product_type=' + that.product_type + '&msg=取消支付' + '&product_type=' + that.product_type +
@ -580,7 +579,7 @@
}); });
}, },
SubOrder: function() { SubOrder: async function() {
let that = this, let that = this,
data = {}; data = {};
if (!that.payType) return that.$util.Tips({ if (!that.payType) return that.$util.Tips({
@ -596,6 +595,19 @@
// //
if (that.payType == 'balance' || that.payType == 'merBalance') { if (that.payType == 'balance' || that.payType == 'merBalance') {
//
const result = await this.$util.checkPassword();
if (result.data.code == 101) { //
return this.$util.Tips({
title: "您暂未设置支付密码,请前往设置!"
}, () => {
uni.navigateTo({
url: "/pages/users/user_modify_pwd/index?type=payPwd"
});
})
}
this.$refs.popups.handleOpen(); this.$refs.popups.handleOpen();
} else { } else {
uni.showLoading({ uni.showLoading({
@ -606,29 +618,20 @@
} }
}, },
// //
handleConfirm(e) { async handleConfirm(e) {
// const result = await this.$util.checkPassword(e);
verifyPwd({ //
withdrawal_pwd: e if (result.data.code == 100) {
}).then(res => {
//
const code = res.data.code;
this.$set(this.payForm, 'withdrawal_pwd', e); this.$set(this.payForm, 'withdrawal_pwd', e);
uni.showLoading({
if (code == 100) { // title: '订单支付中',
uni.showLoading({ mask: true
title: '订单支付中', });
mask: true this.truePayOrder(this.payForm);
}); } else {
this.truePayOrder(this.payForm); this.$refs.payPwd.handleOpen(result.data.code);
} else { }
this.$refs.payPwd.handleOpen(code);
}
}).catch(err => {
console.log(err)
})
}, },
// 101 102 // 101 102

View File

@ -754,7 +754,7 @@
isShow: false, isShow: false,
moneyInfo: {}, moneyInfo: {},
orderData: {}, // orderData: {}, //
sale_type: 1, sale_type: 1,
}; };
}, },
computed: { computed: {
@ -773,7 +773,7 @@
mounted: function() {}, mounted: function() {},
onLoad: function(options) { onLoad: function(options) {
this.seckillId = options.seckillId this.seckillId = options.seckillId
if(options.sale_type) this.sale_type = options.sale_type; if (options.sale_type) this.sale_type = options.sale_type;
// #ifdef H5 // #ifdef H5
this.from = this.$wechat.isWeixin() ? 'weixin' : 'h5' this.from = this.$wechat.isWeixin() ? 'weixin' : 'h5'
// #endif // #endif
@ -1413,7 +1413,8 @@
orderId = res.data.result.order_id, orderId = res.data.result.order_id,
callback_key = res.data.result.pay_key, callback_key = res.data.result.pay_key,
jsConfig = res.data.result.config, jsConfig = res.data.result.config,
goPages = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=' + res.message + '&sale_type=' + that.sale_type; goPages = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=' + res.message +
'&sale_type=' + that.sale_type;
that.orderPay = true; that.orderPay = true;
uni.hideLoading(); uni.hideLoading();
switch (status) { switch (status) {
@ -1678,7 +1679,7 @@
this.virtualIndex = index; this.virtualIndex = index;
}, },
SubOrder: function(e) { SubOrder: async function(e) {
let that = this, let that = this,
data = {}; data = {};
if (!that.payType) return that.$util.Tips({ if (!that.payType) return that.$util.Tips({
@ -1828,39 +1829,44 @@
// //
if (data.pay_type == 'balance' || data.pay_type == 'merBalance') { if (data.pay_type == 'balance' || data.pay_type == 'merBalance') {
this.orderData = data; this.orderData = data;
//
const result = await this.$util.checkPassword();
if (result.data.code == 101) { //
return this.$util.Tips({
title: "您暂未设置支付密码,请前往设置!"
}, () => {
uni.navigateTo({
url: "/pages/users/user_modify_pwd/index?type=payPwd"
});
})
}
//
this.$refs.popups.handleOpen(); this.$refs.popups.handleOpen();
} else { } else { //
this.truePayOrder(data); this.truePayOrder(data);
} }
}, },
// //
handleConfirm(e) { async handleConfirm(e) {
// const result = await this.$util.checkPassword(e);
verifyPwd({ //
withdrawal_pwd: e if (result.data.code == 100) {
}).then(res => { this.$set(this.orderData, 'withdrawal_pwd', e);
uni.showLoading({
// title: '订单支付中',
const code = res.data.code; mask: true
});
if (code == 100) { // this.truePayOrder(this.orderData);
this.$set(this.orderData, 'withdrawal_pwd', e); } else {
uni.showLoading({ this.$refs.payPwd.handleOpen(result.data.code);
title: '订单支付中', }
mask: true
});
this.truePayOrder(this.orderData);
} else {
this.$refs.payPwd.handleOpen(code);
}
}).catch(err => {
console.log(err)
})
}, },
// 101 102 // 101 102
handleLeft(code) { handleLeft() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/users/user_modify_pwd/index?type=payPwd" url: "/pages/users/user_modify_pwd/index?type=payPwd"
}); });

View File

@ -12,6 +12,10 @@ import {
HTTP_REQUEST_URL HTTP_REQUEST_URL
} from '../config/app.js'; } from '../config/app.js';
import store from '../store'; import store from '../store';
import {
verifyPwd
} from '@/api/order.js';
import { import {
pathToBase64 pathToBase64
} from '@/plugin/image-tools/index.js'; } from '@/plugin/image-tools/index.js';
@ -19,6 +23,15 @@ import {
import permision from "./permission.js" import permision from "./permission.js"
// #endif // #endif
export default { export default {
// 是否设置密码
checkPassword: async function(e) {
e = e ? e : '';
return await verifyPwd({
withdrawal_pwd: e
});
},
/** /**
* 字符串截取 * 字符串截取
* @obj 传入的数据 * @obj 传入的数据
@ -182,7 +195,7 @@ export default {
arr.push(text.slice(str, text.length)); arr.push(text.slice(str, text.length));
return [strLength, arr, rows] // [处理文字的总字节长度,每行显示内容的数组,行数] return [strLength, arr, rows] // [处理文字的总字节长度,每行显示内容的数组,行数]
}, },
/** /**
* 获取分享海报 * 获取分享海报
* @param array arr2 海报素材 * @param array arr2 海报素材
* @param string store_name 素材文字 * @param string store_name 素材文字
@ -199,7 +212,7 @@ export default {
* 只能获取合法域名下的图片信息,本地调试无法获取 * 只能获取合法域名下的图片信息,本地调试无法获取
* *
*/ */
uni.getImageInfo({ uni.getImageInfo({
src: arr2[0], src: arr2[0],
success: function(res) { success: function(res) {
console.log(res, 'getImageInfo') console.log(res, 'getImageInfo')
@ -217,7 +230,8 @@ export default {
ctx.drawImage(arr2[2], cx, cy, d, d); ctx.drawImage(arr2[2], cx, cy, d, d);
ctx.restore(); ctx.restore();
const CONTENT_ROW_LENGTH = 40; const CONTENT_ROW_LENGTH = 40;
let [contentLeng, contentArray, contentRows] = that.textByteLength(store_name, CONTENT_ROW_LENGTH); let [contentLeng, contentArray, contentRows] = that.textByteLength(store_name,
CONTENT_ROW_LENGTH);
if (contentRows > 2) { if (contentRows > 2) {
contentRows = 2; contentRows = 2;
let textArray = contentArray.slice(0, 2); let textArray = contentArray.slice(0, 2);
@ -277,26 +291,26 @@ export default {
* 只能获取合法域名下的图片信息,本地调试无法获取 * 只能获取合法域名下的图片信息,本地调试无法获取
* *
*/ */
uni.getImageInfo({ uni.getImageInfo({
src: arr2[0], src: arr2[0],
success: function(res) { success: function(res) {
console.log(res, 'getImageInfo') console.log(res, 'getImageInfo')
const WIDTH = res.width; const WIDTH = res.width;
const HEIGHT = res.height; const HEIGHT = res.height;
ctx.drawImage(arr2[0], 0, 0, WIDTH, HEIGHT+50); ctx.drawImage(arr2[0], 0, 0, WIDTH, HEIGHT + 50);
ctx.save(); ctx.save();
let r = 90; let r = 90;
let d = r * 2; let d = r * 2;
let cx = 555; let cx = 555;
let cy = 910; let cy = 910;
let ux = 50; let ux = 50;
let uy = 50; let uy = 50;
ctx.arc(cx + r, cy + r, r, 0, 2 * Math.PI); ctx.arc(cx + r, cy + r, r, 0, 2 * Math.PI);
that.handleBorderRect(ctx, 30, 30, 50, 50, 25); that.handleBorderRect(ctx, 30, 30, 50, 50, 25);
ctx.clip(); ctx.clip();
ctx.drawImage(arr2[3], 30, 30, 50, 50); ctx.drawImage(arr2[3], 30, 30, 50, 50);
ctx.restore(); ctx.restore();
ctx.drawImage(arr2[2], cx, cy-30, d-30, d-30); ctx.drawImage(arr2[2], cx, cy - 30, d - 30, d - 30);
ctx.save(); ctx.save();
ctx.restore(); ctx.restore();
ctx.setTextAlign('left'); ctx.setTextAlign('left');
@ -304,12 +318,14 @@ export default {
ctx.setFillStyle('#282828'); ctx.setFillStyle('#282828');
ctx.fillText(site_name, r, 62); ctx.fillText(site_name, r, 62);
const CONTENT_ROW_LENGTH = 26; const CONTENT_ROW_LENGTH = 26;
let [contentLeng, contentArray, contentRows] = that.textByteLength(store_name, CONTENT_ROW_LENGTH); let [contentLeng, contentArray, contentRows] = that.textByteLength(store_name,
CONTENT_ROW_LENGTH);
if (contentRows > 2) { if (contentRows > 2) {
contentRows = 2; contentRows = 2;
let textArray = contentArray.slice(0, 2); let textArray = contentArray.slice(0, 2);
textArray[textArray.length - 1] = textArray[textArray.length - 1].slice(0,textArray[textArray.length - 1].length-1) textArray[textArray.length - 1] = textArray[textArray.length - 1].slice(0,
textArray[textArray.length - 1] += '…'; textArray[textArray.length - 1].length - 1)
textArray[textArray.length - 1] += '…';
contentArray = textArray; contentArray = textArray;
} }
ctx.setFontSize(32); ctx.setFontSize(32);
@ -323,18 +339,18 @@ export default {
ctx.setFontSize(26); ctx.setFontSize(26);
ctx.setFillStyle('#999999'); ctx.setFillStyle('#999999');
ctx.beginPath(); ctx.beginPath();
const textWidth = ctx.measureText(ot_price+'¥').width + 16; //检查字体的宽度 const textWidth = ctx.measureText(ot_price + '¥').width + 16; //检查字体的宽度
//绘制数字中间的矩形 //绘制数字中间的矩形
ctx.setFillStyle('#999999'); ctx.setFillStyle('#999999');
ctx.rect(35, 1062,textWidth-10, 1); ctx.rect(35, 1062, textWidth - 10, 1);
ctx.fill(); ctx.fill();
ctx.closePath(); ctx.closePath();
ctx.fillText('¥' + ot_price, 35, 1030 + contentHh); ctx.fillText('¥' + ot_price, 35, 1030 + contentHh);
// ctx.clip(); // ctx.clip();
// ctx.restore(); // ctx.restore();
that.handleBorderRect(ctx, 30, 108, WIDTH-60, WIDTH-20, 12); that.handleBorderRect(ctx, 30, 108, WIDTH - 60, WIDTH - 20, 12);
ctx.clip(); ctx.clip();
ctx.drawImage(arr2[1], 30, 108, WIDTH-60, WIDTH-20); ctx.drawImage(arr2[1], 30, 108, WIDTH - 60, WIDTH - 20);
ctx.draw(true, function() { ctx.draw(true, function() {
uni.canvasToTempFilePath({ uni.canvasToTempFilePath({
canvasId: 'myCanvas', canvasId: 'myCanvas',
@ -378,7 +394,7 @@ export default {
* 只能获取合法域名下的图片信息,本地调试无法获取 * 只能获取合法域名下的图片信息,本地调试无法获取
* *
*/ */
uni.getImageInfo({ uni.getImageInfo({
src: arr2[0], src: arr2[0],
success: function(res) { success: function(res) {
const WIDTH = res.width; const WIDTH = res.width;
@ -390,25 +406,26 @@ export default {
let ux = 50; let ux = 50;
let uy = 700; let uy = 700;
ctx.drawImage(arr2[0], 0, 0, WIDTH, HEIGHT); ctx.drawImage(arr2[0], 0, 0, WIDTH, HEIGHT);
ctx.drawImage(arr2[1], 32, 32, WIDTH-64, WIDTH-64); ctx.drawImage(arr2[1], 32, 32, WIDTH - 64, WIDTH - 64);
ctx.strokeStyle = "#ffffff"; ctx.strokeStyle = "#ffffff";
ctx.save(); ctx.save();
ctx.arc(cx + r, cy + r, r, 0, 2 * Math.PI); ctx.arc(cx + r, cy + r, r, 0, 2 * Math.PI);
ctx.drawImage(arr2[2], 530, 760, d, d); ctx.drawImage(arr2[2], 530, 760, d, d);
that.handleBorderRect(ctx, ux, uy, r, r, 45); that.handleBorderRect(ctx, ux, uy, r, r, 45);
ctx.clip(); ctx.clip();
ctx.stockStyle ="#ffffff"; ctx.stockStyle = "#ffffff";
ctx.drawImage(arr2[3], ux, uy, r, r); ctx.drawImage(arr2[3], ux, uy, r, r);
ctx.restore(); ctx.restore();
ctx.setTextAlign('left') ctx.setTextAlign('left')
ctx.setFontSize(28); ctx.setFontSize(28);
ctx.setFillStyle('#282828'); ctx.setFillStyle('#282828');
ctx.fillText(nickname, r+60, 760); ctx.fillText(nickname, r + 60, 760);
ctx.setTextAlign('left') ctx.setTextAlign('left')
ctx.setFontSize(28); ctx.setFontSize(28);
ctx.setFillStyle('#282828'); ctx.setFillStyle('#282828');
const CONTENT_ROW_LENGTH = 25; const CONTENT_ROW_LENGTH = 25;
let [contentLeng, contentArray, contentRows] = that.textByteLength(content, CONTENT_ROW_LENGTH); let [contentLeng, contentArray, contentRows] = that.textByteLength(content,
CONTENT_ROW_LENGTH);
if (contentRows > 2) { if (contentRows > 2) {
contentRows = 2; contentRows = 2;
let textArray = contentArray.slice(0, 2); let textArray = contentArray.slice(0, 2);
@ -416,11 +433,11 @@ export default {
contentArray = textArray; contentArray = textArray;
} }
ctx.setTextAlign('left'); ctx.setTextAlign('left');
ctx.font = 'bold 32px Arial'; ctx.font = 'bold 32px Arial';
let contentHh = 32 * 1.3; let contentHh = 32 * 1.3;
for (let m = 0; m < contentArray.length; m++) { for (let m = 0; m < contentArray.length; m++) {
ctx.fillText(contentArray[m], 55, 850 + contentHh * m); ctx.fillText(contentArray[m], 55, 850 + contentHh * m);
} }
ctx.draw(true, function() { ctx.draw(true, function() {
uni.canvasToTempFilePath({ uni.canvasToTempFilePath({
canvasId: 'myCanvas', canvasId: 'myCanvas',
@ -448,36 +465,36 @@ export default {
}) })
}, },
/** /**
* 图片圆角设置 * 图片圆角设置
* @param string x x轴位置 * @param string x x轴位置
* @param string y y轴位置 * @param string y y轴位置
* @param string w 图片宽 * @param string w 图片宽
* @param string y 图片高 * @param string y 图片高
* @param string r 圆角值 * @param string r 圆角值
*/ */
handleBorderRect(ctx, x, y, w, h, r) { handleBorderRect(ctx, x, y, w, h, r) {
ctx.beginPath(); ctx.beginPath();
// 左上角 // 左上角
ctx.arc(x + r, y + r, r, Math.PI, 1.5 * Math.PI); ctx.arc(x + r, y + r, r, Math.PI, 1.5 * Math.PI);
ctx.moveTo(x + r, y); ctx.moveTo(x + r, y);
ctx.lineTo(x + w - r, y); ctx.lineTo(x + w - r, y);
ctx.lineTo(x + w, y + r); ctx.lineTo(x + w, y + r);
// 右上角 // 右上角
ctx.arc(x + w - r, y + r, r, 1.5 * Math.PI, 2 * Math.PI); ctx.arc(x + w - r, y + r, r, 1.5 * Math.PI, 2 * Math.PI);
ctx.lineTo(x + w, y + h - r); ctx.lineTo(x + w, y + h - r);
ctx.lineTo(x + w - r, y + h); ctx.lineTo(x + w - r, y + h);
// 右下角 // 右下角
ctx.arc(x + w - r, y + h - r, r, 0, 0.5 * Math.PI); ctx.arc(x + w - r, y + h - r, r, 0, 0.5 * Math.PI);
ctx.lineTo(x + r, y + h); ctx.lineTo(x + r, y + h);
ctx.lineTo(x, y + h - r); ctx.lineTo(x, y + h - r);
// 左下角 // 左下角
ctx.arc(x + r, y + h - r, r, 0.5 * Math.PI, Math.PI); ctx.arc(x + r, y + h - r, r, 0.5 * Math.PI, Math.PI);
ctx.lineTo(x, y + r); ctx.lineTo(x, y + r);
ctx.lineTo(x + r, y); ctx.lineTo(x + r, y);
ctx.fill(); ctx.fill();
ctx.closePath(); ctx.closePath();
}, },
/** /**
* 用户信息分享海报 * 用户信息分享海报
* @param array arr2 海报素材 1背景 0二维码 * @param array arr2 海报素材 1背景 0二维码
@ -527,7 +544,8 @@ export default {
ctx.setFontSize(10); ctx.setFontSize(10);
} }
const CONTENT_ROW_LENGTH = 28; const CONTENT_ROW_LENGTH = 28;
let [contentLeng, contentArray, contentRows] = that.textByteLength(sitename, CONTENT_ROW_LENGTH); let [contentLeng, contentArray, contentRows] = that.textByteLength(sitename,
CONTENT_ROW_LENGTH);
if (contentRows > 2) { if (contentRows > 2) {
contentRows = 2; contentRows = 2;
let textArray = contentArray.slice(0, 2); let textArray = contentArray.slice(0, 2);
@ -539,10 +557,10 @@ export default {
let contentHh = 12 * 1.3; let contentHh = 12 * 1.3;
for (let m = 0; m < contentArray.length; m++) { for (let m = 0; m < contentArray.length; m++) {
ctx.fillText(contentArray[m], w * markx, h * marky + contentHh * m); ctx.fillText(contentArray[m], w * markx, h * marky + contentHh * m);
} }
// ctx.fillText(sitename, w * markx, h * marky); // ctx.fillText(sitename, w * markx, h * marky);
ctx.save(); ctx.save();
ctx.draw(false,setTimeout(()=>{ ctx.draw(false, setTimeout(() => {
uni.canvasToTempFilePath({ uni.canvasToTempFilePath({
canvasId: 'myCanvas' + index, canvasId: 'myCanvas' + index,
fileType: 'png', fileType: 'png',
@ -554,10 +572,10 @@ export default {
fail: function(err) { fail: function(err) {
console.log(err) console.log(err)
uni.hideLoading(); uni.hideLoading();
} }
}) })
},1000)) }, 1000))
}, },
fail: function(err) { fail: function(err) {
@ -592,7 +610,7 @@ export default {
count: count, //最多可以选择的图片总数 count: count, //最多可以选择的图片总数
sizeType: sizeType, // 可以指定是原图还是压缩图,默认二者都有 sizeType: sizeType, // 可以指定是原图还是压缩图,默认二者都有
sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有 sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有
success: async (res)=> { success: async (res) => {
let image = []; let image = [];
let filesLen = res.tempFiles.length; let filesLen = res.tempFiles.length;
let exceeded_list = []; let exceeded_list = [];
@ -674,7 +692,7 @@ export default {
}) })
}) })
}, },
/** /**
* 小程序头像获取上传 * 小程序头像获取上传
* @param uploadUrl 上传接口地址 * @param uploadUrl 上传接口地址
* @param filePath 上传文件路径 * @param filePath 上传文件路径
@ -683,7 +701,7 @@ export default {
*/ */
uploadImgs(uploadUrl, filePath, successCallback, errorCallback) { uploadImgs(uploadUrl, filePath, successCallback, errorCallback) {
let that = this; let that = this;
let inputName = 'pics'; let inputName = 'pics';
uni.uploadFile({ uni.uploadFile({
url: HTTP_REQUEST_URL + '/api/' + uploadUrl + '/' + inputName, url: HTTP_REQUEST_URL + '/api/' + uploadUrl + '/' + inputName,
filePath: filePath, filePath: filePath,
@ -738,8 +756,8 @@ export default {
}, },
getNowUrl: function() { getNowUrl: function() {
const pages = getCurrentPages(), const pages = getCurrentPages(),
page = pages[pages.length - 1], page = pages[pages.length - 1],
query = this.serialize(page.options || {}); query = this.serialize(page.options || {});
return page.route + (query ? '?' + query : ''); return page.route + (query ? '?' + query : '');
}, },
/** /**
@ -982,9 +1000,9 @@ export default {
if (arr.length > 1) { if (arr.length > 1) {
//#ifdef MP //#ifdef MP
let pathArr = arr[1].split('?') let pathArr = arr[1].split('?')
if(pathArr.length > 1){} if (pathArr.length > 1) {}
uni.navigateToMiniProgram({ uni.navigateToMiniProgram({
appId: pathArr.length > 1 ? pathArr[0] : arr[arr.length-1], // 此为生活缴费appid appId: pathArr.length > 1 ? pathArr[0] : arr[arr.length - 1], // 此为生活缴费appid
path: arr[0], // 此为生活缴费首页路径 path: arr[0], // 此为生活缴费首页路径
envVersion: "release", envVersion: "release",
success: res => { success: res => {
@ -1004,7 +1022,8 @@ export default {
url: `/pages/annex/web_view/index?url=${url}` url: `/pages/annex/web_view/index?url=${url}`
}); });
} else { } else {
if (['/pages/goods_cate/goods_cate','/pages/plant_grass/index','/pages/order_addcart/order_addcart','/pages/user/index' if (['/pages/goods_cate/goods_cate', '/pages/plant_grass/index',
'/pages/order_addcart/order_addcart', '/pages/user/index'
] ]
.indexOf(url) == -1) { .indexOf(url) == -1) {
uni.navigateTo({ uni.navigateTo({
@ -1018,4 +1037,4 @@ export default {
} }
} }
}, },
} }