diff --git a/pages/activity/lifeService/index.vue b/pages/activity/lifeService/index.vue
index ec938a5..4b9fe9a 100644
--- a/pages/activity/lifeService/index.vue
+++ b/pages/activity/lifeService/index.vue
@@ -6,10 +6,11 @@
-
+
-
+
{{recommend_address}}
@@ -19,7 +20,8 @@
-
+
{{item.title}}
@@ -30,7 +32,7 @@
-
+
@@ -47,7 +49,8 @@
{{item.care_count<10000 ? item.care_count : (item.care_count/10000).toFixed(2)+'万'}}人关注
-
+
{{item.distance}}
@@ -58,8 +61,9 @@
-
+
¥{{itemn.price}}
@@ -186,7 +190,7 @@
}
}
});
-
+
},
computed: {
downMenus: function() {
@@ -203,7 +207,7 @@
onLoad: function(options) {
this.mer_id = options.mer_id;
},
- methods: {
+ methods: {
// 打开地图
showMaoLocation(lat, long) {
// console.log(lat, long)
@@ -215,11 +219,11 @@
this.$wechat.seeLocation({
latitude: Number(lat),
longitude: Number(long)
- }).then(res=>{
+ }).then(res => {
// console.log('success');
})
- }else{
- //#endif
+ } else {
+ //#endif
uni.openLocation({
latitude: parseFloat(lat),
longitude: parseFloat(long),
@@ -228,7 +232,7 @@
// console.log(res)
},
});
- // #ifdef H5
+ // #ifdef H5
}
//#endif
},
@@ -243,28 +247,29 @@
latitude: Number(item.lat),
longitude: Number(item.long),
name: item.mer_name,
- address: item.mer_address ? item.mer_address: '',
- }).then(res=>{
+ address: item.mer_address ? item.mer_address : '',
+ }).then(res => {
// console.log('success');
})
- }else{
- //#endif
+ } else {
+ //#endif
uni.openLocation({
latitude: parseFloat(item.lat),
longitude: parseFloat(item.long),
scale: 8,
name: item.mer_name,
- address: item.mer_address ? item.mer_address: '',
+ address: item.mer_address ? item.mer_address : '',
success: function(res) {
// console.log(res)
},
});
- // #ifdef H5
+ // #ifdef H5
}
//#endif
},
selfLocation() {
let self = this
+ if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({
type: 'gcj02',
success: (res) => {
@@ -279,8 +284,9 @@
}).then(res => {
// console.log(res)
this.detaile_address = res.data.address;
- this.recommend_address = res.data.address.length > 4 ? res.data.address.slice(0,4) + '...' : res.data.address
- uni.setStorageSync('adress_location',res.data.address)
+ this.recommend_address = res.data.address.length > 4 ? res.data.address
+ .slice(0, 4) + '...' : res.data.address
+ uni.setStorageSync('adress_location', res.data.address)
})
},
fail: (res) => {
@@ -379,6 +385,7 @@
display: flex;
flex-wrap: nowrap;
background: var(--view-theme);
+
.search-right {
display: flex;
align-items: center;
@@ -387,6 +394,7 @@
flex: 1;
padding-left: 20rpx;
}
+
.right-text {
overflow: hidden;
text-overflow: ellipsis;
@@ -397,12 +405,14 @@
color: #fff;
padding: 0 10rpx;
}
+
.icon-xiangyou,
.icon-dingwei {
font-size: 30rpx;
color: #fff;
}
}
+
.productList .search .back {
display: flex;
align-items: center;
@@ -414,6 +424,7 @@
font-size: 36rpx;
}
}
+
.productList .search .input {
flex: 1;
// width: 540rpx;
@@ -423,19 +434,23 @@
padding: 0 20rpx;
box-sizing: border-box;
}
+
.productList .search .input input {
flex: 1;
height: 100%;
font-size: 26rpx;
margin-left: 10rpx;
}
+
.productList .search .input .placeholder {
color: #999;
}
+
.productList .search .input .iconfont {
font-size: 35rpx;
color: #555;
}
+
.productList .search .icon-pailie,
.productList .search .icon-tupianpailie {
color: #fff;
@@ -444,6 +459,7 @@
height: 86rpx;
line-height: 86rpx;
}
+
.productList .nav-wrapper {
z-index: 9;
position: fixed;
@@ -452,9 +468,11 @@
width: 100%;
margin-top: 86rpx;
background-color: $theme-color;
+
.tab-bar {
display: flex;
align-items: center;
+
.tab-item {
position: relative;
flex: 1;
@@ -465,6 +483,7 @@
color: #fff;
font-size: 28rpx;
font-weight: bold;
+
&::after {
content: ' ';
position: absolute;
@@ -475,6 +494,7 @@
background: transparent;
transform: translateX(-50%);
}
+
&.on {
&::after {
background: #fff;
@@ -483,6 +503,7 @@
}
}
}
+
.productList .nav {
height: 86rpx;
color: #454545;
@@ -492,6 +513,7 @@
justify-content: space-between;
padding: 0 28rpx;
}
+
.productList .nav .item {
display: flex;
align-items: center;
@@ -500,10 +522,12 @@
color: #FFFFFF;
flex: 1;
}
+
.productList .nav .item.font-colors {
font-weight: 500;
color: #FFFFFF;
}
+
.productList .nav .item .font-line {
height: 4rpx;
background-color: #fff;
@@ -517,26 +541,32 @@
-o-animation: line 0.3s;
/* Opera */
}
+
@keyframes line {
from {
width: 0rpx;
}
+
to {
width: 28rpx;
}
}
+
.productList .nav .item image {
width: 15rpx;
height: 19rpx;
margin-left: 10rpx;
}
+
.mer-box {
padding: 20rpx 20rpx;
margin-top: 168rpx;
+
.mer-item {
margin-bottom: 20rpx;
background-color: #fff;
border-radius: 16rpx;
+
.mer-hd {
position: relative;
width: 100%;
@@ -544,10 +574,12 @@
border-radius: 16rpx 16rpx 0 0;
overflow: hidden;
display: flex;
+
image {
width: 100%;
height: 100%;
}
+
.mer-name {
position: absolute;
left: 20rpx;
@@ -555,6 +587,7 @@
display: flex;
align-items: center;
padding: 0 10rpx;
+
image {
width: 79rpx;
height: 79rpx;
@@ -562,6 +595,7 @@
border-radius: 50%;
margin-right: 10rpx;
}
+
.mer-top {
display: flex;
align-items: center;
@@ -569,6 +603,7 @@
font-size: 28rpx;
font-weight: bold;
margin-bottom: 6rpx;
+
.font-bg-red {
margin-left: 20rpx;
font-size: 18rpx;
@@ -579,60 +614,72 @@
width: auto;
}
}
+
.mer-btn {
color: rgba($color: #fff, $alpha: 0.7);
font-size: 24rpx;
display: flex;
align-items: center;
+
.line {
width: 2rpx;
height: 18rpx;
color: rgba($color: #fff, $alpha: 0.7);
margin: 0 12rpx;
}
+
.distance {
display: flex;
align-items: center;
font-size: 24rpx;
color: rgba($color: #fff, $alpha: 0.7);
+
.iconfont {
font-size: 24rpx;
line-height: 24rpx;
}
}
}
+
.txt {
flex: 1;
}
}
}
+
.pro-box {
display: flex;
align-items: center;
padding: 20rpx 20rpx 30rpx;
+
.pro-item {
width: 218rpx;
margin-right: 14rpx;
+
image {
width: 100%;
height: 214rpx;
border-radius: 8rpx;
}
+
.price {
margin-top: 5rpx;
font-size: 28rpx;
color: var(--view-priceColor);
font-weight: bold;
+
text {
font-size: 28rpx;
}
}
+
&:last-child {
margin-right: 0;
}
}
}
}
+
.more-shop {
display: flex;
align-items: center;
@@ -653,6 +700,7 @@
background-color: #fff;
padding-bottom: calc(100% - 40rpx);
padding-top: 200rpx;
+
.pictrue {
display: flex;
flex-direction: column;
@@ -665,4 +713,4 @@
}
}
}
-
+
\ No newline at end of file
diff --git a/pages/annex/vip_grade/index.vue b/pages/annex/vip_grade/index.vue
index ba5a72f..e3ad374 100644
--- a/pages/annex/vip_grade/index.vue
+++ b/pages/annex/vip_grade/index.vue
@@ -24,7 +24,8 @@
积分
- {{ info.level_info.discount ? parseFloat(info.level_info.discount)/10 : '0'}}
+ {{ info.level_info.discount ? parseFloat(info.level_info.discount)/10 : '0'}}
+
折扣
@@ -32,11 +33,11 @@
-
+
@@ -45,7 +46,8 @@
附近门店
- 距 {{storeList[0].name}} {{storeList[0].range}}km
+ 距 {{storeList[0].name}} {{storeList[0].range}}km
@@ -54,7 +56,7 @@
import home from '@/components/home/index.vue'
import {
- getlevelInfo,
+ getlevelInfo,
getRandCode
} from '@/api/user.js';
import {
@@ -66,25 +68,25 @@
},
data() {
return {
- info:{},
+ info: {},
codeList: [{
- name: '付款码'
+ name: '付款码'
}, {
- name: '核销码'
+ name: '核销码'
}],
- codeIndex:0,
+ codeIndex: 0,
config: {
- qrc: {
- code: '',
- size: 380, // 二维码大小
- level: 3, //等级 0~4
- bgColor: '#FFFFFF', //二维码背景色 默认白色
- border: {
- color: ['#eee', '#eee'], //边框颜色支持渐变色
- lineWidth: 1, //边框宽度
- },
- color: ['#333', '#333'], //边框颜色支持渐变色
- }
+ qrc: {
+ code: '',
+ size: 380, // 二维码大小
+ level: 3, //等级 0~4
+ bgColor: '#FFFFFF', //二维码背景色 默认白色
+ border: {
+ color: ['#eee', '#eee'], //边框颜色支持渐变色
+ lineWidth: 1, //边框宽度
+ },
+ color: ['#333', '#333'], //边框颜色支持渐变色
+ }
},
user_latitude: 0,
user_longitude: 0,
@@ -111,7 +113,7 @@
}
},
methods: {
- goMap(){
+ goMap() {
uni.navigateTo({
url: '/pages/store/map/index'
})
@@ -129,6 +131,7 @@
})
} else {
// #endif
+ if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({
type: 'wgs84',
success: (res) => {
@@ -167,90 +170,96 @@
});
},
getCode() {
- getRandCode().then(res => {
- let code = res.data.code;
- this.config.qrc.code = code;
- }).catch(err => {
- return this.$util.Tips(err);
- })
+ getRandCode().then(res => {
+ let code = res.data.code;
+ this.config.qrc.code = code;
+ }).catch(err => {
+ return this.$util.Tips(err);
+ })
},
- levelInfo(){
- getlevelInfo().then(res=>{
+ levelInfo() {
+ getlevelInfo().then(res => {
this.info = res.data;
- }).catch(err=>{
+ }).catch(err => {
return this.$util.Tips({
title: err
});
})
},
tapCode(index) {
- this.codeIndex = index;
- if (index == 0) {
- this.getCode();
- } else {
- let code = this.info.user.bar_code;
- this.config.qrc.code = code;
- }
- },
- hello(res) {
+ this.codeIndex = index;
+ if (index == 0) {
+ this.getCode();
+ } else {
+ let code = this.info.user.bar_code;
+ this.config.qrc.code = code;
+ }
},
+ hello(res) {},
},
- onReachBottom() {
- }
+ onReachBottom() {}
}
+
\ No newline at end of file
diff --git a/pages/users/user_address/index.vue b/pages/users/user_address/index.vue
index 4f48e4b..3d53805 100644
--- a/pages/users/user_address/index.vue
+++ b/pages/users/user_address/index.vue
@@ -163,7 +163,7 @@
},
OnChangevAddress(address) {
this.villageInfo = address;
- console.log(this.villageInfo)
+ console.log(this.villageInfo)
},
// 地址数据
getCityList: function() {
@@ -204,7 +204,9 @@
if (!this.address_id) return false;
let that = this;
getAddressDetail(this.address_id).then(res => {
- let region = [res.data.province, res.data.city, res.data.district, res.data.street, res.data.village];
+ let region = [res.data.province, res.data.city, res.data.district, res.data.street, res
+ .data.village
+ ];
that.$set(that, 'userAddress', res.data);
that.$set(that, 'region', region);
that.city_id = res.data.city_id
@@ -280,6 +282,7 @@
title: '定位中',
mask: true,
});
+ if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({
type: 'gcj02',
success: (res) => {
@@ -356,8 +359,8 @@
value.address_id = that.address_id;
value.is_default = that.userAddress.is_default ? 1 : 0;
value.area = that.addressInfo;
- value.brigade=that.villageInfo[0]
-
+ value.brigade = that.villageInfo[0]
+
uni.showLoading({
title: '保存中',
mask: true
diff --git a/utils/http.js b/utils/http.js
index 71b29da..da904bb 100644
--- a/utils/http.js
+++ b/utils/http.js
@@ -1,89 +1,94 @@
import {
- HTTP_REQUEST_URL,
- HTTP_REQUEST_URL_TWO,
- HTTP_REQUEST_URL_THREE,
- HEADER,
- TOKENNAME,
+ HTTP_REQUEST_URL,
+ HTTP_REQUEST_URL_TWO,
+ HTTP_REQUEST_URL_THREE,
+ HEADER,
+ TOKENNAME,
} from '@/config/app';
import {
- checkLogin
+ checkLogin
} from '../libs/login';
-import { Toast } from '../libs/uniApi';
+import {
+ Toast
+} from '../libs/uniApi';
import store from '../store';
function toLogin() {
- store.commit("LOGOUT");
- uni.showToast({
- title: '请登录',
- icon: 'none',
- duration: 1000
- });
+ store.commit("LOGOUT");
+ uni.showToast({
+ title: '请登录',
+ icon: 'none',
+ duration: 1000
+ });
}
function baseRequestTwo(url, method, data, {
- noAuth = false,
- noVerify = false
+ noAuth = false,
+ noVerify = false
}) {
- let Url = HTTP_REQUEST_URL_TWO,
- header = HEADER;
+ let Url = HTTP_REQUEST_URL_TWO,
+ header = HEADER;
- if (!noAuth) {
- //登录过期自动登录
- if (!store.state.app.token && !checkLogin()) {
- toLogin();
- return Promise.reject({
- msg: '未登录'
- });
- }
- }
+ if (!noAuth) {
+ //登录过期自动登录
+ if (!store.state.app.token && !checkLogin()) {
+ toLogin();
+ return Promise.reject({
+ msg: '未登录'
+ });
+ }
+ }
- if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token;
+ if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token;
- return new Promise((reslove, reject) => {
- uni.request({
- url: Url + '/api' + url,
- method: method || 'GET',
- header: header,
- data: data || {},
- success: (res) => {
- // #ifdef APP-PLUS
- // console.log('app', Url + '/api/' + url, res.data);
- // #endif
- if (noVerify)
- // reslove(res.data, res);
- reslove(res.data);
- else if (res.data.status == 200)
- reslove(res.data, res);
- else if (res.data.code == 1) {
- reslove(res.data);
- } else if (res.data.code == 0) {
- reslove(res.data, res);
- } else if ([410000, 410001, 410002, 40000].indexOf(res.data.status) !== -1) {
- toLogin();
- reject(res.data);
- } else if (res.data.status == 501) {
- uni.reLaunch({
- url: '/pages/error/index'
- })
- reject(res.data);
- } else if (res.statusCode === 500)
- Toast("请检查网络")
- else
- reject(res.data.message || '请检查网络');
+ return new Promise((reslove, reject) => {
+ uni.request({
+ url: Url + '/api' + url,
+ method: method || 'GET',
+ header: header,
+ data: data || {},
+ success: (res) => {
+ // #ifdef APP-PLUS
+ // console.log('app', Url + '/api/' + url, res.data);
+ // #endif
+ if (noVerify)
+ // reslove(res.data, res);
+ reslove(res.data);
+ else if (res.data.status == 200)
+ reslove(res.data, res);
+ else if (res.data.code == 1) {
+ reslove(res.data);
+ } else if (res.data.code == 0) {
+ reslove(res.data, res);
+ } else if ([410000, 410001, 410002, 40000].indexOf(res.data.status) !== -1) {
+ toLogin();
+ reject(res.data);
+ } else if (res.data.status == 501) {
+ uni.reLaunch({
+ url: '/pages/error/index'
+ })
+ reject(res.data);
+ } else if (res.statusCode === 500)
+ Toast("请检查网络")
+ else
+ reject(res.data.message || '请检查网络');
- },
- fail: (message) => {
- // console.log('message', message);
- reject('请求失败');
- }
- })
- });
+ },
+ fail: (message) => {
+ // console.log('message', message);
+ reject('请求失败');
+ }
+ })
+
+
+
+ });
}
const http = {};
['options', 'get', 'post', 'put', 'head', 'delete', 'trace', 'connect'].forEach((method) => {
- http[method] = (api, data, opt) => baseRequestTwo(api, method, data, opt || {})
+ http[method] = (api, data, opt) => baseRequestTwo(api, method, data, opt || {})
});
export default http;
\ No newline at end of file
diff --git a/utils/util.js b/utils/util.js
index 67f41ba..61ef316 100644
--- a/utils/util.js
+++ b/utils/util.js
@@ -182,7 +182,7 @@ export default {
arr.push(text.slice(str, text.length));
return [strLength, arr, rows] // [处理文字的总字节长度,每行显示内容的数组,行数]
},
-/**
+ /**
* 获取分享海报
* @param array arr2 海报素材
* @param string store_name 素材文字
@@ -199,7 +199,7 @@ export default {
* 只能获取合法域名下的图片信息,本地调试无法获取
*
*/
- uni.getImageInfo({
+ uni.getImageInfo({
src: arr2[0],
success: function(res) {
// console.log(res, 'getImageInfo')
@@ -217,7 +217,8 @@ export default {
ctx.drawImage(arr2[2], cx, cy, d, d);
ctx.restore();
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) {
contentRows = 2;
let textArray = contentArray.slice(0, 2);
@@ -277,36 +278,38 @@ export default {
* 只能获取合法域名下的图片信息,本地调试无法获取
*
*/
- uni.getImageInfo({
+ uni.getImageInfo({
src: arr2[0],
success: function(res) {
// console.log(res, 'getImageInfo')
const WIDTH = res.width;
const HEIGHT = res.height;
- ctx.drawImage(arr2[0], 0, 0, WIDTH, HEIGHT+50);
+ ctx.drawImage(arr2[0], 0, 0, WIDTH, HEIGHT + 50);
ctx.save();
let r = 90;
let d = r * 2;
let cx = 555;
let cy = 910;
let ux = 50;
- let uy = 50;
+ let uy = 50;
ctx.arc(cx + r, cy + r, r, 0, 2 * Math.PI);
ctx.drawImage(arr2[3], 30, 30, 50, 50);
ctx.save();
- ctx.drawImage(arr2[2], cx, cy-30, d-30, d-30);
+ ctx.drawImage(arr2[2], cx, cy - 30, d - 30, d - 30);
ctx.restore();
ctx.setTextAlign('left');
ctx.setFontSize(24);
ctx.setFillStyle('#282828');
ctx.fillText(site_name, r, 62);
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) {
contentRows = 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] = textArray[textArray.length - 1].slice(0,
+ textArray[textArray.length - 1].length - 1)
+ textArray[textArray.length - 1] += '…';
contentArray = textArray;
}
ctx.setFontSize(32);
@@ -320,18 +323,18 @@ export default {
ctx.setFontSize(26);
ctx.setFillStyle('#999999');
ctx.beginPath();
- const textWidth = ctx.measureText(ot_price+'¥').width + 16; //检查字体的宽度
+ const textWidth = ctx.measureText(ot_price + '¥').width + 16; //检查字体的宽度
//绘制数字中间的矩形
ctx.setFillStyle('#999999');
- ctx.rect(35, 1062,textWidth-10, 1);
+ ctx.rect(35, 1062, textWidth - 10, 1);
ctx.fill();
ctx.closePath();
ctx.fillText('¥' + ot_price, 35, 1030 + contentHh);
ctx.clip();
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.drawImage(arr2[1], 30, 108, WIDTH-60, WIDTH-20);
+ ctx.drawImage(arr2[1], 30, 108, WIDTH - 60, WIDTH - 20);
ctx.draw(true, function() {
uni.canvasToTempFilePath({
canvasId: 'myCanvas',
@@ -375,7 +378,7 @@ export default {
* 只能获取合法域名下的图片信息,本地调试无法获取
*
*/
- uni.getImageInfo({
+ uni.getImageInfo({
src: arr2[0],
success: function(res) {
const WIDTH = res.width;
@@ -387,25 +390,26 @@ export default {
let ux = 50;
let uy = 700;
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.save();
ctx.arc(cx + r, cy + r, r, 0, 2 * Math.PI);
ctx.drawImage(arr2[2], 530, 760, d, d);
that.handleBorderRect(ctx, ux, uy, r, r, 45);
ctx.clip();
- ctx.stockStyle ="#ffffff";
+ ctx.stockStyle = "#ffffff";
ctx.drawImage(arr2[3], ux, uy, r, r);
ctx.restore();
ctx.setTextAlign('left')
ctx.setFontSize(28);
ctx.setFillStyle('#282828');
- ctx.fillText(nickname, r+60, 760);
+ ctx.fillText(nickname, r + 60, 760);
ctx.setTextAlign('left')
ctx.setFontSize(28);
ctx.setFillStyle('#282828');
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) {
contentRows = 2;
let textArray = contentArray.slice(0, 2);
@@ -413,11 +417,11 @@ export default {
contentArray = textArray;
}
ctx.setTextAlign('left');
- ctx.font = 'bold 32px Arial';
+ ctx.font = 'bold 32px Arial';
let contentHh = 32 * 1.3;
for (let m = 0; m < contentArray.length; m++) {
ctx.fillText(contentArray[m], 55, 850 + contentHh * m);
- }
+ }
ctx.draw(true, function() {
uni.canvasToTempFilePath({
canvasId: 'myCanvas',
@@ -445,36 +449,36 @@ export default {
})
},
/**
- * 图片圆角设置
- * @param string x x轴位置
- * @param string y y轴位置
- * @param string w 图片宽
- * @param string y 图片高
- * @param string r 圆角值
- */
- handleBorderRect(ctx, x, y, w, h, r) {
- ctx.beginPath();
- // 左上角
- ctx.arc(x + r, y + r, r, Math.PI, 1.5 * Math.PI);
- ctx.moveTo(x + r, y);
- ctx.lineTo(x + w - r, y);
- ctx.lineTo(x + w, y + r);
- // 右上角
- 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 - r, y + h);
- // 右下角
- ctx.arc(x + w - r, y + h - r, r, 0, 0.5 * Math.PI);
- ctx.lineTo(x + r, y + h);
- ctx.lineTo(x, y + h - r);
- // 左下角
- ctx.arc(x + r, y + h - r, r, 0.5 * Math.PI, Math.PI);
- ctx.lineTo(x, y + r);
- ctx.lineTo(x + r, y);
-
- ctx.fill();
- ctx.closePath();
- },
+ * 图片圆角设置
+ * @param string x x轴位置
+ * @param string y y轴位置
+ * @param string w 图片宽
+ * @param string y 图片高
+ * @param string r 圆角值
+ */
+ handleBorderRect(ctx, x, y, w, h, r) {
+ ctx.beginPath();
+ // 左上角
+ ctx.arc(x + r, y + r, r, Math.PI, 1.5 * Math.PI);
+ ctx.moveTo(x + r, y);
+ ctx.lineTo(x + w - r, y);
+ ctx.lineTo(x + w, y + r);
+ // 右上角
+ 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 - r, y + h);
+ // 右下角
+ ctx.arc(x + w - r, y + h - r, r, 0, 0.5 * Math.PI);
+ ctx.lineTo(x + r, y + h);
+ ctx.lineTo(x, y + h - r);
+ // 左下角
+ ctx.arc(x + r, y + h - r, r, 0.5 * Math.PI, Math.PI);
+ ctx.lineTo(x, y + r);
+ ctx.lineTo(x + r, y);
+
+ ctx.fill();
+ ctx.closePath();
+ },
/**
* 用户信息分享海报
* @param array arr2 海报素材 1背景 0二维码
@@ -525,7 +529,7 @@ export default {
}
ctx.fillText(sitename, w * markx, h * marky);
ctx.save();
- ctx.draw(false,setTimeout(()=>{
+ ctx.draw(false, setTimeout(() => {
uni.canvasToTempFilePath({
canvasId: 'myCanvas' + index,
fileType: 'png',
@@ -537,10 +541,10 @@ export default {
fail: function(err) {
// console.log(err)
uni.hideLoading();
-
+
}
})
- },1000))
+ }, 1000))
},
fail: function(err) {
@@ -621,7 +625,7 @@ export default {
}
})
},
-/**
+ /**
* 小程序头像获取上传
* @param uploadUrl 上传接口地址
* @param filePath 上传文件路径
@@ -630,7 +634,7 @@ export default {
*/
uploadImgs(uploadUrl, filePath, successCallback, errorCallback) {
let that = this;
- let inputName = 'pics';
+ let inputName = 'pics';
uni.uploadFile({
url: HTTP_REQUEST_URL + '/api/' + uploadUrl + '/' + inputName,
filePath: filePath,
@@ -685,8 +689,8 @@ export default {
},
getNowUrl: function() {
const pages = getCurrentPages(),
- page = pages[pages.length - 1],
- query = this.serialize(page.options || {});
+ page = pages[pages.length - 1],
+ query = this.serialize(page.options || {});
return page.route + (query ? '?' + query : '');
},
/**
@@ -836,6 +840,7 @@ export default {
this.doGetLocation();
},
doGetLocation() {
+ if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({
success: (res) => {
uni.removeStorageSync('CACHE_LONGITUDE');
@@ -920,4 +925,4 @@ export default {
return status;
},
}
-}
+}
\ No newline at end of file