分享二维码,开启商铺

This commit is contained in:
2025-03-20 11:47:43 +08:00
parent df3b370421
commit 62db07a644
22 changed files with 134 additions and 73 deletions

View File

@ -4,6 +4,7 @@ export default {
genderKV:{ genderKV:{
MALE:'先生',FEMALE:'女士' MALE:'先生',FEMALE:'女士'
}, },
shareQRCode:()=>request.get('/api/user/qr_code'),
getPhoneByCode(code){ getPhoneByCode(code){
return request.post('/api/user/send-code',{}) return request.post('/api/user/send-code',{})
}, },

View File

@ -45,6 +45,12 @@
"iconPath": "assets/icon/tabs/tab1.png", "iconPath": "assets/icon/tabs/tab1.png",
"selectedIconPath": "assets/icon/tabs/tab1-active.png" "selectedIconPath": "assets/icon/tabs/tab1-active.png"
}, },
{
"pagePath": "pages/shop/index/index",
"text": "商家",
"iconPath": "assets/icon/tabs/tab2.png",
"selectedIconPath": "assets/icon/tabs/tab2-active.png"
},
{ {
"pagePath": "pages/order/index/index", "pagePath": "pages/order/index/index",
"text": "订单", "text": "订单",

BIN
assets/icon/help/qrcode.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1007 B

View File

@ -5,6 +5,7 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
width:String,
titleText:{ titleText:{
type:String, type:String,
value:'' value:''

View File

@ -2,7 +2,7 @@
<page-container model:show="{{_show}}" wx:if="{{show}}" position="center" <page-container model:show="{{_show}}" wx:if="{{show}}" position="center"
class="custom-modal-view" bind:afterleave="afterLeave" class="custom-modal-view" bind:afterleave="afterLeave"
custom-style="background-color:transparent;left:27px;width:calc(100vw - 54px);height:200px;{{dynamicsStyle}}"> custom-style="background-color:transparent;left:{{width?'calc((100vw - '+width+')/2)':'27px'}};width:{{width||'calc(100vw - 54px)'}};height:200px;{{dynamicsStyle}}">
<view class="custom-modal-view-overlay" wx:if="{{!overlayClose}}"></view> <view class="custom-modal-view-overlay" wx:if="{{!overlayClose}}"></view>
<view class="modal-view-main" id="modalViewMain"> <view class="modal-view-main" id="modalViewMain">
<view class="title {{titleTextCenter?'center':''}}"> <view class="title {{titleTextCenter?'center':''}}">
@ -14,7 +14,7 @@
<input wx:if="{{editable&&useInput}}" model:value="{{content}}" cursor-spacing="140px" <input wx:if="{{editable&&useInput}}" model:value="{{content}}" cursor-spacing="140px"
focus="{{show&&autoFocus}}" class="content-input" focus="{{show&&autoFocus}}" class="content-input"
placeholder="{{contentPlaceholder}}"/> placeholder="{{contentPlaceholder}}"/>
<textarea class="content-textarea {{contentMessage?'error':''}}" model:value="{{content}}" row="3" wx:elif="{{editable}}" focus="{{show&&autoFocus}}" <textarea class="content-textarea {{contentMessage?'error':''}}" model:value="{{content}}" row="3" wx:elif="{{editable}}" focus="{{show&&autoFocus}}" disable-default-padding
placeholder="{{contentPlaceholder}}" focus="{{contentFocus}}" animation="{{contentAnimation}}" cursor-spacing="200rpx"></textarea> placeholder="{{contentPlaceholder}}" focus="{{contentFocus}}" animation="{{contentAnimation}}" cursor-spacing="200rpx"></textarea>
<view class="content-text" wx:elif="{{content}}">{{content}}</view> <view class="content-text" wx:elif="{{content}}">{{content}}</view>

View File

@ -50,6 +50,7 @@
.nav-bar-content .share{ .nav-bar-content .share{
width:30rpx;height:34rpx; width:30rpx;height:34rpx;
padding:12rpx 28rpx; padding:12rpx 28rpx;
vertical-align: middle;
} }
.nav-bar-content .center{ .nav-bar-content .center{
flex:1; flex:1;

View File

@ -12,8 +12,8 @@
<label class="detail">{{shop.gift_points_rate_text}}</label> <label class="detail">{{shop.gift_points_rate_text}}</label>
</view> </view>
</view> </view>
<view class="promation"> <view class="promation" wx:if="{{shop.featured_product}}">
<view class="coupon" wx:if="{{shop.featured_product}}"> <view class="coupon">
<label class="tag">[{{shop.featured_product.promotion_text}}]</label> <label class="tag">[{{shop.featured_product.promotion_text}}]</label>
<label class="detail">{{shop.featured_product.product_name}}</label> <label class="detail">{{shop.featured_product.product_name}}</label>
</view> </view>

View File

@ -1,6 +1,9 @@
.shop-item{ .shop-item{
display: flex; display: flex;
} }
.shop-item:first-child{
margin-top:0;
}
.shop-item .logo{ .shop-item .logo{
width:180rpx;height:180rpx; width:180rpx;height:180rpx;
border-radius: 18rpx; border-radius: 18rpx;
@ -11,12 +14,12 @@
} }
.shop-item .line1{ .shop-item .line1{
line-height: 1.4; line-height: 1.4;
font-size:34rpx; font-size:32rpx;
font-weight: 600; font-weight: 600;
} }
.shop-item .line2{ .shop-item .line2{
line-height: 1.4; line-height: 1.4;
font-size: 26rpx; font-size: 24rpx;
display: flex; display: flex;
color:#888888; color:#888888;
margin-top:14rpx; margin-top:14rpx;
@ -38,7 +41,7 @@
} }
.shop-item .promation.buy .coupon::before{ .shop-item .promation.buy .coupon::before{
content: '买'; content: '买';
background-color:#ff0000; background-color:#FF8C12;
} }
.shop-item .promation .coupon::before{ .shop-item .promation .coupon::before{
content: '券'; content: '券';
@ -49,7 +52,7 @@
color:#fff; color:#fff;
} }
.shop-item .promation.buy .tag{ .shop-item .promation.buy .tag{
color:#ff0000; color:#FF8C12;
} }
.shop-item .promation .tag{ .shop-item .promation .tag{
font-weight: 500; font-weight: 500;

View File

@ -44,4 +44,5 @@
width:100%; width:100%;
text-align: center; text-align: center;
color:#999999; color:#999999;
opacity: .1;
} }

View File

@ -1,4 +1,5 @@
const app = getApp(); const app = getApp();
import userApi from '../../../api/user';
Page({ Page({
@ -9,9 +10,12 @@ Page({
userInfo:{}, userInfo:{},
refresherTriggered:true, refresherTriggered:true,
bgHeight:'100%', bgHeight:'100%',
appConfig:{} appConfig:{},
},
isShowQRCode:false,
shareQRCodeUrl:''
},
goToCouponList(){ goToCouponList(){
wx.navigateTo({ wx.navigateTo({
url: '/pages/my/coupon/index', url: '/pages/my/coupon/index',
@ -50,6 +54,16 @@ Page({
}, },
shareFriend(){ shareFriend(){
},
showQRCode(){
userApi.shareQRCode().then((data)=>{
this.setData({
shareQRCodeUrl:data.url
})
})
this.setData({
isShowQRCode:true
})
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成

View File

@ -1,4 +1,6 @@
{ {
"usingComponents": {}, "usingComponents": {
"modal-view":"/components/modalView"
},
"navigationStyle": "custom" "navigationStyle": "custom"
} }

View File

@ -8,9 +8,7 @@
<image class="avatar" src="{{userInfo.optimized_avatar||'/assets/icon/my/avatar.png'}}"/> <image class="avatar" src="{{userInfo.optimized_avatar||'/assets/icon/my/avatar.png'}}"/>
</navigator> </navigator>
<view class="name">{{userInfo.nickname}}</view> <view class="name">{{userInfo.nickname}}</view>
<navigator class="setting" url="/pages/my/setting/index/index"> <image src="/assets/icon/help/qrcode.png" class="qrcode" bind:tap="showQRCode"/>
<image src="/assets/icon/my/setting@2x.png" class="icon"/>
</navigator>
</view> </view>
</view> </view>
@ -80,4 +78,10 @@
</view> </view>
</view> </view>
<view class="scroll-view-dispatch"></view> <view class="scroll-view-dispatch"></view>
</scroll-view> </scroll-view>
<modal-view show="{{isShowQRCode}}" isShowCancel="{{false}}" isShowOk="{{false}}" class="modal-view-qrcode" width="256px">
<image class="qrcode" src="{{shareQRCodeUrl}}" show-menu-by-longpress/>
<view class="weui-loading" wx:if="{{!shareQRCodeUrl}}"></view>
<view class="tips">邀请好友丨扫码体验</view>
</modal-view>

View File

@ -29,17 +29,8 @@
flex:1; flex:1;
margin-left:30rpx; margin-left:30rpx;
} }
.user-info .content .setting{ .user-info .content .qrcode{
background: rgba(255, 255, 255, 0.9); width:56rpx;height:56rpx;
width:66rpx;height:66rpx;
border-radius: 50%;
display: flex;
align-items: center;
padding:18rpx 16rpx;
box-sizing: border-box;
}
.user-info .content .setting .icon{
width:36rpx;height:30rpx;
} }
.property{ .property{
@ -99,3 +90,24 @@
.cell.is-button:hover{ .cell.is-button:hover{
background-color: #fff; background-color: #fff;
} }
.modal-view-qrcode{
position: relative;
}
.modal-view-qrcode .modal-view-main{
padding:36rpx;
}
.modal-view-qrcode .qrcode{
width:220px;height: 220px;
vertical-align: middle;
}
.modal-view-qrcode .weui-loading{
position: absolute;
left:50%;top:44%;
margin-left: -0.5em;
}
.modal-view-qrcode .tips{
font-size:32rpx;
color: #222222;
text-align: center;
margin-top:26rpx;
}

View File

@ -1,6 +1,6 @@
<!-- <nav-bar class="nav-bar"/> --> <!-- <nav-bar class="nav-bar"/> -->
<!-- <view class="tab-bar"> <view class="tab-bar">
<view class="item-container {{tabIndex==0?'current':''}}" bind:tap="changeTab" data-index="0"> <view class="item-container {{tabIndex==0?'current':''}}" bind:tap="changeTab" data-index="0">
<view class="item">配送订单</view> <view class="item">配送订单</view>
</view> </view>
@ -10,7 +10,7 @@
<view class="item-container {{tabIndex==2?'current':''}}" bind:tap="changeTab" data-index="2"> <view class="item-container {{tabIndex==2?'current':''}}" bind:tap="changeTab" data-index="2">
<view class="item">商品订单</view> <view class="item">商品订单</view>
</view> </view>
</view> --> </view>
<!-- <swiper style="height:{{scrollViewHeight*2}}rpx"> --> <!-- <swiper style="height:{{scrollViewHeight*2}}rpx"> -->
<!-- 跑腿列表 --> <!-- 跑腿列表 -->

View File

@ -67,6 +67,19 @@ Page({
}); });
}); });
}, },
navToMap(){
wx.openLocation({
name:this.data.detail.name,
address:this.data.detail.address,
latitude: this.data.detail.latitude,
longitude: this.data.detail.longitude,
})
},
makePhoneCall(){
wx.makePhoneCall({
phoneNumber:this.data.detail.phone,
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */

View File

@ -2,6 +2,5 @@
"usingComponents": { "usingComponents": {
"nav-bar":"/components/navbar", "nav-bar":"/components/navbar",
"merchant-order":"/components/merchantOrder" "merchant-order":"/components/merchantOrder"
}, }
"navigationStyle": "custom"
} }

View File

@ -1,4 +1,4 @@
<nav-bar background="#fff" share back></nav-bar> <!-- <nav-bar background="#fff" share back></nav-bar> -->
<view class="page-container shop-info"> <view class="page-container shop-info">
<view class="head"> <view class="head">
<view class="left"> <view class="left">
@ -13,18 +13,18 @@
<view class="l1">{{detail.address}}</view> <view class="l1">{{detail.address}}</view>
<view class="l2" wx:if="{{detail.distance}}">距离{{detail.distance}}</view> <view class="l2" wx:if="{{detail.distance}}">距离{{detail.distance}}</view>
</view> </view>
<view class="right"> <view class="right" bind:tap="navToMap">
<view class="icon-con"> <view class="icon-con">
<image class="icon" src="/assets/icon/shop/location@2x.png"/> <image class="icon" src="/assets/icon/shop/location@2x.png"/>
</view> </view>
<view class="text">地图</view>
</view>
<view class="right">
<view class="icon-con">
<image class="icon" src="/assets/icon/shop/phone@2x.png"/>
</view>
<view class="text">导航</view> <view class="text">导航</view>
</view> </view>
<view class="right" bind:tap="makePhoneCall">
<view class="icon-con">
<image class="icon" src="/assets/icon/shop/phone-black.png"/>
</view>
<view class="text">电话</view>
</view>
</view> </view>
</view> </view>

View File

@ -69,26 +69,28 @@
text-overflow:ellipsis; text-overflow:ellipsis;
overflow: hidden; overflow: hidden;
margin-top:6rpx; margin-top:6rpx;
color:#555555;
} }
.shop-info .address .l2{ .shop-info .address .l2{
font-size: 24rpx; font-size: 26rpx;
color: #888888; color: #222222;
margin-top:40rpx margin-top:40rpx
} }
.shop-info .address .right{ .shop-info .address .right{
font-size:22rpx; font-size:26rpx;
color: #888888; color: #555555;
text-align: center; text-align: center;
margin-left: 44rpx; margin-left: 44rpx;
} }
.shop-info .address .icon-con{ .shop-info .address .icon-con{
padding:8rpx; padding:10rpx;
background: rgba(153, 153, 153, 0.1); background: rgba(153, 153, 153, 0.1);
display: inline-block; display: inline-block;
border-radius: 50%; border-radius: 50%;
} }
.shop-info .address .icon{ .shop-info .address .icon{
width:30rpx;height:30rpx; width:26rpx;height:26rpx;
vertical-align: middle;
} }
.shop-info .address .right .text{ .shop-info .address .right .text{
margin-top:26rpx; margin-top:26rpx;

View File

@ -1,26 +1,28 @@
<nav-bar/> <view class="custom-scroll-view">
<navigator class="consume" url="/pages/my/money/index"> <view>
<view class="title">蜂蜜 (克)</view> <nav-bar/>
<view class="point">{{userInfo.points}}</view> <view class="consume" url="/pages/my/money/index">
<view class="tips">取快递自动抵扣</view> <view class="title">蜂蜜 (克)</view>
</navigator> <view class="point">{{userInfo.points}}</view>
<view class="btns"> <view class="tips">取快递自动抵扣</view>
<button wx:for="{{categories}}" wx:key="index" class="item" size="mini" </view>
bind:tap="changeTab" data-index="{{index}}" data-cid="{{item.id}}" <view class="btns">
type="{{tabIndex==index?'primary':''}}"> <button wx:for="{{categories}}" wx:key="index" class="item" size="mini"
{{item.name}} bind:tap="changeTab" data-index="{{index}}" data-cid="{{item.id}}"
</button> type="{{tabIndex==index?'primary':''}}">
</view> {{item.name}}
</button>
<list-view class="shop-list" bind:refresh="refreshList" </view>
bind:loadMore="loadList" height="{{scrollViewHeight}}"
refresher-triggered="{{pager.refreshTrigger}}"
show-load-more="{{!(shopList.length==0&&pager.loadAll)}}"
loading="{{pager.loading}}" load-all="{{pager.loadAll}}">
<shop-item wx:for="{{shopList}}" shop="{{item}}" data-item="{{item}}" wx:key="index">
</shop-item>
<view class="list-empty" wx:if="{{shopList.length==0&&pager.loadAll}}">
<view class="title">暂无该分类商铺</view>
</view> </view>
</list-view> <list-view class="main shop-list" bind:refresh="refreshList" bind:loadMore="loadList"
refresher-triggered="{{pager.refreshTrigger}}"
show-load-more="{{!(shopList.length==0&&pager.loadAll)}}"
loading="{{pager.loading}}" load-all="{{pager.loadAll}}">
<shop-item wx:for="{{shopList}}" shop="{{item}}" data-item="{{item}}" wx:key="index">
</shop-item>
<view class="list-empty" wx:if="{{shopList.length==0&&pager.loadAll}}">
<view class="title">暂无该分类商铺</view>
</view>
</list-view>
</view>

View File

@ -4,15 +4,15 @@
background: linear-gradient(270deg, #FFDB00 0%, #FFC300 60%); background: linear-gradient(270deg, #FFDB00 0%, #FFC300 60%);
box-shadow: 0px 6px 6px 0px rgba(0, 0, 0, 0.06); box-shadow: 0px 6px 6px 0px rgba(0, 0, 0, 0.06);
margin:20rpx; margin:20rpx;
padding:40rpx 30rpx; padding:34rpx 0 32rpx 30rpx;
position:relative; position:relative;
} }
.consume .title{ .consume .title{
font-size: 32rpx; font-size: 34rpx;
} }
.consume .point{ .consume .point{
font-size: 70rpx; font-size: 70rpx;
margin-top:40rpx; margin-top:50rpx;
font-weight: 600; font-weight: 600;
} }
.consume .tips{ .consume .tips{
@ -22,7 +22,7 @@
background-color: var(--main-color); background-color: var(--main-color);
line-height: 40rpx; line-height: 40rpx;
font-size: 22rpx; font-size: 22rpx;
padding:0 16rpx; padding:0 12rpx 0 24rpx;
} }
.btns{ .btns{