This commit is contained in:
zmj 2023-11-04 19:18:29 +08:00
parent e3850dd2f9
commit f752d2cc21
11 changed files with 369 additions and 257 deletions

View File

@ -6,10 +6,11 @@
<view class="iconfont icon-xiangzuo"></view> <view class="iconfont icon-xiangzuo"></view>
</view> </view>
<view class='input acea-row row-between-wrapper'><text class='iconfont icon-sousuo'></text> <view class='input acea-row row-between-wrapper'><text class='iconfont icon-sousuo'></text>
<input placeholder='搜索店铺名称' placeholder-class='placeholder' confirm-type='search' name="search" :value='sotreParam.keyword' <input placeholder='搜索店铺名称' placeholder-class='placeholder' confirm-type='search' name="search"
@confirm="searchSubmit"></input> :value='sotreParam.keyword' @confirm="searchSubmit"></input>
</view> </view>
<view v-if="mer_location == 1" style="text-align: right;" class='iconfont search-right' @click='showMaoLocation(latitude,longitude)'> <view v-if="mer_location == 1" style="text-align: right;" class='iconfont search-right'
@click='showMaoLocation(latitude,longitude)'>
<view class="iconfont icon-dingwei"></view> <view class="iconfont icon-dingwei"></view>
<view class="right-text" v-if="recommend_address"> <view class="right-text" v-if="recommend_address">
{{recommend_address}} {{recommend_address}}
@ -19,7 +20,8 @@
</view> </view>
<view class="nav-wrapper"> <view class="nav-wrapper">
<view class='nav acea-row row-middle'> <view class='nav acea-row row-middle'>
<view v-for="item in downMenus" :key="item.key" class='item' :class="{'font-colors':firstKey == item.key}" @click='set_where(item.key)'> <view v-for="item in downMenus" :key="item.key" class='item'
:class="{'font-colors':firstKey == item.key}" @click='set_where(item.key)'>
<view> <view>
{{item.title}} {{item.title}}
</view> </view>
@ -30,7 +32,7 @@
</view> </view>
<!-- 店铺 --> <!-- 店铺 -->
<block> <block>
<view class="mer-box"v-if="storeList.length > 0"> <view class="mer-box" v-if="storeList.length > 0">
<view class="mer-item" v-for="(item,index) in storeList" :key='index'> <view class="mer-item" v-for="(item,index) in storeList" :key='index'>
<view class="mer-hd" @click="goStore(item.mer_id)"> <view class="mer-hd" @click="goStore(item.mer_id)">
<image :src="item.mini_banner?item.mini_banner:item.mer_banner"></image> <image :src="item.mini_banner?item.mini_banner:item.mer_banner"></image>
@ -47,7 +49,8 @@
{{item.care_count<10000 ? item.care_count : (item.care_count/10000).toFixed(2)+''}}人关注 {{item.care_count<10000 ? item.care_count : (item.care_count/10000).toFixed(2)+''}}人关注
</view> </view>
<view class="line" v-if="item.distance"></view> <view class="line" v-if="item.distance"></view>
<view class="distance" v-if="item.distance" @click.stop="showStoreLocation(item)"> <view class="distance" v-if="item.distance"
@click.stop="showStoreLocation(item)">
<view class=""> <view class="">
{{item.distance}} {{item.distance}}
</view> </view>
@ -58,8 +61,9 @@
</view> </view>
</view> </view>
<view class="pro-box"> <view class="pro-box">
<navigator :url="`/pages/goods_details/index?id=${itemn.product_id}`" hover-class="none" class="pro-item" v-for="(itemn,indexn) in item.recommend" <navigator :url="`/pages/goods_details/index?id=${itemn.product_id}`" hover-class="none"
:key='indexn' v-if="item.recommend.length<=3"> class="pro-item" v-for="(itemn,indexn) in item.recommend" :key='indexn'
v-if="item.recommend.length<=3">
<image :src="itemn.image" mode=""></image> <image :src="itemn.image" mode=""></image>
<view class="price"> <view class="price">
<text></text>{{itemn.price}} <text></text>{{itemn.price}}
@ -215,11 +219,11 @@
this.$wechat.seeLocation({ this.$wechat.seeLocation({
latitude: Number(lat), latitude: Number(lat),
longitude: Number(long) longitude: Number(long)
}).then(res=>{ }).then(res => {
// console.log('success'); // console.log('success');
}) })
}else{ } else {
//#endif //#endif
uni.openLocation({ uni.openLocation({
latitude: parseFloat(lat), latitude: parseFloat(lat),
longitude: parseFloat(long), longitude: parseFloat(long),
@ -228,7 +232,7 @@
// console.log(res) // console.log(res)
}, },
}); });
// #ifdef H5 // #ifdef H5
} }
//#endif //#endif
}, },
@ -243,28 +247,29 @@
latitude: Number(item.lat), latitude: Number(item.lat),
longitude: Number(item.long), longitude: Number(item.long),
name: item.mer_name, name: item.mer_name,
address: item.mer_address ? item.mer_address: '', address: item.mer_address ? item.mer_address : '',
}).then(res=>{ }).then(res => {
// console.log('success'); // console.log('success');
}) })
}else{ } else {
//#endif //#endif
uni.openLocation({ uni.openLocation({
latitude: parseFloat(item.lat), latitude: parseFloat(item.lat),
longitude: parseFloat(item.long), longitude: parseFloat(item.long),
scale: 8, scale: 8,
name: item.mer_name, name: item.mer_name,
address: item.mer_address ? item.mer_address: '', address: item.mer_address ? item.mer_address : '',
success: function(res) { success: function(res) {
// console.log(res) // console.log(res)
}, },
}); });
// #ifdef H5 // #ifdef H5
} }
//#endif //#endif
}, },
selfLocation() { selfLocation() {
let self = this let self = this
if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'gcj02',
success: (res) => { success: (res) => {
@ -279,8 +284,9 @@
}).then(res => { }).then(res => {
// console.log(res) // console.log(res)
this.detaile_address = res.data.address; this.detaile_address = res.data.address;
this.recommend_address = res.data.address.length > 4 ? res.data.address.slice(0,4) + '...' : res.data.address this.recommend_address = res.data.address.length > 4 ? res.data.address
uni.setStorageSync('adress_location',res.data.address) .slice(0, 4) + '...' : res.data.address
uni.setStorageSync('adress_location', res.data.address)
}) })
}, },
fail: (res) => { fail: (res) => {
@ -379,6 +385,7 @@
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
background: var(--view-theme); background: var(--view-theme);
.search-right { .search-right {
display: flex; display: flex;
align-items: center; align-items: center;
@ -387,6 +394,7 @@
flex: 1; flex: 1;
padding-left: 20rpx; padding-left: 20rpx;
} }
.right-text { .right-text {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -397,12 +405,14 @@
color: #fff; color: #fff;
padding: 0 10rpx; padding: 0 10rpx;
} }
.icon-xiangyou, .icon-xiangyou,
.icon-dingwei { .icon-dingwei {
font-size: 30rpx; font-size: 30rpx;
color: #fff; color: #fff;
} }
} }
.productList .search .back { .productList .search .back {
display: flex; display: flex;
align-items: center; align-items: center;
@ -414,6 +424,7 @@
font-size: 36rpx; font-size: 36rpx;
} }
} }
.productList .search .input { .productList .search .input {
flex: 1; flex: 1;
// width: 540rpx; // width: 540rpx;
@ -423,19 +434,23 @@
padding: 0 20rpx; padding: 0 20rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.productList .search .input input { .productList .search .input input {
flex: 1; flex: 1;
height: 100%; height: 100%;
font-size: 26rpx; font-size: 26rpx;
margin-left: 10rpx; margin-left: 10rpx;
} }
.productList .search .input .placeholder { .productList .search .input .placeholder {
color: #999; color: #999;
} }
.productList .search .input .iconfont { .productList .search .input .iconfont {
font-size: 35rpx; font-size: 35rpx;
color: #555; color: #555;
} }
.productList .search .icon-pailie, .productList .search .icon-pailie,
.productList .search .icon-tupianpailie { .productList .search .icon-tupianpailie {
color: #fff; color: #fff;
@ -444,6 +459,7 @@
height: 86rpx; height: 86rpx;
line-height: 86rpx; line-height: 86rpx;
} }
.productList .nav-wrapper { .productList .nav-wrapper {
z-index: 9; z-index: 9;
position: fixed; position: fixed;
@ -452,9 +468,11 @@
width: 100%; width: 100%;
margin-top: 86rpx; margin-top: 86rpx;
background-color: $theme-color; background-color: $theme-color;
.tab-bar { .tab-bar {
display: flex; display: flex;
align-items: center; align-items: center;
.tab-item { .tab-item {
position: relative; position: relative;
flex: 1; flex: 1;
@ -465,6 +483,7 @@
color: #fff; color: #fff;
font-size: 28rpx; font-size: 28rpx;
font-weight: bold; font-weight: bold;
&::after { &::after {
content: ' '; content: ' ';
position: absolute; position: absolute;
@ -475,6 +494,7 @@
background: transparent; background: transparent;
transform: translateX(-50%); transform: translateX(-50%);
} }
&.on { &.on {
&::after { &::after {
background: #fff; background: #fff;
@ -483,6 +503,7 @@
} }
} }
} }
.productList .nav { .productList .nav {
height: 86rpx; height: 86rpx;
color: #454545; color: #454545;
@ -492,6 +513,7 @@
justify-content: space-between; justify-content: space-between;
padding: 0 28rpx; padding: 0 28rpx;
} }
.productList .nav .item { .productList .nav .item {
display: flex; display: flex;
align-items: center; align-items: center;
@ -500,10 +522,12 @@
color: #FFFFFF; color: #FFFFFF;
flex: 1; flex: 1;
} }
.productList .nav .item.font-colors { .productList .nav .item.font-colors {
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #FFFFFF;
} }
.productList .nav .item .font-line { .productList .nav .item .font-line {
height: 4rpx; height: 4rpx;
background-color: #fff; background-color: #fff;
@ -517,26 +541,32 @@
-o-animation: line 0.3s; -o-animation: line 0.3s;
/* Opera */ /* Opera */
} }
@keyframes line { @keyframes line {
from { from {
width: 0rpx; width: 0rpx;
} }
to { to {
width: 28rpx; width: 28rpx;
} }
} }
.productList .nav .item image { .productList .nav .item image {
width: 15rpx; width: 15rpx;
height: 19rpx; height: 19rpx;
margin-left: 10rpx; margin-left: 10rpx;
} }
.mer-box { .mer-box {
padding: 20rpx 20rpx; padding: 20rpx 20rpx;
margin-top: 168rpx; margin-top: 168rpx;
.mer-item { .mer-item {
margin-bottom: 20rpx; margin-bottom: 20rpx;
background-color: #fff; background-color: #fff;
border-radius: 16rpx; border-radius: 16rpx;
.mer-hd { .mer-hd {
position: relative; position: relative;
width: 100%; width: 100%;
@ -544,10 +574,12 @@
border-radius: 16rpx 16rpx 0 0; border-radius: 16rpx 16rpx 0 0;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.mer-name { .mer-name {
position: absolute; position: absolute;
left: 20rpx; left: 20rpx;
@ -555,6 +587,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 10rpx; padding: 0 10rpx;
image { image {
width: 79rpx; width: 79rpx;
height: 79rpx; height: 79rpx;
@ -562,6 +595,7 @@
border-radius: 50%; border-radius: 50%;
margin-right: 10rpx; margin-right: 10rpx;
} }
.mer-top { .mer-top {
display: flex; display: flex;
align-items: center; align-items: center;
@ -569,6 +603,7 @@
font-size: 28rpx; font-size: 28rpx;
font-weight: bold; font-weight: bold;
margin-bottom: 6rpx; margin-bottom: 6rpx;
.font-bg-red { .font-bg-red {
margin-left: 20rpx; margin-left: 20rpx;
font-size: 18rpx; font-size: 18rpx;
@ -579,60 +614,72 @@
width: auto; width: auto;
} }
} }
.mer-btn { .mer-btn {
color: rgba($color: #fff, $alpha: 0.7); color: rgba($color: #fff, $alpha: 0.7);
font-size: 24rpx; font-size: 24rpx;
display: flex; display: flex;
align-items: center; align-items: center;
.line { .line {
width: 2rpx; width: 2rpx;
height: 18rpx; height: 18rpx;
color: rgba($color: #fff, $alpha: 0.7); color: rgba($color: #fff, $alpha: 0.7);
margin: 0 12rpx; margin: 0 12rpx;
} }
.distance { .distance {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 24rpx; font-size: 24rpx;
color: rgba($color: #fff, $alpha: 0.7); color: rgba($color: #fff, $alpha: 0.7);
.iconfont { .iconfont {
font-size: 24rpx; font-size: 24rpx;
line-height: 24rpx; line-height: 24rpx;
} }
} }
} }
.txt { .txt {
flex: 1; flex: 1;
} }
} }
} }
.pro-box { .pro-box {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 20rpx 20rpx 30rpx; padding: 20rpx 20rpx 30rpx;
.pro-item { .pro-item {
width: 218rpx; width: 218rpx;
margin-right: 14rpx; margin-right: 14rpx;
image { image {
width: 100%; width: 100%;
height: 214rpx; height: 214rpx;
border-radius: 8rpx; border-radius: 8rpx;
} }
.price { .price {
margin-top: 5rpx; margin-top: 5rpx;
font-size: 28rpx; font-size: 28rpx;
color: var(--view-priceColor); color: var(--view-priceColor);
font-weight: bold; font-weight: bold;
text { text {
font-size: 28rpx; font-size: 28rpx;
} }
} }
&:last-child { &:last-child {
margin-right: 0; margin-right: 0;
} }
} }
} }
} }
.more-shop { .more-shop {
display: flex; display: flex;
align-items: center; align-items: center;
@ -653,6 +700,7 @@
background-color: #fff; background-color: #fff;
padding-bottom: calc(100% - 40rpx); padding-bottom: calc(100% - 40rpx);
padding-top: 200rpx; padding-top: 200rpx;
.pictrue { .pictrue {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -24,7 +24,8 @@
<view>积分</view> <view>积分</view>
</view> </view>
<view class="item"> <view class="item">
<view class="num">{{ info.level_info.discount ? parseFloat(info.level_info.discount)/10 : '0'}}</view> <view class="num">{{ info.level_info.discount ? parseFloat(info.level_info.discount)/10 : '0'}}
</view>
<view>折扣</view> <view>折扣</view>
</view> </view>
</view> </view>
@ -32,11 +33,11 @@
</view> </view>
<view class="qrCode"> <view class="qrCode">
<view class="header acea-row row-between-wrapper"> <view class="header acea-row row-between-wrapper">
<view class="title" :class="{'on': codeIndex == index,'onLeft':codeIndex == 1}" <view class="title" :class="{'on': codeIndex == index,'onLeft':codeIndex == 1}"
v-for="(item, index) in codeList" :key="index" @click="tapCode(index)">{{item.name}}</view> v-for="(item, index) in codeList" :key="index" @click="tapCode(index)">{{item.name}}</view>
</view> </view>
<view class="acea-row row-center-wrapper" style="margin-top: 35rpx;"> <view class="acea-row row-center-wrapper" style="margin-top: 35rpx;">
<w-qrcode :options="config.qrc" @generate="hello"></w-qrcode> <w-qrcode :options="config.qrc" @generate="hello"></w-qrcode>
</view> </view>
</view> </view>
<view class="store acea-row row-between-wrapper" v-if="storeList.length"> <view class="store acea-row row-between-wrapper" v-if="storeList.length">
@ -45,7 +46,8 @@
附近门店 附近门店
</view> </view>
<view class="acea-row" @click="goMap"> <view class="acea-row" @click="goMap">
<view class="storeName line1">{{storeList[0].name}}</view> {{storeList[0].range}}km<text class="iconfont icon-gengduo3"></text></view> <view class="storeName line1">{{storeList[0].name}}</view> {{storeList[0].range}}km<text
class="iconfont icon-gengduo3"></text></view>
</view> </view>
<home v-if="navigation"></home> <home v-if="navigation"></home>
</view> </view>
@ -54,7 +56,7 @@
import home from '@/components/home/index.vue' import home from '@/components/home/index.vue'
import { import {
getlevelInfo, getlevelInfo,
getRandCode getRandCode
} from '@/api/user.js'; } from '@/api/user.js';
import { import {
@ -66,25 +68,25 @@
}, },
data() { data() {
return { return {
info:{}, info: {},
codeList: [{ codeList: [{
name: '付款码' name: '付款码'
}, { }, {
name: '核销码' name: '核销码'
}], }],
codeIndex:0, codeIndex: 0,
config: { config: {
qrc: { qrc: {
code: '', code: '',
size: 380, // size: 380, //
level: 3, // 04 level: 3, // 04
bgColor: '#FFFFFF', // bgColor: '#FFFFFF', //
border: { border: {
color: ['#eee', '#eee'], // color: ['#eee', '#eee'], //
lineWidth: 1, // lineWidth: 1, //
}, },
color: ['#333', '#333'], // color: ['#333', '#333'], //
} }
}, },
user_latitude: 0, user_latitude: 0,
user_longitude: 0, user_longitude: 0,
@ -111,7 +113,7 @@
} }
}, },
methods: { methods: {
goMap(){ goMap() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/store/map/index' url: '/pages/store/map/index'
}) })
@ -129,6 +131,7 @@
}) })
} else { } else {
// #endif // #endif
if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'wgs84',
success: (res) => { success: (res) => {
@ -167,90 +170,96 @@
}); });
}, },
getCode() { getCode() {
getRandCode().then(res => { getRandCode().then(res => {
let code = res.data.code; let code = res.data.code;
this.config.qrc.code = code; this.config.qrc.code = code;
}).catch(err => { }).catch(err => {
return this.$util.Tips(err); return this.$util.Tips(err);
}) })
}, },
levelInfo(){ levelInfo() {
getlevelInfo().then(res=>{ getlevelInfo().then(res => {
this.info = res.data; this.info = res.data;
}).catch(err=>{ }).catch(err => {
return this.$util.Tips({ return this.$util.Tips({
title: err title: err
}); });
}) })
}, },
tapCode(index) { tapCode(index) {
this.codeIndex = index; this.codeIndex = index;
if (index == 0) { if (index == 0) {
this.getCode(); this.getCode();
} else { } else {
let code = this.info.user.bar_code; let code = this.info.user.bar_code;
this.config.qrc.code = code; this.config.qrc.code = code;
} }
},
hello(res) {
}, },
hello(res) {},
}, },
onReachBottom() { onReachBottom() {}
}
} }
</script> </script>
<style lang="scss"> <style lang="scss">
page{ page {
background: linear-gradient(121deg, #F5EBE1 0%, #FFDFBE 100%); background: linear-gradient(121deg, #F5EBE1 0%, #FFDFBE 100%);
} }
.vipGrade{
.headerBg{ .vipGrade {
.headerBg {
background: url('../static/big-bg.png') no-repeat; background: url('../static/big-bg.png') no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
width: 100%; width: 100%;
height: 476rpx; height: 476rpx;
padding-top: 1rpx; padding-top: 1rpx;
.header{
.header {
background: url('../static/grade-bg.png') no-repeat; background: url('../static/grade-bg.png') no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
width: 690rpx; width: 690rpx;
height: 286rpx; height: 286rpx;
margin: 26rpx auto; margin: 26rpx auto;
padding: 28rpx 28rpx 0 28rpx; padding: 28rpx 28rpx 0 28rpx;
.top{
.pictrue{ .top {
.pictrue {
width: 92rpx; width: 92rpx;
height: 92rpx; height: 92rpx;
border: 1px solid #FFFFFF; border: 1px solid #FFFFFF;
margin-right: 20rpx; margin-right: 20rpx;
border-radius: 50%; border-radius: 50%;
image{
image {
border-radius: 50%; border-radius: 50%;
width:100%; width: 100%;
height: 100%; height: 100%;
} }
} }
.text{
.text {
width: 400rpx; width: 400rpx;
.name{
.nameCon{ .name {
.nameCon {
color: #EDCAAC; color: #EDCAAC;
font-size: 28rpx; font-size: 28rpx;
max-width: 332rpx; max-width: 332rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
.num{
.num {
border-radius: 4px; border-radius: 4px;
border: 1px solid #EDCAAC; border: 1px solid #EDCAAC;
background: rgba(215,177,144,0.2); background: rgba(215, 177, 144, 0.2);
font-size: 20rpx; font-size: 20rpx;
font-weight: 400; font-weight: 400;
color: #EDCAAC; color: #EDCAAC;
padding: 0 4rpx; padding: 0 4rpx;
} }
} }
.idNum{
.idNum {
font-weight: 400; font-weight: 400;
color: #EDCAAC; color: #EDCAAC;
font-size: 24rpx; font-size: 24rpx;
@ -259,27 +268,32 @@
} }
} }
} }
.list{
.list {
margin-top: 46rpx; margin-top: 46rpx;
.item{
.item {
color: #EDCAAC; color: #EDCAAC;
font-size: 22rpx; font-size: 22rpx;
text-align: center; text-align: center;
.num{
.num {
font-size: 40rpx; font-size: 40rpx;
margin-bottom: 15rpx; margin-bottom: 15rpx;
} }
} }
} }
} }
.qrCode{
.qrCode {
width: 690rpx; width: 690rpx;
height: 700rpx; height: 700rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 18rpx; border-radius: 18rpx;
margin: -134rpx auto 0 auto; margin: -134rpx auto 0 auto;
padding-top: 60rpx; padding-top: 60rpx;
.header{
.header {
width: 330rpx; width: 330rpx;
height: 60rpx; height: 60rpx;
border-radius: 30rpx; border-radius: 30rpx;
@ -287,28 +301,30 @@
color: #333333; color: #333333;
font-size: 30rpx; font-size: 30rpx;
margin: 0 auto; margin: 0 auto;
.title { .title {
width: 146rpx; width: 146rpx;
height: 100%; height: 100%;
line-height: 60rpx; line-height: 60rpx;
border-radius: 30rpx; border-radius: 30rpx;
text-align: center; text-align: center;
padding-right: 20rpx; padding-right: 20rpx;
&.onLeft { &.onLeft {
padding-left: 34rpx; padding-left: 34rpx;
} }
&.on { &.on {
width: 170rpx; width: 170rpx;
background-color: #333 !important; background-color: #333 !important;
color: #fff; color: #fff;
padding: 0 !important; padding: 0 !important;
} }
} }
} }
} }
.store{
.store {
width: 690rpx; width: 690rpx;
height: 100rpx; height: 100rpx;
background: linear-gradient(90deg, #FFAE49 0%, #FCC887 100%); background: linear-gradient(90deg, #FFAE49 0%, #FCC887 100%);
@ -318,17 +334,20 @@
color: #fff; color: #fff;
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
.iconfont{
.iconfont {
margin-right: 20rpx; margin-right: 20rpx;
font-size: 38rpx; font-size: 38rpx;
} }
.icon-gengduo3{
.icon-gengduo3 {
font-size: 24rpx; font-size: 24rpx;
margin-left: 5rpx; margin-left: 5rpx;
margin-right: 0; margin-right: 0;
margin-top: 6rpx; margin-top: 6rpx;
} }
.storeName{
.storeName {
display: inline-block; display: inline-block;
max-width: 284rpx; max-width: 284rpx;
vertical-align: middle; vertical-align: middle;

View File

@ -6,9 +6,9 @@
<view class="iconfont icon-xiangzuo"></view> <view class="iconfont icon-xiangzuo"></view>
</view> </view>
<view class='input acea-row row-between-wrapper'> <view class='input acea-row row-between-wrapper'>
<text class='iconfont icon-sousuo'></text> <text class='iconfont icon-sousuo'></text>
<input placeholder='搜索商品名称' placeholder-class='placeholder' confirm-type='search' name="search" <input placeholder='搜索商品名称' placeholder-class='placeholder' confirm-type='search' name="search"
:value='where.keyword' @confirm="searchSubmit" @input="inputChange"> :value='where.keyword' @confirm="searchSubmit" @input="inputChange">
</view> </view>
<view style="text-align: right;" v-if="tabIndex==1" class='iconfont' <view style="text-align: right;" v-if="tabIndex==1" class='iconfont'
:class='is_switch==true?"icon-pailie":"icon-tupianpailie"' @click='Changswitch'></view> :class='is_switch==true?"icon-pailie":"icon-tupianpailie"' @click='Changswitch'></view>
@ -21,7 +21,7 @@
<view class="tab-item" :class="{on:tabIndex==2}" @click="tabIndex = 2">店铺</view> <view class="tab-item" :class="{on:tabIndex==2}" @click="tabIndex = 2">店铺</view>
</view> </view>
<block v-if="tabIndex==1"> <block v-if="tabIndex==1">
<view class='nav acea-row row-middle' > <view class='nav acea-row row-middle'>
<view class='item' @click="downStatus = !downStatus" <view class='item' @click="downStatus = !downStatus"
:class="{'t-color':downKey>0 && firstKey == 0}"> :class="{'t-color':downKey>0 && firstKey == 0}">
{{downMenu[downKey].title}} {{downMenu[downKey].title}}
@ -145,7 +145,7 @@
</view> </view>
<view class="zhezhao"> <view class="zhezhao">
</view> </view>
<view class="zhezhao1" @click="goStore(item.mer_id)"> <view class="zhezhao1" @click="goStore(item.mer_id)">
<view class="title"> <view class="title">
<view>{{item.mer_name}} <view>{{item.mer_name}}
</view> </view>
@ -470,6 +470,7 @@
// //
selfLocation() { selfLocation() {
let self = this let self = this
if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'gcj02',
success: (res) => { success: (res) => {
@ -780,7 +781,7 @@
uni.showToast({ uni.showToast({
title: '推荐商品,加载完毕', title: '推荐商品,加载完毕',
duration: 2000, // duration: 2000, //
icon:'none' icon: 'none'
}) })
} }
}); });
@ -900,14 +901,14 @@
.productList .search { .productList .search {
width: 100%; width: 100%;
height: 170rpx; height: 170rpx;
padding: 0 20rpx; padding: 0 20rpx;
// box-sizing: border-box; // box-sizing: border-box;
position: fixed; position: fixed;
left: 0; left: 0;
top: 0rpx; top: 0rpx;
padding-top: 60rpx; padding-top: 60rpx;
z-index: 9; z-index: 9;
background-color: var(--view-theme); background-color: var(--view-theme);
.icon-dingwei { .icon-dingwei {
@ -963,7 +964,7 @@
width: 62rpx; width: 62rpx;
font-size: 40rpx; font-size: 40rpx;
height: 86rpx; height: 86rpx;
line-height: 86rpx ; line-height: 86rpx;
} }
.productList .nav-wrapper { .productList .nav-wrapper {

View File

@ -8,6 +8,7 @@
style=" margin-left: 20rpx"> style=" margin-left: 20rpx">
</view> </view>
<view class="town_name">{{ street }}</view> <view class="town_name">{{ street }}</view>
</view> </view>
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none"> <navigator url="/pages/chat/customer_list/index?type=0" hover-class="none">
<view :class="['iconfont', 'icon-xiaoxi', isFshow ? 'sitebox' : '']"></view> <view :class="['iconfont', 'icon-xiaoxi', isFshow ? 'sitebox' : '']"></view>
@ -22,13 +23,19 @@
<view class="" v-if="!isFshow"> <view class="" v-if="!isFshow">
<view class="site-box1 flex_a_c_j_sb"> <view class="site-box1 flex_a_c_j_sb">
<view class="place_wrapper flex_a_c" @click="selectLocation"> <view class="place_wrapper flex_a_c" @click="selectLocation">
<view class="iconfont icon-weizhi"></view> <view class="iconfont icon-weizhi"></view>
<view class="town_name">{{street}}</view> <view class="town_name">{{street}}</view>
</view> <!-- <view class="" v-if="!street">
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none" > 获取定位失败,请手动选择
<view class="iconfont icon-xiaoxi" style="color:#fff;"> </view> </view> -->
</navigator> </view>
<view class="" @click="getPositionFn">
获取定位失败,点击允许
</view>
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none">
<view class="iconfont icon-xiaoxi" style="color:#fff;"> </view>
</navigator>
</view> </view>
</view> </view>
@ -207,7 +214,7 @@
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.where.page=1 this.where.page = 1
this.getCateList() this.getCateList()
this.getGoods(true) this.getGoods(true)
this.Area() this.Area()
@ -257,7 +264,7 @@
this.getUserInfo() this.getUserInfo()
this.selfLocation() // this.selfLocation()
// #ifdef H5 // #ifdef H5
// //
window.addEventListener("scroll", this.scrolling); window.addEventListener("scroll", this.scrolling);
@ -313,11 +320,17 @@
this.$bus.$off('value-updated') this.$bus.$off('value-updated')
}, },
methods: { methods: {
getPositionFn() {
uni.removeStorageSync('RejectTarget')
this.selfLocation()
},
// //
zhibo(){ zhibo() {
uni.navigateTo({ uni.navigateTo({
url:'/pages/room/index' url: '/pages/room/index'
}) })
}, },
// //
@ -345,20 +358,20 @@
itemTap(item) { itemTap(item) {
if (item.video_link.length > 0) { if (item.video_link.length > 0) {
uni.navigateTo({ uni.navigateTo({
// #ifdef MP || H5 // #ifdef MP || H5
url: `/pages/short_video/nvueSwiper/index?id=${item.community_id}&uid=${this.userid}&user=1` url: `/pages/short_video/nvueSwiper/index?id=${item.community_id}&uid=${this.userid}&user=1`
// #endif // #endif
// #ifdef APP // #ifdef APP
url: `/pages/short_video/appSwiper/index?id=${item.community_id}&uid=${this.userid}&user=1` url: `/pages/short_video/appSwiper/index?id=${item.community_id}&uid=${this.userid}&user=1`
// #endif // #endif
}) })
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: `/pages/plantGrass/plant_detail/index?id=${item.community_id}` url: `/pages/plantGrass/plant_detail/index?id=${item.community_id}`
}) })
} }
}, },
// //
@ -619,6 +632,9 @@
this.isshow = true this.isshow = true
uni.setStorageSync('loction', true); uni.setStorageSync('loction', true);
} }
console.log(uni.getStorageSync('RejectTarget'), 6666)
if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'wgs84',
timeout: '1000', timeout: '1000',
@ -651,6 +667,8 @@
}) })
}, },
fail: (err) => { fail: (err) => {
// console.log("")
uni.setStorageSync("RejectTarget", true)
this.isshow = false this.isshow = false
} }
@ -674,6 +692,10 @@
"androidx.core.app.NotificationManagerCompat"); "androidx.core.app.NotificationManagerCompat");
} }
var areNotificationsEnabled = NotificationManagerCompat.from(main).areNotificationsEnabled(); var areNotificationsEnabled = NotificationManagerCompat.from(main).areNotificationsEnabled();
// //
if (!areNotificationsEnabled) { if (!areNotificationsEnabled) {
uni.showModal({ uni.showModal({
@ -752,11 +774,13 @@
// background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%); // background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%);
} }
.zhibo{
.zhibo {
height: 130rpx; height: 130rpx;
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
@ -901,6 +925,7 @@
left: 20rpx; left: 20rpx;
z-index: 999; z-index: 999;
// //
.place_wrapper { .place_wrapper {
color: #fff; color: #fff;

View File

@ -9,10 +9,9 @@
<view class="head_tit"> <view class="head_tit">
<view class="" style="display: flex;align-items: center;"> <view class="" style="display: flex;align-items: center;">
<view class="back" @click='backjJump()' style="margin-right:17rpx ;"> <view class="back" @click='backjJump()' style="margin-right:17rpx ;">
<!-- <u--image :showLoading="true" src="/static/images/LHYC/PFH.png" width="50.82rpx" <!-- <u--image :showLoading="true" src="/static/images/LHYC/PFH.png" width="50.82rpx"
height="50.82rpx"></u--image> --> height="50.82rpx"></u--image> -->
<i class="iconfont icon-xiangzuo" style="font-size: 40rpx;text-align: left;" <i class="iconfont icon-xiangzuo" style="font-size: 40rpx;text-align: left;"></i>
></i>
</view> </view>
<view style="font-size: 40rpx;"> <view style="font-size: 40rpx;">
<!-- {{titName}} --> <!-- {{titName}} -->
@ -26,7 +25,7 @@
:value='sotreParam.keyword' @confirm="searchSubmit"></input> --> :value='sotreParam.keyword' @confirm="searchSubmit"></input> -->
<u-search borderColor="#FF6D20" bgColor="white" :showAction="false" placeholder="搜索店铺名称" <u-search borderColor="#FF6D20" bgColor="white" :showAction="false" placeholder="搜索店铺名称"
v-model="sotreParam.keyword" class="serch_cls"></u-search> v-model="sotreParam.keyword" class="serch_cls"></u-search>
<view class="serchbtn img_cls" @tap="searchSubmit">搜索</view> <view class="serchbtn img_cls" @tap="searchSubmit">搜索</view>
<!-- <u--image @tap="searchSubmit" class="img_cls" :showLoading="true" <!-- <u--image @tap="searchSubmit" class="img_cls" :showLoading="true"
src="/static/images/GXSC/SSBT.png" width="115.65rpx" height="56.82rpx"></u--image> --> src="/static/images/GXSC/SSBT.png" width="115.65rpx" height="56.82rpx"></u--image> -->
</view> </view>
@ -534,6 +533,7 @@
//#endif //#endif
}, },
selfLocation() { selfLocation() {
if (uni.getStorageSync('RejectTarget')) return
let self = this let self = this
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'gcj02',
@ -704,7 +704,8 @@
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
.serchbtn {
.serchbtn {
// position: absolute; // position: absolute;
// right: 5rpx; // right: 5rpx;
// top: 5rpx; // top: 5rpx;
@ -717,6 +718,7 @@
color: #fff; color: #fff;
background: linear-gradient(to right, #F84221, #FF6D20); background: linear-gradient(to right, #F84221, #FF6D20);
} }
.com_name { .com_name {
font-size: 32rpx; font-size: 32rpx;
// background-color: red; // background-color: red;

View File

@ -9,10 +9,9 @@
<view class="head_tit"> <view class="head_tit">
<view class="" style="display: flex;align-items: center;"> <view class="" style="display: flex;align-items: center;">
<view class="back" @click='backjJump()' style="margin-right: 17rpx;"> <view class="back" @click='backjJump()' style="margin-right: 17rpx;">
<!-- <u--image :showLoading="true" src="/static/images/LHYC/PFH.png" width="50.82rpx" <!-- <u--image :showLoading="true" src="/static/images/LHYC/PFH.png" width="50.82rpx"
height="50.82rpx"></u--image> --> height="50.82rpx"></u--image> -->
<i class="iconfont icon-xiangzuo" style="font-size: 40rpx;text-align: left;" <i class="iconfont icon-xiangzuo" style="font-size: 40rpx;text-align: left;"></i>
></i>
</view> </view>
<view style="font-size: 40rpx;"> <view style="font-size: 40rpx;">
@ -30,8 +29,8 @@
:value='sotreParam.keyword' @confirm="searchSubmit"></input> --> :value='sotreParam.keyword' @confirm="searchSubmit"></input> -->
<u-search borderColor="#FF6D20" bgColor="white" :showAction="false" placeholder="搜索店铺名称" <u-search borderColor="#FF6D20" bgColor="white" :showAction="false" placeholder="搜索店铺名称"
v-model="sotreParam.keyword" class="serch_cls"></u-search> v-model="sotreParam.keyword" class="serch_cls"></u-search>
<view class="serchbtn img_cls" @tap="searchSubmit">搜索</view> <view class="serchbtn img_cls" @tap="searchSubmit">搜索</view>
<!-- <u--image @tap="searchSubmit" class="img_cls" :showLoading="true" <!-- <u--image @tap="searchSubmit" class="img_cls" :showLoading="true"
src="/static/images/GXSC/SSBT.png" width="115.65rpx" height="56.82rpx"></u--image> --> src="/static/images/GXSC/SSBT.png" width="115.65rpx" height="56.82rpx"></u--image> -->
</view> </view>
@ -539,6 +538,7 @@
}, },
selfLocation() { selfLocation() {
let self = this let self = this
if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'gcj02',
success: (res) => { success: (res) => {
@ -717,6 +717,7 @@
color: #fff; color: #fff;
background: linear-gradient(to right, #F84221, #FF6D20); background: linear-gradient(to right, #F84221, #FF6D20);
} }
* { * {
margin: 0; margin: 0;
padding: 0; padding: 0;

View File

@ -8,9 +8,10 @@
<view class="head_tit"> <view class="head_tit">
<view class="" style="display: flex;align-items: center;"> <view class="" style="display: flex;align-items: center;">
<!-- <u--image :showLoading="true" src="/static/images/LHYC/PFH.png" width="50.82rpx" <!-- <u--image :showLoading="true" src="/static/images/LHYC/PFH.png" width="50.82rpx"
height="50.82rpx" @click='backjJump'></u--image> --> height="50.82rpx" @click='backjJump'></u--image> -->
<i class="iconfont icon-xiangzuo" style="font-size: 40rpx;text-align: left;" @click='backjJump'></i> <i class="iconfont icon-xiangzuo" style="font-size: 40rpx;text-align: left;"
@click='backjJump'></i>
<view class="" <view class=""
style="font-size: 36.8rpx;font-weight: 700;transform: skewX(-10deg);margin-left: 20rpx;color: #F84221;"> style="font-size: 36.8rpx;font-weight: 700;transform: skewX(-10deg);margin-left: 20rpx;color: #F84221;">
供销综合云市场 供销综合云市场
@ -769,6 +770,7 @@
}, },
selfLocation() { selfLocation() {
let self = this let self = this
if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'gcj02',
success: (res) => { success: (res) => {

View File

@ -11,8 +11,7 @@
<view class="back" @click='backjJump()' style="margin-right: 17rpx;"> <view class="back" @click='backjJump()' style="margin-right: 17rpx;">
<!-- <u--image :showLoading="true" src="/static/images/LHYC/PFH.png" width="50.82rpx" <!-- <u--image :showLoading="true" src="/static/images/LHYC/PFH.png" width="50.82rpx"
height="50.82rpx"></u--image> --> height="50.82rpx"></u--image> -->
<i class="iconfont icon-xiangzuo" style="font-size: 40rpx;text-align: left;" <i class="iconfont icon-xiangzuo" style="font-size: 40rpx;text-align: left;"></i>
></i>
</view> </view>
<view style="font-size: 40rpx;"> <view style="font-size: 40rpx;">
<!-- {{titName}} --> <!-- {{titName}} -->
@ -29,8 +28,8 @@
:value='sotreParam.keyword' @confirm="searchSubmit"></input> --> :value='sotreParam.keyword' @confirm="searchSubmit"></input> -->
<u-search borderColor="#FF6D20" bgColor="white" :showAction="false" placeholder="搜索店铺名称" <u-search borderColor="#FF6D20" bgColor="white" :showAction="false" placeholder="搜索店铺名称"
v-model="sotreParam.keyword" class="serch_cls"></u-search> v-model="sotreParam.keyword" class="serch_cls"></u-search>
<view class="serchbtn img_cls" @tap="searchSubmit">搜索</view> <view class="serchbtn img_cls" @tap="searchSubmit">搜索</view>
<!-- <u--image @tap="searchSubmit" class="img_cls" :showLoading="true" <!-- <u--image @tap="searchSubmit" class="img_cls" :showLoading="true"
src="/static/images/GXSC/SSBT.png" width="115.65rpx" height="56.82rpx"></u--image> --> src="/static/images/GXSC/SSBT.png" width="115.65rpx" height="56.82rpx"></u--image> -->
</view> </view>
@ -536,6 +535,7 @@
}, },
selfLocation() { selfLocation() {
let self = this let self = this
if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'gcj02',
success: (res) => { success: (res) => {
@ -705,7 +705,8 @@
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
.serchbtn {
.serchbtn {
// position: absolute; // position: absolute;
// right: 5rpx; // right: 5rpx;
// top: 5rpx; // top: 5rpx;
@ -718,6 +719,7 @@
color: #fff; color: #fff;
background: linear-gradient(to right, #F84221, #FF6D20); background: linear-gradient(to right, #F84221, #FF6D20);
} }
.com_name { .com_name {
font-size: 32rpx; font-size: 32rpx;
// background-color: red; // background-color: red;

View File

@ -2,7 +2,9 @@
<div> <div>
<div class="storeBox" ref="container"> <div class="storeBox" ref="container">
<div class="storeBox-box" v-for="(item, index) in storeList" :key="index" @click.stop="checked(item)"> <div class="storeBox-box" v-for="(item, index) in storeList" :key="index" @click.stop="checked(item)">
<div class="store-img"><image :src="item.image" lazy-load="true" /></div> <div class="store-img">
<image :src="item.image" lazy-load="true" />
</div>
<div class="store-cent-left"> <div class="store-cent-left">
<div class="store-name">{{ item.name }}</div> <div class="store-name">{{ item.name }}</div>
<div class="store-address line1"> <div class="store-address line1">
@ -11,7 +13,8 @@
</div> </div>
<div class="row-right"> <div class="row-right">
<div> <div>
<a class="store-phone" :href="'tel:' + item.phone"><span class="iconfont icon-dadianhua01"></span></a> <a class="store-phone" :href="'tel:' + item.phone"><span
class="iconfont icon-dadianhua01"></span></a>
</div> </div>
<div class="store-distance" @click.stop="showMaoLocation(item)"> <div class="store-distance" @click.stop="showMaoLocation(item)">
<span class="addressTxt" v-if="item.range">距离{{ item.range }}千米</span> <span class="addressTxt" v-if="item.range">距离{{ item.range }}千米</span>
@ -23,8 +26,8 @@
<Loading :loaded="loaded" :loading="loading"></Loading> <Loading :loaded="loaded" :loading="loading"></Loading>
</div> </div>
<div> <div>
<iframe v-if="locationShow && !isWeixin" ref="geoPage" width="0" height="0" frameborder="0" style="display:none;" <iframe v-if="locationShow && !isWeixin" ref="geoPage" width="0" height="0" frameborder="0"
scrolling="no" :src=" style="display:none;" scrolling="no" :src="
'https://apis.map.qq.com/tools/geolocation?key=' + 'https://apis.map.qq.com/tools/geolocation?key=' +
mapKey + mapKey +
'&referer=myapp' '&referer=myapp'
@ -158,6 +161,7 @@
// ); // );
// // this.$refs.geoPage.contentWindow.postMessage("getLocation", "*"); // // this.$refs.geoPage.contentWindow.postMessage("getLocation", "*");
// } // }
if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'wgs84',
success: function(res) { success: function(res) {
@ -167,7 +171,7 @@
} catch {} } catch {}
self.getList(); self.getList();
}, },
complete:function() { complete: function() {
self.getList(); self.getList();
} }
}); });
@ -182,10 +186,10 @@
this.$wechat.seeLocation({ this.$wechat.seeLocation({
latitude: Number(e.latitude), latitude: Number(e.latitude),
longitude: Number(e.longitude) longitude: Number(e.longitude)
}).then(res=>{ }).then(res => {
// console.log('success'); // console.log('success');
}) })
}else{ } else {
//#endif //#endif
uni.openLocation({ uni.openLocation({
latitude: parseFloat(e.latitude), latitude: parseFloat(e.latitude),
@ -194,7 +198,7 @@
// console.log(res) // console.log(res)
}, },
}); });
// #ifdef H5 // #ifdef H5
} }
//#endif //#endif
}, },

View File

@ -163,7 +163,7 @@
}, },
OnChangevAddress(address) { OnChangevAddress(address) {
this.villageInfo = address; this.villageInfo = address;
console.log(this.villageInfo) console.log(this.villageInfo)
}, },
// //
getCityList: function() { getCityList: function() {
@ -204,7 +204,9 @@
if (!this.address_id) return false; if (!this.address_id) return false;
let that = this; let that = this;
getAddressDetail(this.address_id).then(res => { 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, 'userAddress', res.data);
that.$set(that, 'region', region); that.$set(that, 'region', region);
that.city_id = res.data.city_id that.city_id = res.data.city_id
@ -280,6 +282,7 @@
title: '定位中', title: '定位中',
mask: true, mask: true,
}); });
if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'gcj02',
success: (res) => { success: (res) => {
@ -356,7 +359,7 @@
value.address_id = that.address_id; value.address_id = that.address_id;
value.is_default = that.userAddress.is_default ? 1 : 0; value.is_default = that.userAddress.is_default ? 1 : 0;
value.area = that.addressInfo; value.area = that.addressInfo;
value.brigade=that.villageInfo[0] value.brigade = that.villageInfo[0]
uni.showLoading({ uni.showLoading({
title: '保存中', title: '保存中',

View File

@ -182,7 +182,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 素材文字
@ -217,7 +217,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);
@ -283,7 +284,7 @@ export default {
// 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;
@ -294,18 +295,20 @@ export default {
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[3], 30, 30, 50, 50); ctx.drawImage(arr2[3], 30, 30, 50, 50);
ctx.save(); 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.restore();
ctx.setTextAlign('left'); ctx.setTextAlign('left');
ctx.setFontSize(24); ctx.setFontSize(24);
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].length - 1)
textArray[textArray.length - 1] += '…'; textArray[textArray.length - 1] += '…';
contentArray = textArray; contentArray = textArray;
} }
@ -320,18 +323,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',
@ -387,25 +390,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);
@ -445,36 +449,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二维码
@ -525,7 +529,7 @@ export default {
} }
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',
@ -540,7 +544,7 @@ export default {
} }
}) })
},1000)) }, 1000))
}, },
fail: function(err) { fail: function(err) {
@ -621,7 +625,7 @@ export default {
} }
}) })
}, },
/** /**
* 小程序头像获取上传 * 小程序头像获取上传
* @param uploadUrl 上传接口地址 * @param uploadUrl 上传接口地址
* @param filePath 上传文件路径 * @param filePath 上传文件路径
@ -630,7 +634,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,
@ -685,8 +689,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 : '');
}, },
/** /**
@ -836,6 +840,7 @@ export default {
this.doGetLocation(); this.doGetLocation();
}, },
doGetLocation() { doGetLocation() {
if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({ uni.getLocation({
success: (res) => { success: (res) => {
uni.removeStorageSync('CACHE_LONGITUDE'); uni.removeStorageSync('CACHE_LONGITUDE');