商家详情初步修改
This commit is contained in:
parent
27ea50ba7e
commit
633ca29c36
@ -13,11 +13,7 @@ const commonApi = {
|
|||||||
timePeriods:(community_id)=>request.get(`/api/community-time-periods/community/${community_id}`)
|
timePeriods:(community_id)=>request.get(`/api/community-time-periods/community/${community_id}`)
|
||||||
},
|
},
|
||||||
address:{
|
address:{
|
||||||
list(commityId){
|
list(data){
|
||||||
const data = {};
|
|
||||||
if(commityId){
|
|
||||||
data.community_id = commityId;
|
|
||||||
}
|
|
||||||
return request.get('/api/address',data)
|
return request.get('/api/address',data)
|
||||||
},
|
},
|
||||||
add:(data)=>request.post('/api/address',data),
|
add:(data)=>request.post('/api/address',data),
|
||||||
|
|||||||
@ -7,6 +7,7 @@ if(envVersion=='develop'){
|
|||||||
baseUrl = 'https://api.beefast.co'
|
baseUrl = 'https://api.beefast.co'
|
||||||
}
|
}
|
||||||
let app = getApp();
|
let app = getApp();
|
||||||
|
let navLoginPromise = null;
|
||||||
|
|
||||||
|
|
||||||
const sendRequest = (options)=>{
|
const sendRequest = (options)=>{
|
||||||
@ -32,13 +33,24 @@ const sendRequest = (options)=>{
|
|||||||
}else if(result.statusCode==401){
|
}else if(result.statusCode==401){
|
||||||
const pages = getCurrentPages();
|
const pages = getCurrentPages();
|
||||||
const currentPages = pages[pages.length-1];
|
const currentPages = pages[pages.length-1];
|
||||||
if(currentPages&¤tPages.route.indexOf('pages/login')>-1){
|
|
||||||
|
if(navLoginPromise){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(app)app = getApp();
|
if(app)app = getApp();
|
||||||
const code = app?.globalData?.shared_user_code||'';
|
const code = app?.globalData?.shared_user_code||'';
|
||||||
wx.navigateTo({
|
if(currentPages&¤tPages.route.indexOf('pages/login')>-1){
|
||||||
|
//用户先打开了小程序,然后又点开了朋友的分享页
|
||||||
|
navLoginPromise = wx.redirectTo({
|
||||||
|
url: '/pages/login/login?shared_user_code='+code,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
navLoginPromise = wx.navigateTo({
|
||||||
url: '/pages/login/login?shared_user_code='+code,
|
url: '/pages/login/login?shared_user_code='+code,
|
||||||
|
});
|
||||||
|
navLoginPromise.then(()=>{
|
||||||
|
navLoginPromise = null;
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
|
|||||||
@ -12,7 +12,7 @@ export default {
|
|||||||
return request.get(`/api/merchant/${id}`,data);
|
return request.get(`/api/merchant/${id}`,data);
|
||||||
},
|
},
|
||||||
product:{
|
product:{
|
||||||
list:(merchant_id)=>request.get('/api/merchant/product/list',merchant_id?{merchant_id}:{}),
|
list:(data)=>request.get('/api/merchant/product/list',data),
|
||||||
detail:(product_id)=>request.get(`/api/merchant/product/${product_id}`)
|
detail:(product_id)=>request.get(`/api/merchant/product/${product_id}`)
|
||||||
},
|
},
|
||||||
orderList:(data)=>request.get('/api/merchant-pay',data),
|
orderList:(data)=>request.get('/api/merchant-pay',data),
|
||||||
|
|||||||
8
app.js
8
app.js
@ -13,7 +13,7 @@ App({
|
|||||||
wx.onAppRoute((res)=>{
|
wx.onAppRoute((res)=>{
|
||||||
const page = getCurrentPages();
|
const page = getCurrentPages();
|
||||||
const currentPage = page[page.length-1];
|
const currentPage = page[page.length-1];
|
||||||
if(currentPage){
|
if(currentPage&&!currentPage.useCustomShare){
|
||||||
currentPage.onShareAppMessage = async()=>{
|
currentPage.onShareAppMessage = async()=>{
|
||||||
if(!(this.globalData.appConfig&&this.globalData.appConfig.share_card_title)){
|
if(!(this.globalData.appConfig&&this.globalData.appConfig.share_card_title)){
|
||||||
await this.getAppConfig();
|
await this.getAppConfig();
|
||||||
@ -21,10 +21,14 @@ App({
|
|||||||
if(!(this.globalData.userInfo&&this.globalData.userInfo.user_code)){
|
if(!(this.globalData.userInfo&&this.globalData.userInfo.user_code)){
|
||||||
await this.getUserInfo();
|
await this.getUserInfo();
|
||||||
}
|
}
|
||||||
|
let path = '/pages/help/index/index';
|
||||||
|
if(this.globalData.userInfo.user_code){
|
||||||
|
path = `${path}?shared_user_code=${this.globalData.userInfo.user_code}`;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
title:this.globalData.appConfig.share_card_title,
|
title:this.globalData.appConfig.share_card_title,
|
||||||
imageUrl:'/assets/imgs/login/share.jpg',
|
imageUrl:'/assets/imgs/login/share.jpg',
|
||||||
path:`/pages/help/index/index?shared_user_code=${this.globalData.userInfo.user_code||''}`
|
path:path
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
9
app.wxss
9
app.wxss
@ -29,7 +29,7 @@ button .icon,button label{
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
button:not([size=mini]){
|
button:not([size=mini]){
|
||||||
width:auto!important;
|
width:auto;
|
||||||
padding:30rpx 25rpx;
|
padding:30rpx 25rpx;
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
}
|
}
|
||||||
@ -214,6 +214,13 @@ page-container .content{
|
|||||||
padding-bottom:calc(constant(safe-area-inset-bottom) + 24rpx);
|
padding-bottom:calc(constant(safe-area-inset-bottom) + 24rpx);
|
||||||
padding-bottom:calc(env(safe-area-inset-bottom) + 24rpx);
|
padding-bottom:calc(env(safe-area-inset-bottom) + 24rpx);
|
||||||
}
|
}
|
||||||
|
.bottom-bar.float,.bottom-bar-v2.float{
|
||||||
|
padding:0;
|
||||||
|
border:0;
|
||||||
|
margin: 0 24rpx;
|
||||||
|
margin-bottom:calc(constant(safe-area-inset-bottom) + 24rpx);
|
||||||
|
margin-bottom:calc(env(safe-area-inset-bottom) + 24rpx);
|
||||||
|
}
|
||||||
.custom-scroll-view{
|
.custom-scroll-view{
|
||||||
height:100vh;
|
height:100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
BIN
assets/icon/navbar/back-round.png
Normal file
BIN
assets/icon/navbar/back-round.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
BIN
assets/icon/shop/share.png
Normal file
BIN
assets/icon/shop/share.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@ -1,5 +1,8 @@
|
|||||||
// components/navBar.js
|
// components/navBar.js
|
||||||
Component({
|
Component({
|
||||||
|
options:{
|
||||||
|
multipleSlots:true
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组件的属性列表
|
* 组件的属性列表
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"component": true,
|
"component": true,
|
||||||
"usingComponents": {},
|
"usingComponents": {},
|
||||||
"styleIsolation": "shared"
|
"styleIsolation": "apply-shared"
|
||||||
}
|
}
|
||||||
@ -3,13 +3,17 @@
|
|||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="btns {{(back||backTitle)&&share?'border':''}}" wx:if="{{share||back||backTitle}}">
|
<view class="btns {{(back||backTitle)&&share?'border':''}}" wx:if="{{share||back||backTitle}}">
|
||||||
<block wx:if="{{back||backTitle}}">
|
<block wx:if="{{back||backTitle}}">
|
||||||
<image src="/assets/icon/navbar/back@2x.png" class="back" bind:tap="back" wx:if="{{canBack}}"/>
|
<block wx:if="{{canBack}}">
|
||||||
|
<image wx:if="{{background=='transparent'}}" src="/assets/icon/navbar/back-round.png" class="back home" bind:tap="back"/>
|
||||||
|
<image wx:else src="/assets/icon/navbar/back@2x.png" class="back" bind:tap="back"/>
|
||||||
|
</block>
|
||||||
<image wx:else src="/assets/icon/navbar/home.png" class="back home" bind:tap="backHome"/>
|
<image wx:else src="/assets/icon/navbar/home.png" class="back home" bind:tap="backHome"/>
|
||||||
</block>
|
</block>
|
||||||
<view class="spliter" wx:if="{{share&&back}}"></view>
|
<view class="spliter" wx:if="{{share&&back}}"></view>
|
||||||
<image src="/assets/icon/navbar/share@2x.png" class="share" wx:if="{{share}}" bind:tap="share"/>
|
<image src="/assets/icon/navbar/share@2x.png" class="share" wx:if="{{share}}" bind:tap="share"/>
|
||||||
</view>
|
</view>
|
||||||
<view class="back-title" wx:if="{{backTitle}}" bind:tap="back">{{backTitle}}</view>
|
<view class="back-title" wx:if="{{backTitle}}" bind:tap="back">{{backTitle}}</view>
|
||||||
|
<slot name="left"/>
|
||||||
</view>
|
</view>
|
||||||
<view class="center">
|
<view class="center">
|
||||||
<slot/>
|
<slot/>
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
/* components/navBar.wxss */
|
/* components/navBar.wxss */
|
||||||
.nav-bar{}
|
.nav-bar{
|
||||||
|
transition-duration: .4s;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
.nav-bar .title{
|
.nav-bar .title{
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
@ -15,6 +18,8 @@
|
|||||||
flex:1;
|
flex:1;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
max-width: calc(100vw - 140rpx);
|
||||||
}
|
}
|
||||||
.nav-bar-content .left .btns{
|
.nav-bar-content .left .btns{
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
@ -29,10 +34,11 @@
|
|||||||
/*单一一个返回或者加上 backTitle的时候*/
|
/*单一一个返回或者加上 backTitle的时候*/
|
||||||
.nav-bar-content .back{
|
.nav-bar-content .back{
|
||||||
width:40rpx;height:40rpx;
|
width:40rpx;height:40rpx;
|
||||||
padding:12rpx 14rpx 12rpx 0;
|
padding:12rpx 14rpx 12rpx 12rpx;
|
||||||
}
|
}
|
||||||
.nav-bar-content .back.home{
|
.nav-bar-content .back.home{
|
||||||
width:56rpx;height:56rpx;
|
width:56rpx;height:56rpx;
|
||||||
|
padding:0;
|
||||||
}
|
}
|
||||||
.nav-bar-content .left .btns.border{
|
.nav-bar-content .left .btns.border{
|
||||||
border: 1.2px solid #D8D8D8;
|
border: 1.2px solid #D8D8D8;
|
||||||
@ -46,6 +52,8 @@
|
|||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
.nav-bar-content .share{
|
.nav-bar-content .share{
|
||||||
width:30rpx;height:34rpx;
|
width:30rpx;height:34rpx;
|
||||||
|
|||||||
@ -20,7 +20,8 @@ Page({
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.setData({
|
this.setData({
|
||||||
communityId:options.community_id,
|
communityId:options.community_id,
|
||||||
communityName:options.community_name
|
communityName:options.community_name,
|
||||||
|
type:options.type
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -36,7 +37,14 @@ Page({
|
|||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
wx.showNavigationBarLoading();
|
wx.showNavigationBarLoading();
|
||||||
commonApi.address.list(this.data.communityId).then((data)=>{
|
let params = {};
|
||||||
|
if(this.data.type=='pickup'){
|
||||||
|
params.community_id = this.data.communityId;
|
||||||
|
params.address_type = 'PICKUP';
|
||||||
|
}else{
|
||||||
|
params.address_type = 'COMMON';
|
||||||
|
}
|
||||||
|
commonApi.address.list(params).then((data)=>{
|
||||||
wx.hideNavigationBarLoading();
|
wx.hideNavigationBarLoading();
|
||||||
this.setData({
|
this.setData({
|
||||||
addressList:data,
|
addressList:data,
|
||||||
|
|||||||
@ -117,7 +117,10 @@ Page({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getAddress(communityId){
|
getAddress(communityId){
|
||||||
commonApi.address.list(communityId).then((data)=>{
|
commonApi.address.list({
|
||||||
|
community_id:communityId,
|
||||||
|
address_type:'PICKUP'
|
||||||
|
}).then((data)=>{
|
||||||
let currentAddress = data[0]||{};
|
let currentAddress = data[0]||{};
|
||||||
data.map((item,index)=>{
|
data.map((item,index)=>{
|
||||||
if(item.is_default){
|
if(item.is_default){
|
||||||
@ -340,7 +343,7 @@ Page({
|
|||||||
if(app.globalData.accessToken){
|
if(app.globalData.accessToken){
|
||||||
if(this.data.currentCommunity&&this.data.currentCommunity.id){
|
if(this.data.currentCommunity&&this.data.currentCommunity.id){
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: `/pages/help/address/index/index?community_id=${this.data.currentCommunity.id}&community_name=${this.data.currentCommunity.name}`,
|
url: `/pages/help/address/index/index?type=pickup&community_id=${this.data.currentCommunity.id}&community_name=${this.data.currentCommunity.name}`,
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
|
|||||||
@ -214,6 +214,13 @@ Page({
|
|||||||
},
|
},
|
||||||
manuallyAdd(){
|
manuallyAdd(){
|
||||||
let stationNames = this.data.stationList.map((item)=>item.name);
|
let stationNames = this.data.stationList.map((item)=>item.name);
|
||||||
|
if(stationNames.length==0){
|
||||||
|
wx.showToast({
|
||||||
|
icon:'none',
|
||||||
|
title: '该小区未配置驿站',
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
wx.showActionSheet({
|
wx.showActionSheet({
|
||||||
itemList: stationNames,
|
itemList: stationNames,
|
||||||
success:(res)=>{
|
success:(res)=>{
|
||||||
|
|||||||
@ -20,27 +20,20 @@ Page({
|
|||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
const { miniProgram } = wx.getAccountInfoSync();
|
||||||
|
const envVersion = miniProgram.envVersion;
|
||||||
|
if(envVersion=='develop'){
|
||||||
|
this.setData({
|
||||||
|
activityId:2
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.setData({
|
this.setData({
|
||||||
activityId:options.id||2
|
activityId:options.id
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getActivityDetail(){
|
getActivityDetail(){
|
||||||
this.setData({
|
|
||||||
detailLoading:true
|
|
||||||
})
|
|
||||||
commonApi.activities.detail(this.data.activityId).then((data)=>{
|
|
||||||
this.setData({
|
|
||||||
detailLoading:false,
|
|
||||||
getting:false
|
|
||||||
})
|
|
||||||
this.setData({
|
|
||||||
detail:data
|
|
||||||
})
|
|
||||||
}).catch(()=>{
|
|
||||||
this.setData({
|
|
||||||
detailLoading:false
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
getActivity(){
|
getActivity(){
|
||||||
this.setData({
|
this.setData({
|
||||||
@ -80,15 +73,38 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getActivityDetail();
|
this.setData({
|
||||||
userApi.coupon.check(this.data.activityId).then((data)=>{
|
detailLoading:true
|
||||||
|
})
|
||||||
|
commonApi.activities.detail(this.data.activityId).then((data)=>{
|
||||||
|
this.setData({
|
||||||
|
detailLoading:false,
|
||||||
|
getting:false,
|
||||||
|
detail:data
|
||||||
|
});
|
||||||
|
return userApi.coupon.check(this.data.activityId);
|
||||||
|
}).then((data)=>{
|
||||||
if(!data.can_receive){
|
if(!data.can_receive){
|
||||||
this.setData({
|
this.setData({
|
||||||
isShowModal:true,
|
isShowModal:true,
|
||||||
errorMsg:data.message
|
errorMsg:data.message
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}).catch((res)=>{
|
||||||
|
this.setData({
|
||||||
|
detailLoading:false
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// userApi.coupon.check(this.data.activityId).then((data)=>{
|
||||||
|
// if(!data.can_receive){
|
||||||
|
// this.setData({
|
||||||
|
// isShowModal:true,
|
||||||
|
// errorMsg:data.message
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// })
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import shopApi from '../../../api/shop';
|
import shopApi from '../../../api/shop';
|
||||||
import userApi from '../../../api/user';
|
import userApi from '../../../api/user';
|
||||||
|
import {rpxToPx} from '../../../utils/util'
|
||||||
const app = getApp();
|
const app = getApp();
|
||||||
|
|
||||||
|
|
||||||
@ -19,7 +20,13 @@ Page({
|
|||||||
scrollViewHeight:0,
|
scrollViewHeight:0,
|
||||||
windowInfo:{},
|
windowInfo:{},
|
||||||
|
|
||||||
markdown:null
|
markdown:null,
|
||||||
|
|
||||||
|
productInfoMD:{},
|
||||||
|
productGuideMD:{},
|
||||||
|
|
||||||
|
scrollOverTop:false,
|
||||||
|
navBarHeight:0
|
||||||
},
|
},
|
||||||
|
|
||||||
showConfirm(event){
|
showConfirm(event){
|
||||||
@ -40,6 +47,9 @@ Page({
|
|||||||
// }).catch(()=>{
|
// }).catch(()=>{
|
||||||
this.getDetail();
|
this.getDetail();
|
||||||
// })
|
// })
|
||||||
|
this.createSelectorQuery().select('#navBar').boundingClientRect((res)=>{
|
||||||
|
this.data.navBarHeight = res.height;
|
||||||
|
}).exec();
|
||||||
},
|
},
|
||||||
getDetail(lng,lat){
|
getDetail(lng,lat){
|
||||||
shopApi.product.detail(this.data.productId,lng,lat).then((data)=>{
|
shopApi.product.detail(this.data.productId,lng,lat).then((data)=>{
|
||||||
@ -51,7 +61,9 @@ Page({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.setData({
|
this.setData({
|
||||||
detail:data
|
detail:data,
|
||||||
|
productInfoMD:app.towxml('## 详情 \n- 第一项','markdown'),
|
||||||
|
productGuideMD:app.towxml('## 须知 \n- 第一项','markdown')
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -65,9 +77,21 @@ Page({
|
|||||||
},
|
},
|
||||||
makePhoneCall(){
|
makePhoneCall(){
|
||||||
wx.makePhoneCall({
|
wx.makePhoneCall({
|
||||||
phoneNumber:this.data.detail.phone,
|
phoneNumber:this.data.detail.merchant.phone,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
scrollViewScroll(event){
|
||||||
|
|
||||||
|
if(event.detail.scrollTop+this.data.navBarHeight>rpxToPx(500)){
|
||||||
|
this.setData({
|
||||||
|
scrollOverTop:true
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
this.setData({
|
||||||
|
scrollOverTop:false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
*/
|
*/
|
||||||
@ -113,7 +137,12 @@ Page({
|
|||||||
/**
|
/**
|
||||||
* 用户点击右上角分享
|
* 用户点击右上角分享
|
||||||
*/
|
*/
|
||||||
|
useCustomShare:true,
|
||||||
onShareAppMessage() {
|
onShareAppMessage() {
|
||||||
|
return {
|
||||||
|
title:this.data.detail.name,
|
||||||
|
imageUrl:this.data.detail.optimized_image_url,
|
||||||
|
path:`/pages/shop/detail/index?id=${this.data.productId}&shared_user_code=${app.globalData.userInfo.user_code||''}`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -1,53 +1,84 @@
|
|||||||
<view class="top">
|
<nav-bar back background="{{scrollOverTop?'#fff':'transparent'}}" id="navBar"
|
||||||
<nav-bar background="#fff" back background="transparent"></nav-bar>
|
back-title="{{scrollOverTop?detail.name+detail.name+detail.name:''}}">
|
||||||
<image class="image" src="{{detail.optimized_image_url}}"/>
|
</nav-bar>
|
||||||
</view>
|
<view class="custom-scroll-view">
|
||||||
<view class="page-container product-info">
|
<scroll-view scroll-y class="main" bindscroll="scrollViewScroll">
|
||||||
<view class="p-name">{{detail.name}}</view>
|
<view class="top">
|
||||||
<view class="info">
|
<image class="image" src="{{detail.optimized_image_url}}"/>
|
||||||
<view class="tag">定时达</view>
|
<button class="share" open-type="share">
|
||||||
<view class="desc">已售100丨自提</view>
|
<image src="/assets/icon/shop/share.png" class="icon"/>
|
||||||
<number-box class="number-box"/>
|
</button>
|
||||||
</view>
|
|
||||||
<view class="spliter"></view>
|
|
||||||
<view class="user">
|
|
||||||
<image class="avatar" src="{{detail.avatar||'/assets/icon/my/avatar.png'}}"/>
|
|
||||||
<view class="center">
|
|
||||||
<view class="u-name">仙人模斗</view>
|
|
||||||
<view class="building">七栋二单元</view>
|
|
||||||
</view>
|
</view>
|
||||||
<image src="/assets/icon/shop/phone-black.png" class="icon-phone"/>
|
<view class="page-container product-info">
|
||||||
</view>
|
<view class="p-name">{{detail.name}}</view>
|
||||||
</view>
|
<view class="info">
|
||||||
<view class="page-container address">
|
<view class="tag">定时达</view>
|
||||||
<view class="head">配送地址</view>
|
<view class="desc">已售100丨自提</view>
|
||||||
<view class="content">
|
<number-box class="number-box"/>
|
||||||
<view class="no-address right-arrow">请选择收货地址</view>
|
</view>
|
||||||
</view>
|
<view class="spliter"></view>
|
||||||
</view>
|
<view class="user">
|
||||||
<view class="page-container address">
|
<image class="avatar" src="{{detail.merchant.optimized_brand_image_url||'/assets/icon/my/avatar.png'}}"/>
|
||||||
<view class="head">配送地址</view>
|
<view class="center">
|
||||||
<view class="content">
|
<view class="u-name">{{detail.merchant.name}}</view>
|
||||||
<view class="row right-arrow">
|
<view class="building">{{detail.merchant.address}}</view>
|
||||||
<image class="icon" src="/assets/icon/shop/house.png"/>
|
</view>
|
||||||
<view class="text">朝阳时代西锦12栋1单元2072</view>
|
<image src="/assets/icon/shop/phone-black.png" class="icon-phone" bind:tap="makePhoneCall"/>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="row">
|
<view class="page-container address">
|
||||||
<image class="icon" src="/assets/icon/shop/user.png"/>
|
<view class="head">配送地址</view>
|
||||||
<view class="text">周先生 18583236782</view>
|
<navigator class="content" url="/pages/help/address/index/index?type=common">
|
||||||
|
<view class="no-address right-arrow">请选择收货地址</view>
|
||||||
|
</navigator>
|
||||||
|
</view>
|
||||||
|
<view class="page-container address">
|
||||||
|
<view class="head">配送地址</view>
|
||||||
|
<view class="content">
|
||||||
|
<view class="row right-arrow">
|
||||||
|
<image class="icon" src="/assets/icon/shop/house.png"/>
|
||||||
|
<view class="text">朝阳时代西锦12栋1单元2072</view>
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<image class="icon" src="/assets/icon/shop/user.png"/>
|
||||||
|
<view class="text">周先生 18583236782</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
|
||||||
<view class="page-container address">
|
<view class="page-container address">
|
||||||
<view class="head">
|
<view class="head">
|
||||||
自提点<label class="time">3月12 16:00</label>
|
自提点<label class="time">3月12 16:00</label>
|
||||||
</view>
|
</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="row right-arrow">
|
<view class="row right-arrow">
|
||||||
<image class="icon" src="/assets/icon/shop/house.png"/>
|
<image class="icon" src="/assets/icon/shop/house.png"/>
|
||||||
<view class="text">朝阳时代西锦12栋1单元2072</view>
|
<view class="text">朝阳时代西锦12栋1单元2072</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
|
<view class="page-container address">
|
||||||
|
<view class="head">商品详情</view>
|
||||||
|
<view class="content">
|
||||||
|
<towxml nodes="{{productInfoMD}}"/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="page-container address">
|
||||||
|
<view class="head">购买须知</view>
|
||||||
|
<view class="content">
|
||||||
|
<towxml nodes="{{productGuideMD}}"/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="scroll-view-dispatch"></view>
|
||||||
|
</scroll-view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="bottom-bar float">
|
||||||
|
<view class="money">{{detail.sale_price}}</view>
|
||||||
|
<view class="tips">赠蜂蜜{{detail.gift_points}}克</view>
|
||||||
|
<button type="primary" class="button">立即下单</button>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -1,3 +1,12 @@
|
|||||||
|
.nav-bar{
|
||||||
|
z-index:100;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.custom-scroll-view{
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
top:0;left:0;
|
||||||
|
}
|
||||||
.swiper-container{
|
.swiper-container{
|
||||||
height:600rpx;
|
height:600rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -50,15 +59,34 @@
|
|||||||
top:0;left:0;
|
top:0;left:0;
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
}
|
}
|
||||||
|
.top .share{
|
||||||
|
position: absolute;
|
||||||
|
bottom:24rpx;right:24rpx;
|
||||||
|
width:66rpx;height:66rpx;
|
||||||
|
background-color:rgba(0, 0, 0, 0.6);
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding:0;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.top .share .icon{
|
||||||
|
width:54rpx;height:52rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
.product-info{
|
||||||
|
padding-top:20rpx;
|
||||||
|
}
|
||||||
.product-info .p-name{
|
.product-info .p-name{
|
||||||
font-size: 34rpx;
|
font-size: 36rpx;
|
||||||
|
line-height: 56rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
.product-info .info{
|
.product-info .info{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
margin-top:32rpx;
|
margin-top:22rpx;
|
||||||
}
|
}
|
||||||
.product-info .info .tag{
|
.product-info .info .tag{
|
||||||
border: 1.2rpx solid rgba(255, 140, 18, 0.5);
|
border: 1.2rpx solid rgba(255, 140, 18, 0.5);
|
||||||
@ -69,6 +97,7 @@
|
|||||||
.product-info .info .desc{
|
.product-info .info .desc{
|
||||||
flex:1;
|
flex:1;
|
||||||
margin-left:14rpx;
|
margin-left:14rpx;
|
||||||
|
color:#888888;
|
||||||
}
|
}
|
||||||
.product-info .spliter{
|
.product-info .spliter{
|
||||||
margin:30rpx 0;
|
margin:30rpx 0;
|
||||||
@ -85,6 +114,12 @@
|
|||||||
.product-info .user .center{
|
.product-info .user .center{
|
||||||
flex:1;
|
flex:1;
|
||||||
margin-left:22rpx;
|
margin-left:22rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.product-info .user .u-name,.product-info .user .building{
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow:ellipsis;
|
||||||
}
|
}
|
||||||
.product-info .user .building{
|
.product-info .user .building{
|
||||||
font-size: 27rpx;
|
font-size: 27rpx;
|
||||||
@ -118,3 +153,30 @@
|
|||||||
font-size: 27rpx;
|
font-size: 27rpx;
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bottom-bar.float{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 60rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
padding-left: 40rpx;
|
||||||
|
box-shadow: 0px 3px 6px 2px rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
.bottom-bar .money{
|
||||||
|
font-size: 52rpx;
|
||||||
|
}
|
||||||
|
.bottom-bar .tips{
|
||||||
|
padding-top:14rpx;
|
||||||
|
font-size: 27rpx;
|
||||||
|
color:#FF8C12;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
flex:1;
|
||||||
|
}
|
||||||
|
.bottom-bar .button{
|
||||||
|
border-radius: 0;
|
||||||
|
height: 100rpx;
|
||||||
|
min-width: 240rpx;
|
||||||
|
}
|
||||||
|
.scroll-view-dispatch{
|
||||||
|
height:calc(var(--safe-bottom) + 124rpx);
|
||||||
|
}
|
||||||
@ -10,13 +10,13 @@ Page({
|
|||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
tabIndex:0,
|
tabIndex:0,
|
||||||
categories:[],
|
|
||||||
shopList:[],
|
shopList:[],
|
||||||
userInfo:{},
|
userInfo:{},
|
||||||
lng:null,
|
lng:null,
|
||||||
lat:null,
|
lat:null,
|
||||||
scrollViewHeight:0,
|
pager:{limit:10,loading:false,loadAll:false,pageIndex:0,refreshTrigger:false},
|
||||||
pager:{limit:10,loading:false,loadAll:false,pageIndex:0,refreshTrigger:false}
|
|
||||||
|
choosedCommunity:{}
|
||||||
},
|
},
|
||||||
changeTab(event){
|
changeTab(event){
|
||||||
const tabIndex = event.currentTarget.dataset.index;
|
const tabIndex = event.currentTarget.dataset.index;
|
||||||
@ -42,18 +42,15 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
pager:this.data.pager
|
pager:this.data.pager
|
||||||
});
|
});
|
||||||
const cid = this.data.categories.length>0?this.data.categories[this.data.tabIndex].id:0;
|
|
||||||
const params = {
|
const params = {
|
||||||
skip:this.data.pager.pageIndex*this.data.pager.limit,
|
skip:this.data.pager.pageIndex*this.data.pager.limit,
|
||||||
limit:this.data.pager.limit
|
limit:this.data.pager.limit,
|
||||||
|
community_id:this.data.choosedCommunity.id
|
||||||
}
|
}
|
||||||
if(this.data.lng&&this.data.lat){
|
if(this.data.lng&&this.data.lat){
|
||||||
params.longitude = this.data.lng;
|
params.longitude = this.data.lng;
|
||||||
params.latitude = this.data.lat;
|
params.latitude = this.data.lat;
|
||||||
}
|
}
|
||||||
if(cid){
|
|
||||||
params.category_id = cid;
|
|
||||||
}
|
|
||||||
shopApi.product.list().then((data)=>{
|
shopApi.product.list().then((data)=>{
|
||||||
if(this.data.pager.pageIndex==0){
|
if(this.data.pager.pageIndex==0){
|
||||||
this.data.shopList = data.items;
|
this.data.shopList = data.items;
|
||||||
@ -80,35 +77,57 @@ Page({
|
|||||||
shopList:this.data.shopList,
|
shopList:this.data.shopList,
|
||||||
pager:this.data.pager
|
pager:this.data.pager
|
||||||
})
|
})
|
||||||
|
}).catch(()=>{
|
||||||
|
this.setData({
|
||||||
|
"pager.loading":false
|
||||||
|
})
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const windowInfo = wx.getWindowInfo();
|
|
||||||
this.setData({
|
|
||||||
scrollViewHeight:windowInfo.windowHeight-windowInfo.statusBarHeight-44-174
|
|
||||||
})
|
|
||||||
app.getLocation().then((data)=>{
|
|
||||||
this.setData({
|
|
||||||
lng:data.longitude,
|
|
||||||
lat:data.latitude
|
|
||||||
});
|
|
||||||
this.loadList();
|
|
||||||
}).catch(()=>{
|
|
||||||
this.loadList();
|
|
||||||
})
|
|
||||||
|
|
||||||
shopApi.category().then((data)=>{
|
|
||||||
this.setData({
|
|
||||||
categories:[{id:0,name:'全部'},...data.items]
|
|
||||||
});
|
|
||||||
})
|
|
||||||
app.getUserInfo().then((data)=>{
|
app.getUserInfo().then((data)=>{
|
||||||
this.setData({
|
this.setData({
|
||||||
userInfo:data
|
userInfo:data
|
||||||
})
|
})
|
||||||
|
this.data.choosedCommunity = {
|
||||||
|
id:data.community_id,
|
||||||
|
name:data.community_name
|
||||||
|
};
|
||||||
|
return wx.getStorage({key:'community-shop'});
|
||||||
|
}).then((res)=>{
|
||||||
|
this.data.choosedCommunity = res.data;
|
||||||
|
this.loadList();
|
||||||
|
},(error)=>{
|
||||||
|
this.loadList();
|
||||||
|
}).finally(()=>{
|
||||||
|
this.setData({
|
||||||
|
choosedCommunity:this.data.choosedCommunity
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//供选择社区页面用
|
||||||
|
changeCommunity(community){
|
||||||
|
wx.setStorage({
|
||||||
|
key:'community-shop',
|
||||||
|
data:{
|
||||||
|
id:community.id,
|
||||||
|
name:community.name
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.setData({
|
||||||
|
choosedCommunity:community
|
||||||
|
})
|
||||||
|
this.refreshList();
|
||||||
|
},
|
||||||
|
chooseCommunity(){
|
||||||
|
const currentId = this.data.choosedCommunity.id||this.data.userInfo.community_id;
|
||||||
|
console.log(currentId);
|
||||||
|
wx.navigateTo({
|
||||||
|
url: `/pages/help/community/index?communityId=${currentId}`,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -1,21 +1,13 @@
|
|||||||
<view class="custom-scroll-view">
|
<view class="custom-scroll-view">
|
||||||
<view>
|
<view>
|
||||||
<nav-bar/>
|
<nav-bar>
|
||||||
<view class="consume" url="/pages/my/money/index">
|
<view slot="left">
|
||||||
<view class="title">蜂蜜 (克)</view>
|
<view class="choose-community" bind:tap="chooseCommunity">
|
||||||
<view class="point">{{userInfo.points}}</view>
|
<view>{{choosedCommunity.name}}</view>
|
||||||
<view class="tips">取快递自动抵扣</view>
|
<image src="/assets/icon/help/arrow-down.png" class="icon"/>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="btns">
|
</view>
|
||||||
<button wx:for="{{categories}}" wx:key="index" class="item" size="mini"
|
</nav-bar>
|
||||||
bind:tap="changeTab" data-index="{{index}}" data-cid="{{item.id}}"
|
|
||||||
type="{{tabIndex==index?'primary':''}}">
|
|
||||||
{{item.name}}
|
|
||||||
</button>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
|
||||||
<view class="main-spliter">
|
|
||||||
<view class="center"></view>
|
|
||||||
</view>
|
</view>
|
||||||
<list-view class="main product-list" bind:refresh="refreshList" bind:loadMore="loadList"
|
<list-view class="main product-list" bind:refresh="refreshList" bind:loadMore="loadList"
|
||||||
refresher-triggered="{{pager.refreshTrigger}}"
|
refresher-triggered="{{pager.refreshTrigger}}"
|
||||||
|
|||||||
@ -1,46 +1,11 @@
|
|||||||
|
.choose-community{
|
||||||
.consume{
|
|
||||||
border-radius: 18rpx;
|
|
||||||
background: linear-gradient(270deg, #FFDB00 0%, #FFC300 60%);
|
|
||||||
box-shadow: 0px 6px 6px 0px rgba(0, 0, 0, 0.06);
|
|
||||||
margin:20rpx;
|
|
||||||
padding:34rpx 0 32rpx 30rpx;
|
|
||||||
position:relative;
|
|
||||||
}
|
|
||||||
.consume .title{
|
|
||||||
font-size: 34rpx;
|
|
||||||
}
|
|
||||||
.consume .point{
|
|
||||||
font-size: 70rpx;
|
|
||||||
margin-top:50rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
.consume .tips{
|
|
||||||
position:absolute;
|
|
||||||
right:0;top:32rpx;
|
|
||||||
border-radius: 60rpx 0 0 60rpx;
|
|
||||||
background-color: var(--main-color);
|
|
||||||
line-height: 40rpx;
|
|
||||||
font-size: 22rpx;
|
|
||||||
padding:0 12rpx 0 24rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btns{
|
|
||||||
display: flex;
|
display: flex;
|
||||||
margin:24rpx;
|
align-items: center;
|
||||||
gap: 16rpx;
|
padding: 10rpx 0;
|
||||||
}
|
}
|
||||||
.btns .item{
|
.choose-community .icon{
|
||||||
border-radius: 12rpx;
|
width:16rpx;height:10rpx;
|
||||||
font-size: 26rpx;
|
margin-left:12rpx;
|
||||||
margin:0;
|
|
||||||
padding:18rpx 34rpx;
|
|
||||||
line-height: 1;
|
|
||||||
min-width: 132rpx;
|
|
||||||
}
|
|
||||||
.btns .item:not([type=primary]){
|
|
||||||
background-color: #fff;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-list .item{
|
.product-list .item{
|
||||||
@ -100,23 +65,3 @@
|
|||||||
color:#FF8C12;
|
color:#FF8C12;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
.main-spliter::before{
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
border-bottom:1rpx solid #f5f5f5;
|
|
||||||
background-color: red;
|
|
||||||
}
|
|
||||||
.main-spliter .center{
|
|
||||||
padding:0 12rpx;
|
|
||||||
margin:0 auto;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
.main-spliter .center::before{
|
|
||||||
content:'业主参与';
|
|
||||||
border-radius: 25rpx;
|
|
||||||
font-size: 24rpx;
|
|
||||||
padding:13rpx 24rpx;
|
|
||||||
background-color: var(--main-bgclolor);
|
|
||||||
border: 1rpx solid rgba(153, 153, 153, 0.3);
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
@ -4,33 +4,5 @@
|
|||||||
"setting": {
|
"setting": {
|
||||||
"compileHotReLoad": true
|
"compileHotReLoad": true
|
||||||
},
|
},
|
||||||
"condition": {
|
|
||||||
"miniprogram": {
|
|
||||||
"list": [
|
|
||||||
{
|
|
||||||
"name": "pages/login/login",
|
|
||||||
"pathName": "pages/help/index/index",
|
|
||||||
"query": "shared_user_code=aaaa",
|
|
||||||
"launchMode": "default",
|
|
||||||
"scene": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "开发环境",
|
|
||||||
"pathName": "pages/help/index/index",
|
|
||||||
"query": "env=dev"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "测试环境",
|
|
||||||
"pathName": "pages/help/index/index",
|
|
||||||
"query": "env=test"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "生产环境",
|
|
||||||
"pathName": "pages/help/index/index",
|
|
||||||
"query": "env=prod"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"libVersion": "3.7.10"
|
"libVersion": "3.7.10"
|
||||||
}
|
}
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
const windowInfo = wx.getWindowInfo();
|
||||||
const formatTime = date => {
|
const formatTime = date => {
|
||||||
const year = date.getFullYear()
|
const year = date.getFullYear()
|
||||||
const month = date.getMonth() + 1
|
const month = date.getMonth() + 1
|
||||||
@ -14,11 +15,15 @@ const formatNumber = n => {
|
|||||||
return n[1] ? n : `0${n}`
|
return n[1] ? n : `0${n}`
|
||||||
}
|
}
|
||||||
const getStatusNavBarHeight = ()=>{
|
const getStatusNavBarHeight = ()=>{
|
||||||
const windowInfo = wx.getWindowInfo();
|
|
||||||
return windowInfo.statusBarHeight+44;
|
return windowInfo.statusBarHeight+44;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const rpxToPx = (rpx) => {
|
||||||
|
return (rpx / 750) * windowInfo.windowWidth;
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
formatTime,
|
formatTime,
|
||||||
getStatusNavBarHeight
|
getStatusNavBarHeight,
|
||||||
|
rpxToPx
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user