|
@@ -141,29 +141,29 @@ export default {
|
|
|
* @param url 跳转路径
|
|
|
* 选择跳转到其他小程序时,在h5也可以跳转路径
|
|
|
*/
|
|
|
- JumpPath: function(url){
|
|
|
+ JumpPath: function(url) {
|
|
|
let arr = url.split('@APPID=');
|
|
|
- if(arr.length>1){
|
|
|
+ if (arr.length > 1) {
|
|
|
|
|
|
uni.navigateToMiniProgram({
|
|
|
- appId:arr[arr.length-1],
|
|
|
- path:arr[0],
|
|
|
- envVersion:"release",
|
|
|
- success: res => {
|
|
|
- console.log("打开成功", res);
|
|
|
- },
|
|
|
- fail: err => {
|
|
|
- console.log('sgdhgf',err);
|
|
|
- }
|
|
|
+ appId: arr[arr.length - 1],
|
|
|
+ path: arr[0],
|
|
|
+ envVersion: "release",
|
|
|
+ success: res => {
|
|
|
+ console.log("打开成功", res);
|
|
|
+ },
|
|
|
+ fail: err => {
|
|
|
+ console.log('sgdhgf', err);
|
|
|
+ }
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
- this.Tips({
|
|
|
- title: 'h5与app端不支持跳转外部小程序'
|
|
|
- });
|
|
|
-
|
|
|
- }else{
|
|
|
- if(url == '/pages/short_video/appSwiper/index' || url == '/pages/short_video/nvueSwiper/index'){
|
|
|
+
|
|
|
+
|
|
|
+ this.Tips({
|
|
|
+ title: 'h5与app端不支持跳转外部小程序'
|
|
|
+ });
|
|
|
+
|
|
|
+ } else {
|
|
|
+ if (url == '/pages/short_video/appSwiper/index' || url == '/pages/short_video/nvueSwiper/index') {
|
|
|
|
|
|
url = '/pages/short_video/appSwiper/index'
|
|
|
|
|
@@ -176,7 +176,9 @@ export default {
|
|
|
url: `/pages/annex/web_view/index?url=${url}`
|
|
|
});
|
|
|
} else {
|
|
|
- if (['/pages/goods_cate/goods_cate', '/pages/order_addcart/order_addcart', '/pages/user/index', '/pages/index/index','/pages/store_cate/store_cate']
|
|
|
+ if (['/pages/goods_cate/goods_cate', '/pages/order_addcart/order_addcart', '/pages/user/index',
|
|
|
+ '/pages/index/index', '/pages/store_cate/store_cate'
|
|
|
+ ]
|
|
|
.indexOf(url.split('?')[0]) == -1) {
|
|
|
uni.navigateTo({
|
|
|
url: url
|
|
@@ -186,7 +188,7 @@ export default {
|
|
|
url: url
|
|
|
})
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -281,7 +283,7 @@ export default {
|
|
|
ctx.setFontSize(33)
|
|
|
ctx.setFillStyle('#fff');
|
|
|
ctx.setTextAlign('center');
|
|
|
- ctx.fillText(posterTitle, WIDTH/2, 65);
|
|
|
+ ctx.fillText(posterTitle, WIDTH / 2, 65);
|
|
|
ctx.save();
|
|
|
ctx.drawImage(arr2[1], 32, 141, 685, 685);
|
|
|
ctx.save();
|
|
@@ -356,7 +358,7 @@ export default {
|
|
|
ctx.setFillStyle('#999');
|
|
|
|
|
|
ctx.setTextAlign('center');
|
|
|
- ctx.fillText('长按识别图中的二维码查看商品详情', WIDTH/2, 1272);
|
|
|
+ ctx.fillText('长按识别图中的二维码查看商品详情', WIDTH / 2, 1272);
|
|
|
ctx.save();
|
|
|
let r = 93;
|
|
|
let d = r * 2;
|
|
@@ -550,25 +552,25 @@ export default {
|
|
|
ctx.setFontSize(10);
|
|
|
}
|
|
|
const CONTENT_ROW_LENGTH = 30;
|
|
|
- const store_name = '邀请您加入'+sitename;
|
|
|
+ const store_name = '邀请您加入' + sitename;
|
|
|
let [contentLeng, contentArray, contentRows] = that.textByteLength(store_name,
|
|
|
- CONTENT_ROW_LENGTH);
|
|
|
- if (contentRows > 2) {
|
|
|
- contentRows = 2;
|
|
|
- let textArray = contentArray.slice(0, 2);
|
|
|
- textArray[textArray.length - 1] += '...';
|
|
|
- contentArray = textArray;
|
|
|
- }
|
|
|
- ctx.setTextAlign('left');
|
|
|
-
|
|
|
- ctx.setFillStyle('#000');
|
|
|
- let contentHh = 38;
|
|
|
- for (let m = 0; m < contentArray.length; m++) {
|
|
|
- if (m) {
|
|
|
- ctx.fillText(contentArray[m], w * markx, h * marky+14);
|
|
|
- } else {
|
|
|
- ctx.fillText(contentArray[m], w * markx, h * marky);
|
|
|
- }
|
|
|
+ CONTENT_ROW_LENGTH);
|
|
|
+ if (contentRows > 2) {
|
|
|
+ contentRows = 2;
|
|
|
+ let textArray = contentArray.slice(0, 2);
|
|
|
+ textArray[textArray.length - 1] += '...';
|
|
|
+ contentArray = textArray;
|
|
|
+ }
|
|
|
+ ctx.setTextAlign('left');
|
|
|
+
|
|
|
+ ctx.setFillStyle('#000');
|
|
|
+ let contentHh = 38;
|
|
|
+ for (let m = 0; m < contentArray.length; m++) {
|
|
|
+ if (m) {
|
|
|
+ ctx.fillText(contentArray[m], w * markx, h * marky + 14);
|
|
|
+ } else {
|
|
|
+ ctx.fillText(contentArray[m], w * markx, h * marky);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
ctx.save();
|
|
@@ -630,72 +632,97 @@ export default {
|
|
|
*/
|
|
|
uploadImageOne: function(opt, successCallback, errorCallback) {
|
|
|
let that = this;
|
|
|
- if (typeof opt === 'string') {
|
|
|
- let url = opt;
|
|
|
- opt = {};
|
|
|
- opt.url = url;
|
|
|
+
|
|
|
+ if (permision.isIOS) {
|
|
|
+ upimg()
|
|
|
+ } else {
|
|
|
+ let title = '申请相册权限';
|
|
|
+ let content = "是否允许访问相册用于上传图片?"
|
|
|
+ uni.showModal({
|
|
|
+ title,
|
|
|
+ content,
|
|
|
+ cancelText: '拒绝',
|
|
|
+ confirmText: '允许',
|
|
|
+ success: res => {
|
|
|
+ if (res.confirm) {
|
|
|
+ upimg()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
}
|
|
|
- let count = opt.count || 1,
|
|
|
- sizeType = opt.sizeType || ['compressed'],
|
|
|
- sourceType = opt.sourceType || ['album', 'camera'],
|
|
|
- is_load = opt.is_load || true,
|
|
|
- uploadUrl = opt.url || '',
|
|
|
- inputName = opt.name || 'pics',
|
|
|
- fileType = opt.fileType || 'image';
|
|
|
- uni.chooseImage({
|
|
|
- count: count,
|
|
|
- sizeType: sizeType,
|
|
|
- sourceType: sourceType,
|
|
|
- success: function(res) {
|
|
|
-
|
|
|
- uni.showLoading({
|
|
|
- title: '图片上传中',
|
|
|
- });
|
|
|
- uni.uploadFile({
|
|
|
- url: HTTP_REQUEST_URL + '/api/' + uploadUrl,
|
|
|
- filePath: res.tempFilePaths[0],
|
|
|
- fileType: fileType,
|
|
|
- name: inputName,
|
|
|
- formData: {
|
|
|
- 'filename': inputName
|
|
|
- },
|
|
|
- header: {
|
|
|
-
|
|
|
- "Content-Type": "multipart/form-data",
|
|
|
-
|
|
|
- [TOKENNAME]: 'Bearer ' + store.state.app.token
|
|
|
- },
|
|
|
- success: function(res) {
|
|
|
- uni.hideLoading();
|
|
|
- if (res.statusCode == 403) {
|
|
|
- that.Tips({
|
|
|
- title: res.data
|
|
|
- });
|
|
|
- } else if (res.statusCode == 413) {
|
|
|
- that.Tips({
|
|
|
- title: '上传图片失败,请重新上传小尺寸图片'
|
|
|
- });
|
|
|
- } else {
|
|
|
- let data = res.data ? JSON.parse(res.data) : {};
|
|
|
- if (data.status == 200) {
|
|
|
- successCallback && successCallback(data)
|
|
|
- } else {
|
|
|
- errorCallback && errorCallback(data);
|
|
|
+
|
|
|
+
|
|
|
+ upimg()
|
|
|
+
|
|
|
+ function upimg() {
|
|
|
+ if (typeof opt === 'string') {
|
|
|
+ let url = opt;
|
|
|
+ opt = {};
|
|
|
+ opt.url = url;
|
|
|
+ }
|
|
|
+ let count = opt.count || 1,
|
|
|
+ sizeType = opt.sizeType || ['compressed'],
|
|
|
+ sourceType = opt.sourceType || ['album', 'camera'],
|
|
|
+ is_load = opt.is_load || true,
|
|
|
+ uploadUrl = opt.url || '',
|
|
|
+ inputName = opt.name || 'pics',
|
|
|
+ fileType = opt.fileType || 'image';
|
|
|
+ uni.chooseImage({
|
|
|
+ count: count,
|
|
|
+ sizeType: sizeType,
|
|
|
+ sourceType: sourceType,
|
|
|
+ success: function(res) {
|
|
|
+
|
|
|
+ uni.showLoading({
|
|
|
+ title: '图片上传中',
|
|
|
+ });
|
|
|
+ uni.uploadFile({
|
|
|
+ url: HTTP_REQUEST_URL + '/api/' + uploadUrl,
|
|
|
+ filePath: res.tempFilePaths[0],
|
|
|
+ fileType: fileType,
|
|
|
+ name: inputName,
|
|
|
+ formData: {
|
|
|
+ 'filename': inputName
|
|
|
+ },
|
|
|
+ header: {
|
|
|
+
|
|
|
+ "Content-Type": "multipart/form-data",
|
|
|
+
|
|
|
+ [TOKENNAME]: 'Bearer ' + store.state.app.token
|
|
|
+ },
|
|
|
+ success: function(res) {
|
|
|
+ uni.hideLoading();
|
|
|
+ if (res.statusCode == 403) {
|
|
|
+ that.Tips({
|
|
|
+ title: res.data
|
|
|
+ });
|
|
|
+ } else if (res.statusCode == 413) {
|
|
|
that.Tips({
|
|
|
- title: data.msg
|
|
|
+ title: '上传图片失败,请重新上传小尺寸图片'
|
|
|
});
|
|
|
+ } else {
|
|
|
+ let data = res.data ? JSON.parse(res.data) : {};
|
|
|
+ if (data.status == 200) {
|
|
|
+ successCallback && successCallback(data)
|
|
|
+ } else {
|
|
|
+ errorCallback && errorCallback(data);
|
|
|
+ that.Tips({
|
|
|
+ title: data.msg
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
+ },
|
|
|
+ fail: function(res) {
|
|
|
+ uni.hideLoading();
|
|
|
+ that.Tips({
|
|
|
+ title: '上传图片失败'
|
|
|
+ });
|
|
|
}
|
|
|
- },
|
|
|
- fail: function(res) {
|
|
|
- uni.hideLoading();
|
|
|
- that.Tips({
|
|
|
- title: '上传图片失败'
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
* 单图上传压缩版
|
|
@@ -705,81 +732,115 @@ export default {
|
|
|
*/
|
|
|
uploadImageChange: function(opt, successCallback, errorCallback, sizeCallback) {
|
|
|
let that = this;
|
|
|
- if (typeof opt === 'string') {
|
|
|
- let url = opt;
|
|
|
- opt = {};
|
|
|
- opt.url = url;
|
|
|
+
|
|
|
+ if (permision.isIOS) {
|
|
|
+ upimg()
|
|
|
+ } else {
|
|
|
+ let title = '申请相册权限';
|
|
|
+ let content = "是否允许访问相册用于上传图片?"
|
|
|
+ uni.showModal({
|
|
|
+ title,
|
|
|
+ content,
|
|
|
+ cancelText: '拒绝',
|
|
|
+ confirmText: '允许',
|
|
|
+ success: res => {
|
|
|
+ if (res.confirm) {
|
|
|
+ upimg()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
}
|
|
|
- let count = opt.count || 1,
|
|
|
- sizeType = opt.sizeType || ['compressed'],
|
|
|
- sourceType = opt.sourceType || ['album', 'camera'],
|
|
|
- is_load = opt.is_load || true,
|
|
|
- uploadUrl = opt.url || '',
|
|
|
- inputName = opt.name || 'pics',
|
|
|
- fileType = opt.fileType || 'image';
|
|
|
- uni.chooseImage({
|
|
|
- count: count,
|
|
|
- sizeType: sizeType,
|
|
|
- sourceType: sourceType,
|
|
|
- success: function(res) {
|
|
|
-
|
|
|
- let imgSrc
|
|
|
- let objImg = res.tempFilePaths;
|
|
|
- objImg.forEach(item => {
|
|
|
- uni.getImageInfo({
|
|
|
- src: item,
|
|
|
- success(ress) {
|
|
|
- uni.showLoading({
|
|
|
- title: '图片上传中',
|
|
|
- });
|
|
|
- if (res.tempFiles[0].size <= 2097152) {
|
|
|
- uploadImg(ress.path)
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- let canvasWidth, canvasHeight, xs, maxWidth = 750
|
|
|
- xs = ress.width / ress.height
|
|
|
- if (ress.width > maxWidth) {
|
|
|
- canvasWidth = maxWidth
|
|
|
- canvasHeight = maxWidth / xs
|
|
|
- } else {
|
|
|
- canvasWidth = ress.width
|
|
|
- canvasHeight = ress.height
|
|
|
- }
|
|
|
- sizeCallback && sizeCallback({
|
|
|
- w: canvasWidth,
|
|
|
- h: canvasHeight
|
|
|
- })
|
|
|
- let canvas = uni.createCanvasContext('canvas');
|
|
|
- canvas.width = canvasWidth
|
|
|
- canvas.height = canvasHeight
|
|
|
- canvas.clearRect(0, 0, canvasWidth, canvasHeight);
|
|
|
- canvas.drawImage(ress.path, 0, 0, canvasWidth, canvasHeight)
|
|
|
- canvas.save();
|
|
|
-
|
|
|
- setTimeout(e => {
|
|
|
- canvas.draw(true, () => {
|
|
|
- uni.canvasToTempFilePath({
|
|
|
- canvasId: 'canvas',
|
|
|
- fileType: 'JPEG',
|
|
|
- destWidth: canvasWidth,
|
|
|
- destHeight: canvasHeight,
|
|
|
- quality: 0.7,
|
|
|
- success: function(
|
|
|
- canvasPath) {
|
|
|
- uploadImg(
|
|
|
- canvasPath
|
|
|
- .tempFilePath
|
|
|
- )
|
|
|
- }
|
|
|
- })
|
|
|
+
|
|
|
+
|
|
|
+ upimg()
|
|
|
+
|
|
|
+ function upimg() {
|
|
|
+ if (typeof opt === 'string') {
|
|
|
+ let url = opt;
|
|
|
+ opt = {};
|
|
|
+ opt.url = url;
|
|
|
+ }
|
|
|
+ let count = opt.count || 1,
|
|
|
+ sizeType = opt.sizeType || ['compressed'],
|
|
|
+ sourceType = opt.sourceType || ['album', 'camera'],
|
|
|
+ is_load = opt.is_load || true,
|
|
|
+ uploadUrl = opt.url || '',
|
|
|
+ inputName = opt.name || 'pics',
|
|
|
+ fileType = opt.fileType || 'image';
|
|
|
+ uni.chooseImage({
|
|
|
+ count: count,
|
|
|
+ sizeType: sizeType,
|
|
|
+ sourceType: sourceType,
|
|
|
+ success: function(res) {
|
|
|
+
|
|
|
+ let imgSrc
|
|
|
+ let objImg = res.tempFilePaths;
|
|
|
+ objImg.forEach(item => {
|
|
|
+ uni.getImageInfo({
|
|
|
+ src: item,
|
|
|
+ success(ress) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '图片上传中',
|
|
|
});
|
|
|
- }, 200)
|
|
|
- }
|
|
|
+ if (res.tempFiles[0].size <=
|
|
|
+ 2097152) {
|
|
|
+ uploadImg(ress.path)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ let canvasWidth, canvasHeight, xs,
|
|
|
+ maxWidth = 750
|
|
|
+ xs = ress.width / ress
|
|
|
+ .height
|
|
|
+ if (ress.width > maxWidth) {
|
|
|
+ canvasWidth =
|
|
|
+ maxWidth
|
|
|
+ canvasHeight = maxWidth / xs
|
|
|
+ } else {
|
|
|
+ canvasWidth = ress.width
|
|
|
+ canvasHeight = ress.height
|
|
|
+ }
|
|
|
+ sizeCallback && sizeCallback({
|
|
|
+ w: canvasWidth,
|
|
|
+ h: canvasHeight
|
|
|
+ })
|
|
|
+ let canvas = uni
|
|
|
+ .createCanvasContext('canvas');
|
|
|
+ canvas.width = canvasWidth
|
|
|
+ canvas.height = canvasHeight
|
|
|
+ canvas.clearRect(0, 0, canvasWidth,
|
|
|
+ canvasHeight);
|
|
|
+ canvas.drawImage(ress.path, 0, 0,
|
|
|
+ canvasWidth, canvasHeight)
|
|
|
+ canvas.save();
|
|
|
+
|
|
|
+ setTimeout(e => {
|
|
|
+ canvas.draw(true,
|
|
|
+ () => {
|
|
|
+ uni.canvasToTempFilePath({
|
|
|
+ canvasId: 'canvas',
|
|
|
+ fileType: 'JPEG',
|
|
|
+ destWidth: canvasWidth,
|
|
|
+ destHeight: canvasHeight,
|
|
|
+ quality: 0.7,
|
|
|
+ success: function(
|
|
|
+ canvasPath
|
|
|
+ ) {
|
|
|
+ uploadImg
|
|
|
+ (
|
|
|
+ canvasPath
|
|
|
+ .tempFilePath
|
|
|
+ )
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }, 200)
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
function uploadImg(filePath) {
|
|
|
uni.uploadFile({
|
|
@@ -846,16 +907,16 @@ export default {
|
|
|
'&openid=' + userInfo.openid;
|
|
|
let urls = encodeURIComponent(href.indexOf('?') === -1 ? hrefO : hrefT);
|
|
|
if (data.customer_url.indexOf('work.weixin.qq.com') > 0) {
|
|
|
-
|
|
|
+
|
|
|
wx.openCustomerServiceChat({
|
|
|
extInfo: {
|
|
|
url: data.customer_url
|
|
|
},
|
|
|
corpId: data.wechat_work_corpid,
|
|
|
- showMessageCard: show?true:false,
|
|
|
- sendMessageTitle: show?storeInfo.store_name:'',
|
|
|
- sendMessagePath: show?storeInfo.path:'',
|
|
|
- sendMessageImg: show?storeInfo.image:'',
|
|
|
+ showMessageCard: show ? true : false,
|
|
|
+ sendMessageTitle: show ? storeInfo.store_name : '',
|
|
|
+ sendMessagePath: show ? storeInfo.path : '',
|
|
|
+ sendMessageImg: show ? storeInfo.image : '',
|
|
|
success(res) {},
|
|
|
fail(err) {
|
|
|
self.Tips({
|
|
@@ -863,13 +924,13 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
- return window.location.href = data.customer_url
|
|
|
-
|
|
|
-
|
|
|
- plus.runtime.openURL(data.customer_url)
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ return window.location.href = data.customer_url
|
|
|
+
|
|
|
+
|
|
|
+ plus.runtime.openURL(data.customer_url)
|
|
|
+
|
|
|
} else {
|
|
|
uni.navigateTo({
|
|
|
url: `/pages/annex/web_view/index?url=${urls}`
|
|
@@ -886,7 +947,7 @@ export default {
|
|
|
});
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
|
|
|
* 小程序头像获取上传
|
|
|
* @param uploadUrl 上传接口地址
|
|
@@ -896,49 +957,59 @@ export default {
|
|
|
*/
|
|
|
uploadImgs(uploadUrl, filePath, successCallback, errorCallback) {
|
|
|
let that = this;
|
|
|
- uni.uploadFile({
|
|
|
- url: HTTP_REQUEST_URL + '/api/' + uploadUrl,
|
|
|
- filePath: filePath,
|
|
|
- fileType: 'image',
|
|
|
- name: 'pics',
|
|
|
- formData: {
|
|
|
- 'filename': 'pics'
|
|
|
- },
|
|
|
- header: {
|
|
|
-
|
|
|
- "Content-Type": "multipart/form-data",
|
|
|
-
|
|
|
- [TOKENNAME]: 'Bearer ' + store.state.app.token
|
|
|
- },
|
|
|
- success: (res) => {
|
|
|
- uni.hideLoading();
|
|
|
- if (res.statusCode == 403) {
|
|
|
- that.Tips({
|
|
|
- title: res.data
|
|
|
- });
|
|
|
- } else if (res.statusCode == 413) {
|
|
|
- that.Tips({
|
|
|
- title: '上传图片失败,请重新上传小尺寸图片'
|
|
|
- });
|
|
|
- } else {
|
|
|
- let data = res.data ? JSON.parse(res.data) : {};
|
|
|
- if (data.status == 200) {
|
|
|
- successCallback && successCallback(data)
|
|
|
- } else {
|
|
|
- errorCallback && errorCallback(data);
|
|
|
- that.Tips({
|
|
|
- title: data.msg
|
|
|
- });
|
|
|
- }
|
|
|
+ uni.showModal({
|
|
|
+ title,
|
|
|
+ content,
|
|
|
+ cancelText: '拒绝',
|
|
|
+ confirmText: '允许',
|
|
|
+ success: res => {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.uploadFile({
|
|
|
+ url: HTTP_REQUEST_URL + '/api/' + uploadUrl,
|
|
|
+ filePath: filePath,
|
|
|
+ fileType: 'image',
|
|
|
+ name: 'pics',
|
|
|
+ formData: {
|
|
|
+ 'filename': 'pics'
|
|
|
+ },
|
|
|
+ header: {
|
|
|
+
|
|
|
+ "Content-Type": "multipart/form-data",
|
|
|
+
|
|
|
+ [TOKENNAME]: 'Bearer ' + store.state.app.token
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ if (res.statusCode == 403) {
|
|
|
+ that.Tips({
|
|
|
+ title: res.data
|
|
|
+ });
|
|
|
+ } else if (res.statusCode == 413) {
|
|
|
+ that.Tips({
|
|
|
+ title: '上传图片失败,请重新上传小尺寸图片'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ let data = res.data ? JSON.parse(res.data) : {};
|
|
|
+ if (data.status == 200) {
|
|
|
+ successCallback && successCallback(data)
|
|
|
+ } else {
|
|
|
+ errorCallback && errorCallback(data);
|
|
|
+ that.Tips({
|
|
|
+ title: data.msg
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ that.Tips({
|
|
|
+ title: '上传图片失败'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
- fail: (err) => {
|
|
|
- uni.hideLoading();
|
|
|
- that.Tips({
|
|
|
- title: '上传图片失败'
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
* 小程序比较版本信息
|
|
@@ -1206,4 +1277,4 @@ export default {
|
|
|
},
|
|
|
}
|
|
|
|
|
|
-}
|
|
|
+}
|