作者 李芳银

新增了定位

//app.js
import {
request
} from "./request/index.js"
var QQMapWX = require('./qqmap/qqmap-wx-jssdk.min.js');
var qqmapsdk;
App({
onLaunch: function () {
let t = this;
... ... @@ -11,7 +16,7 @@ App({
if (wx.canIUse('getUpdateManager')) {
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
console.log('onCheckForUpdate====', res)
// console.log('onCheckForUpdate====', res)
// 请求完新版本信息的回调
if (res.hasUpdate) {
console.log('res.hasUpdate====')
... ... @@ -42,12 +47,14 @@ App({
},
onShow: function (res) {
console.log(res);
qqmapsdk = new QQMapWX({
key: 'B4MBZ-3VICV-THBPQ-UCLHB-SLCEK-B7FIK'
});
this.getCitied()
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
... ... @@ -63,7 +70,6 @@ App({
success: res => {
// 可以将 res 发送给后台解码出 unionId
this.globalData.userInfo = res.userInfo
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if (this.userInfoReadyCallback) {
... ... @@ -75,7 +81,42 @@ App({
}
})
},
getCitied() { // 获取城市信息
let that = this
wx.getLocation({
type: 'wgs84', //默认为 wgs84 返回 gps 坐标,gcj02 返回可用于 wx.openLocation 的坐标 
success: function (res) {
qqmapsdk.reverseGeocoder({
//位置坐标,默认获取当前位置,非必须参数
//Object格式
location: {
latitude: res.latitude,
longitude: res.longitude
},
success: function (res) { //成功后的回调
console.log(res);
var res = res.result;
let city = res.ad_info.city
that.saveCity(city)
},
fail: function (error) {
console.error(error);
},
complete: function (res) {
// console.log(res);
}
})
},
fail: res => {
//如果用户点击了拒绝,就会走fail
// console.log("点击了拒绝,authorize--fail用户拒绝过");
// that.setData({
//     add: false
// })
}
})
return
},
tipsFun(item) {
wx.showToast({
title: item,
... ... @@ -83,7 +124,6 @@ App({
duration: 1300
})
},
popSuccessTest(msg) {
wx.showToast({
title: msg,
... ... @@ -142,6 +182,26 @@ App({
}
return mobile
},
async saveCity(city) {
let that = this
try {
const {
data: {
data
}
} = await request({
url: 'api/citys/getCity',
data: {
city: city
}
})
console.log(data, "全局城市定位");
that.globalData.city_glob_id = data.city_id
} catch (err) {
console.log(err);
that.popTest(err.msg)
}
},
globalData: {
userInfo: null,
... ... @@ -149,5 +209,6 @@ App({
imagesUrl: 'https://car.goorcar.com/',
statusHeight: 0,
stores_id: '', //进入4s店id
city_glob_id: '', // 城市定位
}
})
\ No newline at end of file
... ...
... ... @@ -121,6 +121,7 @@
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false
},
"tabBar": {
"color": "#8C9198",
"backgroundColor": "#fff",
... ... @@ -158,6 +159,12 @@
}
]
},
"style": "v2",
"sitemapLocation": "sitemap.json"
"sitemapLocation": "sitemap.json",
"permission":{
"scope.userLocation" :{
"desc":"车唛优选小程序请求获取您的位置信息"
}
}
}
\ No newline at end of file
... ...
... ... @@ -71,8 +71,6 @@ Page({
that.getProducts()
that.getNewcar()
}, 100);
},
goback() {
wx.navigateBack()
... ... @@ -106,13 +104,9 @@ Page({
})
that.popTest()
}
} catch (err) {
console.log(err);
that.setData({
msg: err.msg
})
that.popTest()
console.log(err, "出错了");
a.popTest(err.msg)
}
},
async getDecorations() { // 获取 s4店页面[头部数据
... ... @@ -146,11 +140,8 @@ Page({
})
} catch (err) {
console.log(err);
that.setData({
msg: err.msg
})
that.popTest()
console.log(err, "出错了");
a.popTest(err.msg)
}
},
... ... @@ -173,13 +164,9 @@ Page({
})
} catch (err) {
console.log(err);
that.setData({
msg: err.msg
})
that.popTest()
console.log(err, "出错了");
a.popTest(err.msg)
}
},
async getNewcar() { // 获取热销车型
let that = this
... ... @@ -228,11 +215,8 @@ Page({
})
} catch (err) {
console.log(err);
that.setData({
msg: err.msg
})
that.popTest()
console.log(err, "出错了");
a.popTest(err.msg)
}
},
... ... @@ -255,11 +239,8 @@ Page({
})
} catch (err) {
console.log(err);
that.setData({
msg: err.msg
})
that.popTest()
console.log(err, "出错了");
a.popTest(err.msg)
}
},
... ... @@ -279,11 +260,8 @@ Page({
})
} catch (err) {
console.log(err);
that.setData({
msg: err.msg
})
that.popTest()
console.log(err, "出错了");
a.popTest(err.msg)
}
},
... ... @@ -307,7 +285,7 @@ Page({
},
goSearch() {
wx.navigateTo({
url: '/pages/search/search'
url: '/pages/search/search?S4_num=1'
})
},
goVnewslist() {
... ... @@ -328,10 +306,7 @@ Page({
url: '/pages/VehicleList/VehicleList?id=' + s4_id
})
} else {
this.setData({
msg: '请登录后操作'
})
this.popTest()
a.popTest('请登录后操作')
}
},
hotProducts() { //热销车型
... ... @@ -346,10 +321,7 @@ Page({
})
} else {
this.setData({
msg: '请登录后操作'
})
this.popTest()
a.popTest('请登录后操作')
}
},
goReservation() {
... ... @@ -362,10 +334,7 @@ Page({
url: '/pages/upkeepImg/upkeepImg?type=2' + '&id=' + s4_id || that.data.s4_id
})
} else {
this.setData({
msg: '请登录后操作'
})
this.popMaskTest()
a.popTest('请登录后操作')
}
},
goAccessories() { // 精品配件
... ... @@ -377,10 +346,7 @@ Page({
url: '/pages/goAccessories/goAccessories?id=' + s4_id
})
} else {
this.setData({
msg: '请登录后操作'
})
this.popTest()
a.popTest('请登录后操作')
}
},
... ... @@ -394,10 +360,8 @@ Page({
url: '/pages/RecommendCar/RecommendCar?s4_id=' + s4_id
})
} else {
that.setData({
msg: '请登录后操作'
})
that.popTest()
a.popTest('请登录后操作')
}
},
... ...
... ... @@ -647,33 +647,7 @@ page {
font-weight: 600;
}
.store_guide_price {
display: flex;
align-items: center;
.item_suggest {
font-size: 24rpx;
line-height: 34rpx;
margin-right: 20rpx;
}
.imgs_downArrow {
height: 24rpx;
line-height: 34rpx;
display: flex;
align-items: center;
.imgs_down {
width: 33rpx;
height: 100%;
}
.item_you {
font-size: 24rpx;
color: #00C116;
}
}
}
}
.change {
... ... @@ -727,7 +701,7 @@ page {
.big_titles {
width: 100%;
padding: 5rpx 10rpx;
padding: 5rpx 10rpx 0;
box-sizing: border-box;
font-size: 28rpx;
color: #323233;
... ... @@ -739,6 +713,39 @@ page {
padding: 5rpx 10rpx;
box-sizing: border-box;
.store_guide_price {
width: 100%;
display: flex;
align-items: center;
.think_price {
font-size: 24rpx;
line-height: 34rpx;
margin-right: 10rpx;
color: #5b5e63;
}
.imgs_downArrow {
margin-top: 5rpx;
height: 24rpx;
line-height: 44rpx;
display: flex;
align-items: center;
flex-shrink: 0;
.imgs_down {
width: 33rpx;
height: 100%;
}
text {
font-size: 24rpx;
color: #00C116;
}
}
}
.store_price {
display: flex;
align-items: baseline;
... ... @@ -755,6 +762,8 @@ page {
font-weight: 600;
}
}
}
&:nth-child(2n+1) {
... ...
... ... @@ -138,7 +138,14 @@
<view class="pri_box">
<view class="store_price">
<view class="pt_icon">¥</view>
<view class="pt_price">{{item.begin_price}}万起</view>
<view class="pt_price">{{item.re_price}}</view>
</view>
<view class="store_guide_price">
<view class="think_price">指导价:{{item.think_price}}万元</view>
<view class="imgs_downArrow">
<image src="{{imagesUrl}}assets/static/img/downArrow.png" class="imgs_down" />
<text>{{item.down_price}}万</text>
</view>
</view>
</view>
</view>
... ...
... ... @@ -518,29 +518,6 @@ page {
color: #E8370F;
font-weight: 600;
}
.container .health .hot_stores .list_ .list_store .store_guide_price {
display: flex;
align-items: center;
}
.container .health .hot_stores .list_ .list_store .store_guide_price .item_suggest {
font-size: 24rpx;
line-height: 34rpx;
margin-right: 20rpx;
}
.container .health .hot_stores .list_ .list_store .store_guide_price .imgs_downArrow {
height: 24rpx;
line-height: 34rpx;
display: flex;
align-items: center;
}
.container .health .hot_stores .list_ .list_store .store_guide_price .imgs_downArrow .imgs_down {
width: 33rpx;
height: 100%;
}
.container .health .hot_stores .list_ .list_store .store_guide_price .imgs_downArrow .item_you {
font-size: 24rpx;
color: #00C116;
}
.container .health .hot_stores .list_ .change {
display: flex;
flex-direction: column;
... ... @@ -585,7 +562,7 @@ page {
}
.container .health .hot_stores .new_car .nv_item .big_titles {
width: 100%;
padding: 5rpx 10rpx;
padding: 5rpx 10rpx 0;
box-sizing: border-box;
font-size: 28rpx;
color: #323233;
... ... @@ -596,6 +573,33 @@ page {
padding: 5rpx 10rpx;
box-sizing: border-box;
}
.container .health .hot_stores .new_car .nv_item .pri_box .store_guide_price {
width: 100%;
display: flex;
align-items: center;
}
.container .health .hot_stores .new_car .nv_item .pri_box .store_guide_price .think_price {
font-size: 24rpx;
line-height: 34rpx;
margin-right: 10rpx;
color: #5b5e63;
}
.container .health .hot_stores .new_car .nv_item .pri_box .store_guide_price .imgs_downArrow {
margin-top: 5rpx;
height: 24rpx;
line-height: 44rpx;
display: flex;
align-items: center;
flex-shrink: 0;
}
.container .health .hot_stores .new_car .nv_item .pri_box .store_guide_price .imgs_downArrow .imgs_down {
width: 33rpx;
height: 100%;
}
.container .health .hot_stores .new_car .nv_item .pri_box .store_guide_price .imgs_downArrow text {
font-size: 24rpx;
color: #00C116;
}
.container .health .hot_stores .new_car .nv_item .pri_box .store_price {
display: flex;
align-items: baseline;
... ...
... ... @@ -117,10 +117,8 @@ Page({
MyGarage: data
})
} catch (err) {
this.setData({
msg: err.msg
})
this.popTest()
console.log(err);
a.popTest(err.msg)
}
},
goBind4Sdian() { //去绑定4s店
... ... @@ -241,17 +239,13 @@ Page({
id: id
}
}).then(res => {
let msg = res.data.msg
that.setData({
msg: msg
})
that.popSuccessTest()
that.getMyGarage()
a.popSuccessTest(res.data.msg)
setTimeout(() => {
that.getMyGarage()
}, 500);
}).catch(err => {
that.setData({
msg: res.data.data.msg
})
that.popTest()
console.log(err, "出错了");
a.popTest(err.msg)
})
} else {
... ...
... ... @@ -48,7 +48,7 @@
<view class="rt_item rt_two" catchtap="toEditor" data-id="{{item.che_id}}" wx:if="{{item.dui_id ==1}}">
编辑
</view>
<view class="rt_item rt_two" wx:if="{{item.dui_id ==1}}" catchtap="popConfirm" data-id="{{item.s4.id}}" data-arr="2">
<view class="rt_item rt_two" wx:if="{{item.dui_id ==1}}" catchtap="popConfirm" data-id="{{item.che_id}}" data-arr="2">
删除
</view>
<view class="rt_item rt_other" wx:if="{{garage==true}}">申请中</view>
... ...
... ... @@ -70,23 +70,7 @@ Page({
typeId: item.id
})
that.getMyorder()
// let warn = index + 1;
// switch (warn) {
// case 1:
// that.getMyorderA()
// break;
// case 2:
// that.getMyorderB()
// break;
// case 3:
// that.getMyorderC()
// break;
// case 4:
// that.getMyorderD()
// break;
// default:
// return;
// }
},
async getnavList() {
let that = this
... ... @@ -323,23 +307,6 @@ Page({
page: newpageNum
})
that.getMyorder()
// switch (way) {
// case 1:
// that.getMyorderA()
// break;
// case 2:
// that.getMyorderB()
// break;
// case 3:
// that.getMyorderC()
// break;
// case 4:
// that.getMyorderD()
// break;
// default:
// return;
// }
} else {
that.setData({
msg: '已经到底部了'
... ... @@ -373,6 +340,11 @@ Page({
url: '/pages/VSpikeMallDetail/VSpikeMallDetail?id=' + id
})
break;
case 5:
wx.navigateTo({
url: '/pages/carDetails/carDetails?id=' + id
})
break;
default:
return;
}
... ...
... ... @@ -206,6 +206,8 @@ page {
text-align: left;
color: #06121e;
line-height: 40rpx;
padding: 0rpx 10rpx;
box-sizing: border-box;
}
.cen_tite {
... ... @@ -281,6 +283,10 @@ page {
}
}
.new_padd {
padding: 5rpx 10rpx;
}
.cl_color {
width: 100%;
background: linear-gradient(90deg, #f02928, #fd7f2e);
... ... @@ -314,6 +320,64 @@ page {
right: -10rpx;
}
}
.pri_box {
width: 100%;
padding: 5rpx 10rpx;
box-sizing: border-box;
.store_guide_price {
width: 100%;
display: flex;
align-items: center;
.think_price {
font-size: 24rpx;
line-height: 34rpx;
margin-right: 10rpx;
color: #5b5e63;
}
.imgs_downArrow {
margin-top: 5rpx;
height: 24rpx;
line-height: 44rpx;
display: flex;
align-items: center;
flex-shrink: 0;
.imgs_down {
width: 33rpx;
height: 100%;
}
text {
font-size: 24rpx;
color: #00C116;
}
}
}
.store_price {
display: flex;
align-items: baseline;
.pt_icon {
font-size: 24rpx;
color: #E8370F;
font-weight: 600;
}
.pt_price {
font-size: 32rpx;
color: #E8370F;
font-weight: 600;
}
}
}
}
}
... ... @@ -351,6 +415,8 @@ page {
text-align: left;
color: #06121e;
line-height: 40rpx;
padding: 0rpx 10rpx;
box-sizing: border-box;
}
.cen_tite {
... ... @@ -427,6 +493,10 @@ page {
}
}
.new_padd {
padding: 5rpx 10rpx;
}
.cl_color {
width: 100%;
background: linear-gradient(90deg, #f02928, #fd7f2e);
... ... @@ -460,6 +530,64 @@ page {
right: -10rpx;
}
}
.pri_box {
width: 100%;
padding: 5rpx 10rpx;
box-sizing: border-box;
.store_guide_price {
width: 100%;
display: flex;
align-items: center;
.think_price {
font-size: 24rpx;
line-height: 34rpx;
margin-right: 10rpx;
color: #5b5e63;
}
.imgs_downArrow {
margin-top: 5rpx;
height: 24rpx;
line-height: 44rpx;
display: flex;
align-items: center;
flex-shrink: 0;
.imgs_down {
width: 33rpx;
height: 100%;
}
text {
font-size: 24rpx;
color: #00C116;
}
}
}
.store_price {
display: flex;
align-items: baseline;
.pt_icon {
font-size: 24rpx;
color: #E8370F;
font-weight: 600;
}
.pt_price {
font-size: 32rpx;
color: #E8370F;
font-weight: 600;
}
}
}
}
}
... ...
... ... @@ -44,16 +44,16 @@
<block wx:for="{{products}}" wx:key="index" wx:for-index="index" wx:for-item="item">
<view class='footbox' wx:if="{{index%2==0}}" bindtap="goDetail" data-id="{{item.goods_id}}">
<image class='cover' src="{{item.img}}" mode="widthFix"></image>
<view class="text_bx">
<view class="text_bx {{esl == 4?'new_padd':''}}">
<view class="ster_nams title_content2">{{item.goods_name}}</view>
<view class="cen_tite">
<view class="cen_tite" wx:if="{{esl!=4}}">
<view class="lis_title">{{item.shop_type}}</view>
<view class="stay">
<view class="numbe">{{item.sales_initial}}</view>
<view class="ber_name">位车友推荐</view>
</view>
</view>
<view class="price_bx">
<view class="price_bx" wx:if="{{esl!=4}}">
<view class="pt">
<view class="pt_icon">¥</view>
<view class="pt_price">{{item.price}}</view>
... ... @@ -67,6 +67,19 @@
</view>
<image src="{{imagesUrl}}assets/static/img/x_t.png" class="image_color" />
</view>
<view class="pri_box" wx:if="{{esl==4}}">
<view class="store_price">
<view class="pt_icon">¥</view>
<view class="pt_price">{{item.re_price}}</view>
</view>
<view class="store_guide_price">
<view class="think_price">指导价:{{item.think_price}}万元</view>
<view class="imgs_downArrow">
<image src="{{imagesUrl}}assets/static/img/downArrow.png" class="imgs_down" />
<text>{{item.down_price}}万</text>
</view>
</view>
</view>
</view>
</view>
</block>
... ... @@ -75,16 +88,16 @@
<block wx:for="{{products}}" wx:key="index" wx:for-index="index" wx:for-item="item">
<view class='footbox' wx:if="{{index%2==1}}" bindtap="goDetail" data-id="{{item.goods_id}}">
<image class='cover' src="{{item.img}}" mode="widthFix"></image>
<view class="text_bx">
<view class="ster_nams title_content2">{{item.goods_name}}</view>
<view class="cen_tite">
<view class="text_bx {{esl == 4?'new_padd':''}}">
<view class="ster_nams title_content2 ">{{item.goods_name}}</view>
<view class="cen_tite" wx:if="{{esl!=4}}">
<view class="lis_title">{{item.shop_type}}</view>
<view class="stay">
<view class="numbe">{{item.sales_initial}}</view>
<view class="ber_name">位车友推荐</view>
</view>
</view>
<view class="price_bx">
<view class="price_bx" wx:if="{{esl!=4}}">
<view class="pt">
<view class="pt_icon">¥</view>
<view class="pt_price">{{item.price}}</view>
... ... @@ -98,6 +111,19 @@
</view>
<image src="{{imagesUrl}}assets/static/img/x_t.png" class="image_color" />
</view>
<view class="pri_box" wx:if="{{esl==4}}">
<view class="store_price">
<view class="pt_icon">¥</view>
<view class="pt_price">{{item.re_price}}</view>
</view>
<view class="store_guide_price">
<view class="think_price">指导价:{{item.think_price}}万元</view>
<view class="imgs_downArrow">
<image src="{{imagesUrl}}assets/static/img/downArrow.png" class="imgs_down" />
<text>{{item.down_price}}万</text>
</view>
</view>
</view>
</view>
</view>
</block>
... ...
... ... @@ -172,6 +172,8 @@ page {
text-align: left;
color: #06121e;
line-height: 40rpx;
padding: 0rpx 10rpx;
box-sizing: border-box;
}
.container .health .list .footlist_a .foot_left_a .footbox .text_bx .cen_tite {
width: 100%;
... ... @@ -230,6 +232,9 @@ page {
color: #5B5E63;
text-decoration: line-through;
}
.container .health .list .footlist_a .foot_left_a .footbox .new_padd {
padding: 5rpx 10rpx;
}
.container .health .list .footlist_a .foot_left_a .footbox .cl_color {
width: 100%;
background: linear-gradient(90deg, #f02928, #fd7f2e);
... ... @@ -259,6 +264,52 @@ page {
top: -20rpx;
right: -10rpx;
}
.container .health .list .footlist_a .foot_left_a .footbox .pri_box {
width: 100%;
padding: 5rpx 10rpx;
box-sizing: border-box;
}
.container .health .list .footlist_a .foot_left_a .footbox .pri_box .store_guide_price {
width: 100%;
display: flex;
align-items: center;
}
.container .health .list .footlist_a .foot_left_a .footbox .pri_box .store_guide_price .think_price {
font-size: 24rpx;
line-height: 34rpx;
margin-right: 10rpx;
color: #5b5e63;
}
.container .health .list .footlist_a .foot_left_a .footbox .pri_box .store_guide_price .imgs_downArrow {
margin-top: 5rpx;
height: 24rpx;
line-height: 44rpx;
display: flex;
align-items: center;
flex-shrink: 0;
}
.container .health .list .footlist_a .foot_left_a .footbox .pri_box .store_guide_price .imgs_downArrow .imgs_down {
width: 33rpx;
height: 100%;
}
.container .health .list .footlist_a .foot_left_a .footbox .pri_box .store_guide_price .imgs_downArrow text {
font-size: 24rpx;
color: #00C116;
}
.container .health .list .footlist_a .foot_left_a .footbox .pri_box .store_price {
display: flex;
align-items: baseline;
}
.container .health .list .footlist_a .foot_left_a .footbox .pri_box .store_price .pt_icon {
font-size: 24rpx;
color: #E8370F;
font-weight: 600;
}
.container .health .list .footlist_a .foot_left_a .footbox .pri_box .store_price .pt_price {
font-size: 32rpx;
color: #E8370F;
font-weight: 600;
}
.container .health .list .footlist_a .foot_right_a {
float: left;
width: 50%;
... ... @@ -290,6 +341,8 @@ page {
text-align: left;
color: #06121e;
line-height: 40rpx;
padding: 0rpx 10rpx;
box-sizing: border-box;
}
.container .health .list .footlist_a .foot_right_a .footbox .text_bx .cen_tite {
width: 100%;
... ... @@ -348,6 +401,9 @@ page {
color: #5B5E63;
text-decoration: line-through;
}
.container .health .list .footlist_a .foot_right_a .footbox .new_padd {
padding: 5rpx 10rpx;
}
.container .health .list .footlist_a .foot_right_a .footbox .cl_color {
width: 100%;
background: linear-gradient(90deg, #f02928, #fd7f2e);
... ... @@ -377,6 +433,52 @@ page {
top: -20rpx;
right: -10rpx;
}
.container .health .list .footlist_a .foot_right_a .footbox .pri_box {
width: 100%;
padding: 5rpx 10rpx;
box-sizing: border-box;
}
.container .health .list .footlist_a .foot_right_a .footbox .pri_box .store_guide_price {
width: 100%;
display: flex;
align-items: center;
}
.container .health .list .footlist_a .foot_right_a .footbox .pri_box .store_guide_price .think_price {
font-size: 24rpx;
line-height: 34rpx;
margin-right: 10rpx;
color: #5b5e63;
}
.container .health .list .footlist_a .foot_right_a .footbox .pri_box .store_guide_price .imgs_downArrow {
margin-top: 5rpx;
height: 24rpx;
line-height: 44rpx;
display: flex;
align-items: center;
flex-shrink: 0;
}
.container .health .list .footlist_a .foot_right_a .footbox .pri_box .store_guide_price .imgs_downArrow .imgs_down {
width: 33rpx;
height: 100%;
}
.container .health .list .footlist_a .foot_right_a .footbox .pri_box .store_guide_price .imgs_downArrow text {
font-size: 24rpx;
color: #00C116;
}
.container .health .list .footlist_a .foot_right_a .footbox .pri_box .store_price {
display: flex;
align-items: baseline;
}
.container .health .list .footlist_a .foot_right_a .footbox .pri_box .store_price .pt_icon {
font-size: 24rpx;
color: #E8370F;
font-weight: 600;
}
.container .health .list .footlist_a .foot_right_a .footbox .pri_box .store_price .pt_price {
font-size: 32rpx;
color: #E8370F;
font-weight: 600;
}
.container .health .list .footlist_a::after {
content: '';
clear: both;
... ...
... ... @@ -195,8 +195,8 @@ Page({
},
// 更多
lookMoreList() {
lookMoreList() { // 更多
wx.navigateTo({
url: '/pages/searchList/searchList'
})
... ...
... ... @@ -17,25 +17,51 @@ Page({
kw: '',
city_id: '',
pin_id: '',
shortnameCity: '',
},
onLoad: function (options) {
let that = this
console.log(options);
that.setData({
kw: options.kw,
kw: options.kw || '',
searchValue: options.kw || '',
})
},
onShow: function () {
let that = this
if (that.data.city_id == '') {
that.setData({
city_id: a.globalData.city_glob_id
})
}
console.log(this.data.city_id);
that.getmoreList()
},
goback() {
wx.navigateBack()
},
async getDWcity() { //定位城市 没用了
let that = this;
try {
const {
data: {
data
}
} = await
request({
url: 'api/citys/dingWei',
})
console.log(data);
// that.setData({
// DWcity: data,
// shortnameCity: data.shortname
// })
// console.log(that.data.shortnameCity, "定位城市", that.data.DWcity);
} catch (err) {
console.log(err);
a.popTest(err.msg)
}
},
async getmoreList() { //获取
let that = this
try {
... ... @@ -67,14 +93,10 @@ Page({
city_id: data.city.id,
pin_id: data.pin.id,
pinName: data.pin.name,
})
} catch (err) {
console.log(err);
that.setData({
msg: err.msg
})
that.popTest()
a.popTest(err.msg)
}
},
async clickAttention(e) { //关注
... ... @@ -153,7 +175,6 @@ Page({
},
goCityList() {
wx.navigateTo({
// url: '/pages/cityList/cityList'
url: '/pages/homeNoLogin2/homeNoLogin2'
})
},
... ...
... ... @@ -318,7 +318,7 @@ Page({
},
goSearch() {
wx.navigateTo({
url: '/pages/search/search'
url: '/pages/search/search?S4_num=1'
})
},
goVnewslist() {
... ...
... ... @@ -678,55 +678,7 @@ page {
border-radius: 8rpx;
margin-bottom: 20rpx;
.list_store {
display: flex;
flex-direction: column;
.store_content {
margin-bottom: 20rpx;
.item_name {
font-size: 28rpx;
line-height: 40rpx;
font-weight: 600;
}
}
.store_price {
font-size: 32rpx;
line-height: 44rpx;
color: #E8370F;
font-weight: 600;
}
.store_guide_price {
display: flex;
align-items: center;
.item_suggest {
font-size: 24rpx;
line-height: 34rpx;
margin-right: 20rpx;
}
.imgs_downArrow {
height: 24rpx;
line-height: 34rpx;
display: flex;
align-items: center;
.imgs_down {
width: 33rpx;
height: 100%;
}
.item_you {
font-size: 24rpx;
color: #00C116;
}
}
}
}
.change {
display: flex;
... ... @@ -779,7 +731,7 @@ page {
.big_titles {
width: 100%;
padding: 5rpx 10rpx;
padding: 5rpx 10rpx 0;
box-sizing: border-box;
font-size: 28rpx;
color: #323233;
... ... @@ -807,6 +759,39 @@ page {
font-weight: 600;
}
}
.store_guide_price {
width: 100%;
display: flex;
align-items: center;
.think_price {
font-size: 24rpx;
line-height: 34rpx;
margin-right: 10rpx;
color: #5b5e63;
}
.imgs_downArrow {
margin-top: 5rpx;
height: 24rpx;
line-height: 44rpx;
display: flex;
align-items: center;
flex-shrink: 0;
.imgs_down {
width: 33rpx;
height: 100%;
}
text {
font-size: 24rpx;
color: #00C116;
}
}
}
}
&:nth-child(2n+1) {
... ...
... ... @@ -138,7 +138,14 @@
<view class="pri_box">
<view class="store_price">
<view class="pt_icon">¥</view>
<view class="pt_price">{{item.begin_price}}万起</view>
<view class="pt_price">{{item.re_price}}</view>
</view>
<view class="store_guide_price">
<view class="think_price">指导价:{{item.think_price}}万元</view>
<view class="imgs_downArrow">
<image src="{{imagesUrl}}assets/static/img/downArrow.png" class="imgs_down" />
<text>{{item.down_price}}万</text>
</view>
</view>
</view>
</view>
... ...
... ... @@ -502,47 +502,6 @@ page {
border-radius: 8rpx;
margin-bottom: 20rpx;
}
.container .health .hot_stores .list_ .list_store {
display: flex;
flex-direction: column;
}
.container .health .hot_stores .list_ .list_store .store_content {
margin-bottom: 20rpx;
}
.container .health .hot_stores .list_ .list_store .store_content .item_name {
font-size: 28rpx;
line-height: 40rpx;
font-weight: 600;
}
.container .health .hot_stores .list_ .list_store .store_price {
font-size: 32rpx;
line-height: 44rpx;
color: #E8370F;
font-weight: 600;
}
.container .health .hot_stores .list_ .list_store .store_guide_price {
display: flex;
align-items: center;
}
.container .health .hot_stores .list_ .list_store .store_guide_price .item_suggest {
font-size: 24rpx;
line-height: 34rpx;
margin-right: 20rpx;
}
.container .health .hot_stores .list_ .list_store .store_guide_price .imgs_downArrow {
height: 24rpx;
line-height: 34rpx;
display: flex;
align-items: center;
}
.container .health .hot_stores .list_ .list_store .store_guide_price .imgs_downArrow .imgs_down {
width: 33rpx;
height: 100%;
}
.container .health .hot_stores .list_ .list_store .store_guide_price .imgs_downArrow .item_you {
font-size: 24rpx;
color: #00C116;
}
.container .health .hot_stores .list_ .change {
display: flex;
flex-direction: column;
... ... @@ -587,7 +546,7 @@ page {
}
.container .health .hot_stores .new_car .nv_item .big_titles {
width: 100%;
padding: 5rpx 10rpx;
padding: 5rpx 10rpx 0;
box-sizing: border-box;
font-size: 28rpx;
color: #323233;
... ... @@ -612,6 +571,33 @@ page {
color: #E8370F;
font-weight: 600;
}
.container .health .hot_stores .new_car .nv_item .pri_box .store_guide_price {
width: 100%;
display: flex;
align-items: center;
}
.container .health .hot_stores .new_car .nv_item .pri_box .store_guide_price .think_price {
font-size: 24rpx;
line-height: 34rpx;
margin-right: 10rpx;
color: #5b5e63;
}
.container .health .hot_stores .new_car .nv_item .pri_box .store_guide_price .imgs_downArrow {
margin-top: 5rpx;
height: 24rpx;
line-height: 44rpx;
display: flex;
align-items: center;
flex-shrink: 0;
}
.container .health .hot_stores .new_car .nv_item .pri_box .store_guide_price .imgs_downArrow .imgs_down {
width: 33rpx;
height: 100%;
}
.container .health .hot_stores .new_car .nv_item .pri_box .store_guide_price .imgs_downArrow text {
font-size: 24rpx;
color: #00C116;
}
.container .health .hot_stores .new_car .nv_item:nth-child(2n+1) {
margin-right: 24rpx;
}
... ...
... ... @@ -117,4 +117,5 @@ Page({
})
\ No newline at end of file
... ...
... ... @@ -16,7 +16,7 @@
<view class="title_content2 card_text">{{detailsContent.name}}</view>
<view class="zan_price">
<text class="money_icon">¥</text>
<text class="price_big">{{detailsContent.begin_price}}万起</text>
<text class="price_big">{{detailsContent.re_price}}</text>
</view>
</view>
<view class="imgbtns">
... ...
import {
request
} from "../../request/index.js"
} from "../../request/index.js";
var QQMapWX = require('../../qqmap/qqmap-wx-jssdk.min.js');
var qqmapsdk;
const a = getApp()
Page({
data: {
... ... @@ -30,25 +32,76 @@ Page({
nobindCar: false,
goodDetal: {},
index4S: [],
city_id: '',
},
onLoad: function (options) {
let that = this
console.log(options);
that.setData({
// order_id: options.order_id,
})
qqmapsdk = new QQMapWX({
key: 'B4MBZ-3VICV-THBPQ-UCLHB-SLCEK-B7FIK'
});
},
onShow: function () {
let that = this
console.log(a.globalData.stores_id, "a.globalData.stores_id");
that.gethomeIndex()
that.gethomeLoop()
that.getStarModel()
that.getSuccessPage()
that.getS4Info()
that.getgood3List()
that.getindexUser()
that.getCitied()
},
getCitied() { // 获取城市信息
let that = this
wx.getLocation({
type: 'wgs84', //默认为 wgs84 返回 gps 坐标,gcj02 返回可用于 wx.openLocation 的坐标 
success: function (res) {
qqmapsdk.reverseGeocoder({
//位置坐标,默认获取当前位置,非必须参数
//Object格式
location: {
latitude: res.latitude,
longitude: res.longitude
},
success: function (res) { //成功后的回调
console.log(res);
var res = res.result;
let city = res.ad_info.city
that.saveCity(city)
},
fail: function (error) {
console.error(error);
},
complete: function (res) {
// console.log(res);
}
})
},
fail: res => {}
})
return
},
async saveCity(city) {
let that = this
try {
const {
data: {
data
}
} = await request({
url: 'api/citys/getCity',
data: {
city: city
}
})
console.log(data, "首页全局城市定位");
that.setData({
city_id: data.city_id
})
that.getSuccessPage()
} catch (err) {
console.log(err);
that.popTest(err.msg)
}
},
gohome() {
wx.switchTab({
... ... @@ -87,7 +140,7 @@ Page({
that.goLogin()
}
},
async getgood3List() { // 获取跳3个商品详情
async getSuccessPage() { // 获取推荐
let that = this
try {
const {
... ... @@ -95,31 +148,10 @@ Page({
data
}
} = await request({
url: 'api/shop4s2/img3',
})
console.log(data);
that.setData({
goodDetal: data
})
} catch (err) {
console.log(err);
that.setData({
msg: err.msg
})
that.popTest()
}
},
async getSuccessPage() { // 获取推荐
let that = this
try {
const {
url: 'api/index2/tuiList2',
data: {
data
city_id: that.data.city_id
}
} = await request({
url: 'api/index2/tuiList',
})
console.log(data);
that.setData({
... ... @@ -270,18 +302,12 @@ Page({
} = await request({
url: 'api/index2/indexUnder',
})
console.log(data);
console.log(data, "4SD店列表");
that.setData({
index4S: data
})
} catch (err) {
console.log(err);
that.setData({
msg: err.msg
})
// that.popTest()
if (err.code == 0) {
that.setData({
bind_car: 0,
... ... @@ -565,6 +591,64 @@ Page({
return shareObj;
},
toGoDetailA(e) {
let that = this
let idata = e.currentTarget.dataset.idata
let jump = idata.jump_type
let good_type = Number(idata.good_type1)
let good_id = idata.good1_id
that.publicDetails(jump, good_type, good_id)
},
toGoDetailB(e) {
let that = this
let idata = e.currentTarget.dataset.idata
let jump = idata.jump_type
let good_type = Number(idata.good_type2)
let good_id = idata.good2_id
that.publicDetails(jump, good_type, good_id)
},
toGoDetailC(e) {
let that = this
let idata = e.currentTarget.dataset.idata
let jump = idata.jump_type
let good_type = Number(idata.good_type3)
let good_id = idata.good3_id
that.publicDetails(jump, good_type, good_id)
},
publicDetails(jump, good_type, good_id) {
if (jump == 1) { //可以跳转
switch (good_type) {
case 1: // 人气好物
wx.navigateTo({
url: '/pages/detail/detail?id=' + good_id
})
break;
case 2: // 精选推荐
wx.navigateTo({
url: '/pages/productdetailsImg/productdetailsImg?id=' + good_id
})
break;
case 3: // 团购热卖
wx.navigateTo({
url: '/pages/VtuanDetail/VtuanDetail?id' + good_id
})
break;
case 4: //限时抢购
wx.navigateTo({
url: '/pages/VSpikeMallDetail/VSpikeMallDetail?id=' + good_id
})
break;
case 5: //车型商品
wx.navigateTo({
url: '/pages/carDetails/carDetails?id=' + good_id
})
break;
default:
break;
}
}
},
... ...
... ... @@ -547,7 +547,7 @@ page {
&::after {
content: '';
position: absolute;
top: 32rpx;
top: 36rpx;
left: 0;
width: 4rpx;
height: 30rpx;
... ...
... ... @@ -169,14 +169,14 @@
<view class="week_hot">
<view class="star_name">本周特卖</view>
<view class="week_box">
<view class="left_big" catchtap="goV4Sstores" data-id="{{item.s4_data.id}}" data-tir="0">
<view class="left_big" catchtap="toGoDetailA" data-idata="{{item.img_data}}" data-tir="0">
<image src="{{item.img_data.image1}}" />
</view>
<view class="rt_box">
<view class="ry_top" catchtap="goV4Sstores" data-id="{{item.s4_data.id}}" data-tir="1">
<view class="ry_top" catchtap="toGoDetailB" data-idata="{{item.img_data}}" data-tir="1">
<image src="{{item.img_data.image2}}" />
</view>
<view class="ry_down" catchtap="goV4Sstores" data-id="{{item.s4_data.id}}" data-tir="2">
<view class="ry_down" catchtap="toGoDetailC" data-idata="{{item.img_data}}" data-tir="2">
<image src="{{item.img_data.image3}}" />
</view>
</view>
... ...
... ... @@ -437,7 +437,7 @@ page {
.container .health .center_nav .bind_nm .bind_box .you_bind .s_bind_box .star_Car .star_name::after {
content: '';
position: absolute;
top: 32rpx;
top: 36rpx;
left: 0;
width: 4rpx;
height: 30rpx;
... ...
import {
request
} from '../../request/index.js'
var QQMapWX = require('../../qqmap/qqmap-wx-jssdk.min.js');
var qqmapsdk;
const a = getApp()
Page({
data: {
... ... @@ -9,121 +11,7 @@ Page({
letter: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"],
cityListId: '',
//下面是城市列表信息,这里只是模拟数据
citylist: [{
"letter": "A",
"data": [{
"id": "v7",
"cityName": "安徽"
}]
}, {
"letter": "B",
"data": [{
"id": "v10",
"cityName": "巴中"
}, {
"id": "v4",
"cityName": "包头"
}, {
"id": "v1",
"cityName": "北京"
}]
}, {
"letter": "C",
"data": [{
"id": "v15",
"cityName": "成都"
}]
}, {
"letter": "D",
"data": [{
"id": "v21",
"cityName": "稻城"
}]
}, {
"letter": "G",
"data": [{
"id": "v17",
"cityName": "广州"
}, {
"id": "v29",
"cityName": "桂林"
}]
}, {
"letter": "H",
"data": [{
"id": "v9",
"cityName": "海南"
}, {
"id": "v3",
"cityName": "呼和浩特"
}]
}, {
"letter": "L",
"data": [{
"id": "v24",
"cityName": "洛阳"
}, {
"id": "v20",
"cityName": "拉萨"
}, {
"id": "v14",
"cityName": "丽江"
}]
}, {
"letter": "M",
"data": [{
"id": "v13",
"cityName": "眉山"
}]
}, {
"letter": "N",
"data": [{
"id": "v27",
"cityName": "南京"
}]
}, {
"letter": "S",
"data": [{
"id": "v18",
"cityName": "三亚"
}, {
"id": "v2",
"cityName": "上海"
}]
}, {
"letter": "T",
"data": [{
"id": "v5",
"cityName": "天津"
}]
}, {
"letter": "W",
"data": [{
"id": "v12",
"cityName": "乌鲁木齐"
}, {
"id": "v25",
"cityName": "武汉"
}]
}, {
"letter": "X",
"data": [{
"id": "v23",
"cityName": "西安"
}, {
"id": "v28",
"cityName": "香港"
}, {
"id": "v19",
"cityName": "厦门"
}]
}, {
"letter": "Z",
"data": [{
"id": "v8",
"cityName": "张家口"
}]
}],
citylist: [],
//下面是热门城市数据,模拟数据
newcity: ['北京', '上海', '广州', '深圳', '成都', '杭州'],
// citySel: '全国',
... ... @@ -131,17 +19,21 @@ Page({
hotCity: [],
cityInput: [],
letterCITY: [],
DingWei: '', // 推荐定位
DWcity: '', // 定位城市
kw: '',
city_id: ''
city_id: '',
dwcity_name: '',
dwcity: '',
},
onLoad() {
qqmapsdk = new QQMapWX({
key: 'B4MBZ-3VICV-THBPQ-UCLHB-SLCEK-B7FIK'
});
},
onShow() {
this.getPromotion()
this.getletter()
this.getDingWei()
this.getDWcity()
console.log(getApp());
// this.getDingWei()
this.getCitied()
let that = this,
cityOrTime = wx.getStorageSync('locatecity') || {},
time = new Date().getTime(),
... ... @@ -153,8 +45,6 @@ Page({
locateCity: cityOrTime.city
})
}
},
async getPromotion() { // 获取热门城市
let that = this;
... ... @@ -204,29 +94,37 @@ Page({
that.popMaskTest()
}
},
async getDWcity() { //定位城市
let that = this;
try {
const {
data: {
data
}
} = await
request({
url: 'api/citys/dingWei',
})
that.setData({
DWcity: data
})
console.log(that.data.DWcity, "定位城市");
} catch (err) {
console.log(err);
that.setData({
msg: err.msg
})
that.popMaskTest()
}
getCitied() { // 获取城市信息
let that = this
wx.getLocation({
type: 'wgs84', //默认为 wgs84 返回 gps 坐标,gcj02 返回可用于 wx.openLocation 的坐标 
success: function (res) {
qqmapsdk.reverseGeocoder({
//位置坐标,默认获取当前位置,非必须参数
//Object格式
location: {
latitude: res.latitude,
longitude: res.longitude
},
success: function (res) { //成功后的回调
console.log(res);
var res = res.result;
that.setData({
dwcity: res.ad_info.city,
dwcity_name: res.ad_info.province
})
},
fail: function (error) {
console.error(error);
},
complete: function (res) {
// console.log(res);
}
})
},
fail: res => {}
})
return
},
async getletter() { // 获取城市a-z
let that = this;
... ...
... ... @@ -2,7 +2,7 @@
<view class='city_left'>
<scroll-view scroll-y style='width:100%;height:100%;' scroll-with-animation scroll-into-view='{{cityListId}}'>
<view class="cityname">
<view class="address_tj">{{DWcity.shortname}}</view>
<view class="address_tj">{{dwcity}}</view>
<view class="search">
<image src="{{imagesUrl}}assets/static/img/searchone.png"></image>
<input type="text" placeholder="请输入搜索的城市" value="{{searchValue}}" name="input" bindfocus="userNameInput"></input>
... ... @@ -11,7 +11,7 @@
<view class="ci">
<view class="dingwei">
<image src="{{imagesUrl}}assets/static/img/icon_address@2.png" />
<text class="cityDW0">{{DingWei.name}}</text>
<text class="cityDW0">{{dwcity_name}}</text>
</view>
<view class="tjcs">推荐位置</view>
</view>
... ...
... ... @@ -33,7 +33,8 @@ Page({
shengItem: '',
CarBrandName: '',
color: 1,
Address: {}
Address: {},
scene: '',
},
... ... @@ -47,6 +48,7 @@ Page({
scene: options.scene
})
that.getShengSu()
that.setGuanzhu()
} else {
that.popConfirm()
}
... ... @@ -511,5 +513,23 @@ Page({
})
}.bind(this), 100)
},
async setGuanzhu() { // 设置关注
let that = this;
try {
const {
data
} = await
request({
url: 'api/index2/saoGuan',
data: {
id: that.data.scene
}
})
console.log(data, "设置关注");
} catch (err) {
console.log(err, "出错了");
a.popTest(err.msg)
}
},
})
\ No newline at end of file
... ...
... ... @@ -277,11 +277,7 @@ Page({
that.hideModal()
}).catch(err => {
console.log(err);
that.setData({
msg: err.msg
})
that.popSuccessTest()
a.popTest(err.msg)
})
}
... ...
// pages/search/search.js
const app = getApp()
import {
request
} from "../../request/index.js"
... ... @@ -21,31 +19,40 @@ Page({
onShow: function () {
let that = this
let token = wx.getStorageSync('token')
setTimeout(() => {
if (token) {
if (token) {
if (that.data.S4_num == '') {
that.getList()
} else {
that.setData({
content: "您尚未登录,请登录后操作"
})
that.popConfirm()
}
}, 1300);
} else {
that.popConfirm() // 未登录
}
},
onLoad: function (options) {
console.log(options);
this.setData({
S4_num: options.S4_num || ''
S4_num: options.S4_num || '' // 首页进来传递的值 其他页面没有
})
},
openHistorySearch() {
this.setData({
searchRecord: wx.getStorageSync('searchRecord') || []
})
async getList() { // 获取搜索记录
let that = this
try {
const {
data: {
data
}
} = await request({
url: 'api/shop/souLog',
})
console.log(data, "搜索历史");
that.setData({
searchRecord: data
})
} catch (err) {
console.log(err);
a.popTest(err.msg)
}
},
// 删除
async delClear() {
async delClear() { // 删除
let that = this
try {
const {
... ... @@ -54,38 +61,25 @@ Page({
url: 'api/shop/delSou'
})
console.log(data);
that.setData({
msg: data.msg,
searchRecord: []
})
that.popMaskTest()
a.popSuccessTest(data.msg)
setTimeout(() => {
that.getList()
}, 1000);
} catch (err) {
console.log(err);
that.setData({
msg: err.msg
})
that.popMaskTest()
a.popTest(err.msg)
}
},
// 获取input内容
getInput(e) {
getInput(e) { // 获取input内容
this.setData({
searchValue: e.detail.value
})
},
// 点击搜索按钮
async searchInput() {
async searchInput() { // 点击搜索按钮
let that = this;
if (that.data.searchValue != '') {
if (that.data.S4_num == 1) {
console.log(that.data.searchValue, "that.data.searchValue");
if (that.data.S4_num == 1) { // 首页进来的
wx.navigateTo({
url: '/pages/Vmore4SList/Vmore4SList?kw=' + that.data.searchValue
})
... ... @@ -94,78 +88,11 @@ Page({
url: '/pages/searchList/searchList?kw=' + that.data.searchValue + '&change=1'
})
}
that.setData({
page: 1,
list: [],
searchValue: '',
})
} else {
that.setData({
msg: '请输入搜索内容'
})
that.popMaskTest()
}
},
//点击搜索按钮提交表单跳转并储存历史记录
async searchSubmitFn(e) {
console.log(e, "输入框数据");
let that = this
let searchRecord = that.data.searchRecord || []
let inputVal = e.detail.value
if (inputVal == '') {
//输入为空时的处理
that.setData({
messageAlert: "您未输入内容请输入搜索信息",
showDialog: !this.data.showDialog
})
} else {
if (searchRecord.length < 5) {
searchRecord.unshift({
value: inputVal,
id: searchRecord.length
})
} else {
searchRecord.pop() //删掉旧的时间最早的第一条
searchRecord.unshift({
value: inputVal,
id: searchRecord.length
})
}
this.setData({
searchRecord: searchRecord,
searchValue: ''
})
wx.setStorageSync('searchRecord', searchRecord)
const {
data: {
data
}
} = await request({
url: 'api/shop/sou',
data: {
kw: inputVal,
page: that.data.page,
time_id: 2,
price_id: 2
}
})
console.log(data);
if (data.length > 0) {
that.setData({
list: data
})
} else {
that.setData({
msg: '没有找到与' + '"' + inputVal + '"' + '相关的结果'
})
that.popMaskTest()
}
a.popTest('请输入搜索内容')
}
},
popMaskTest() {
... ... @@ -177,11 +104,8 @@ Page({
//如果有透明蒙层,弹窗的期间不能点击文档内容
})
},
// 点击搜索历史进行搜索
toSearch(e) {
toSearch(e) { // 点击搜索历史进行搜索
let that = this;
console.log(e);
let kw = e.currentTarget.dataset.value
if (that.data.S4_num == 1) {
wx.navigateTo({
... ... @@ -192,37 +116,10 @@ Page({
url: '/pages/searchList/searchList?kw=' + kw + '&change=1'
})
}
that.setData({
searchValue: ''
})
},
// 获取搜索记录
getList() {
let that = this
request({
url: 'api/shop/souLog',
})
.then(res => {
if (res.data.data.length > 0) {
that.setData({
searchRecord: res.data.data
})
console.log(this.data.searchRecord, res.data.data, "搜索")
} else {
that.setData({
msg: '暂无搜索记录'
})
that.popTest()
}
}).catch(err => {
console.log(err);
that.setData({
msg: err.msg
})
that.popTest()
})
},
popTest() {
wx.showToast({
title: this.data.msg,
... ... @@ -233,7 +130,7 @@ Page({
popConfirm() {
wx.showModal({
title: '提示',
content: this.data.content,
content: '您尚未登录,请登录后操作',
success: function (res) {
if (res.confirm) {
console.log('点击确认回调')
... ... @@ -246,31 +143,4 @@ Page({
}
})
},
history() {
//将搜索值放入历史记录中,只能放前五条this.data
request({
// url: 'api/shop/sou',
data: {
kw: inputVal
}
})
.then(res => {
console.log(res);
this.setData({
searchRecord: res.data.data
})
console.log(that.data.searchRecord, "搜索")
}).catch(err => {
console.log(err);
})
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
page {
width: 100%;
height: 100%;
background: #f9f9f9;
}
.container {
width: 100%;
height: 100%;
border-top: 2rpx solid #F9F9F9;
.search_box {
width: 100%;
height: 108rpx;
display: flex;
align-items: center;
padding: 10rpx 0 10rpx 32rpx;
box-sizing: border-box;
background-color: #fff;
.search {
flex: 1;
background-color: #f9f9f9;
border-radius: 15rpx;
position: relative;
height: 68rpx;
input {
font-size: 28rpx;
height: 68rpx;
width: 100%;
padding-left: 52rpx;
box-sizing: border-box;
}
image {
width: 32rpx;
height: 32rpx;
position: absolute;
top: 50%;
left: 10rpx;
transform: translateY(-50%);
}
}
.search_btn {
height: 88rpx;
color: #E8370F;
font-weight: 600;
display: flex;
align-items: center;
justify-content: center;
background-color: transparent;
}
button {
padding: 8rpx 8rpx !important;
}
}
.his_box {
width: 100%;
padding: 28rpx 32rpx;
box-sizing: border-box;
.search_history {
width: 100%;
display: flex;
align-items: center;
height: 68rpx;
.his_name {
font-size: 34rpx;
font-weight: 600;
color: #323233;
text-align: left;
flex: 1;
}
image {
width: 48rpx;
height: 48rpx;
}
}
.search_num {
width: 100%;
margin-top: 20rpx;
.muim {
width: 100%;
display: flex;
align-items: center;
flex-wrap: wrap;
margin-bottom: 16rpx;
.itemValue {
padding: 10rpx 28rpx;
background-color: #fff;
border-radius: 4rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #323233;
margin-right: 16rpx;
}
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -7,14 +7,18 @@
<view class="search_btn" style="width:150rpx!important" bindtap='searchInput'>搜索</view>
</view>
<!-- 搜索历史 -->
<view class="search_history">
<text>搜索历史</text>
<image src="{{imagesUrl}}assets/static/img/shanchu_icon@2x.png" bindtap="delClear"></image>
</view>
<!-- 数据列 -->
<view class="search_num">
<view wx:if="{{searchRecord.length > 0}}" wx:for="{{searchRecord}}" wx:key="this" bindtap="toSearch" data-value="{{item.kw}}" class="itemValue">
{{item.kw}}
<view class="his_box">
<view class="search_history" wx:if="{{S4_num ==''}}">
<view class="his_name">搜索历史</view>
<image src="{{imagesUrl}}assets/static/img/shanchu_icon@2x.png" bindtap="delClear"></image>
</view>
<!-- 数据列 -->
<view class="search_num" wx:if="{{S4_num ==''}}">
<view class="muim" wx:if="{{searchRecord.length !=0}}">
<block wx:for="{{searchRecord}}" wx:key="index" wx:for-index="index" wx:for-item="item">
<view bindtap="toSearch" data-value="{{item.kw}}" class="itemValue">{{item.kw}}</view>
</block>
</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
page {
width: 100%;
height: 100%;
background: #f9f9f9;
}
.container {
padding: 20rpx 32rpx;
width: 100%;
height: 100%;
border-top: 2rpx solid #F9F9F9;
}
.search_box {
display: block;
margin-top: 15rpx;
.container .search_box {
width: 100%;
height: 70rpx;
height: 108rpx;
display: flex;
align-items: center;
padding: 10rpx 0 10rpx 32rpx;
box-sizing: border-box;
background-color: #fff;
}
.search {
width: 78%;
.container .search_box .search {
flex: 1;
background-color: #f9f9f9;
border-radius: 15rpx;
display: flex;
justify-content: center;
align-items: center;
float: left;
position: relative;
height: 68rpx;
}
.search_box input {
text-indent: 15rpx;
.container .search_box .search input {
font-size: 28rpx;
height: 70rpx;
line-height: 70rpx;
height: 68rpx;
width: 100%;
padding-left: 52rpx;
box-sizing: border-box;
}
.search_box image {
margin-left: 20rpx;
width: 31rpx;
height: 31rpx;
.container .search_box .search image {
width: 32rpx;
height: 32rpx;
position: absolute;
top: 50%;
left: 10rpx;
transform: translateY(-50%);
}
.search_box .search_btn {
float: right;
height: 70rpx;
.container .search_box .search_btn {
height: 88rpx;
color: #E8370F;
font-weight: 700;
background-color: transparent;
font-weight: 600;
display: flex;
align-items: center;
justify-content: center;
background-color: transparent;
}
button {
.container .search_box button {
padding: 8rpx 8rpx !important;
}
/* 搜索历史 */
.search_history {
.container .his_box {
width: 100%;
padding: 28rpx 32rpx;
box-sizing: border-box;
}
.container .his_box .search_history {
width: 100%;
height: 80rpx;
margin: 50rpx 0 30rpx 0;
display: flex;
position: relative;
align-items: center;
height: 68rpx;
}
.search_history text {
width: 500rpx;
height: 60rpx;
.container .his_box .search_history .his_name {
font-size: 34rpx;
font-weight: 600;
line-height: 40px;
color: rgba(6, 18, 30, 1);
color: #323233;
text-align: left;
flex: 1;
}
.search_history image {
position: absolute;
top: 30rpx;
right: 20rpx;
width: 32rpx;
height: 32rpx;
.container .his_box .search_history image {
width: 48rpx;
height: 48rpx;
}
/* 搜索列 */
.history_box {
.container .his_box .search_num {
width: 100%;
height: 60rpx;
display: flex;
}
.history {
font-size: 24rpx;
padding: 15rpx 30rpx;
box-sizing: border-box;
text-align: center;
background-color: #EEEEEE;
margin: 0 20rpx;
margin-top: 20rpx;
}
.history_1 {
width: 204rpx;
margin-left: 0;
}
.history_2 {
width: 160rpx;
}
.history_3 {
width: 120rpx;
}
.search_num {
.container .his_box .search_num .muim {
width: 100%;
display: flex;
align-items: center;
flex-wrap: wrap;
margin-bottom: 16rpx;
}
.itemValue {
font-size: 28rpx;
color: #000;
padding: 10rpx 32rpx;
.container .his_box .search_num .muim .itemValue {
padding: 10rpx 28rpx;
background-color: #fff;
border-radius: 4rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #323233;
margin-right: 16rpx;
}
/* 弹窗 */
.zan-dialog__mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 10;
background: rgba(0, 0, 0, 0);
background: rgba(0, 0, 0, 0.4);
display: none;
}
.zan-dialog__container {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
width: 80%;
height: 100px;
text-align: center;
line-height: 50px;
background: #f8f8f8;
transform: translateY(300%);
transition: all 0.4s ease;
z-index: 12;
border-radius: 20rpx;
/* box-shadow: 0px 3px 3px 2px gainsboro; */
}
.zan-dialog--show .zan-dialog__container {
transform: translateY(0);
}
.zan-dialog--show .zan-dialog__mask {
display: block;
}
\ No newline at end of file
... ...
// pages/searchList/searchList.js
import {
request
} from "../../request/index.js"
... ... @@ -21,29 +20,11 @@ Page({
loading: false, //加载动画的显示
all: 0,
total: '',
pageNum: 1
pageNum: 1,
nomore: false
},
onShow: function () {
this.getSearchStoreList()
// setTimeout(() => {
// //方法调用的方式触发下拉刷新事件
// wx.startPullDownRefresh()
// }, 1000)
},
// onPullDownRefresh: function () {
// var that = this;
// that.setData({
// page: 1
// })
// // wx.startPullDownRefresh()
// //定时两秒结束
// setTimeout(function () {
// wx.stopPullDownRefresh()
// }, 2000)
// },
onShow: function () {},
onLoad: function (options) {
let that = this
console.log(options);
... ... @@ -51,30 +32,31 @@ Page({
kw: options.kw || ''
})
wx.stopPullDownRefresh() //刷新完成后停止下拉刷新动效
that.getSearch()
},
onReachBottom: function () {
onReachBottom() {
var that = this;
if (that.data.total > that.data.searchStoreList.length) {
let pageNum = that.data.pageNum
if (that.data.searchStoreList.length < that.data.total) {
pageNum++
that.setData({
pageNum: this.data.pageNum + 1
pageNum,
nomore: false
})
that.getSearchStoreList()
} else if (that.data.total == that.data.searchStoreList.length) {
that.getSearch()
} else {
that.setData({
msg: '已到底部了',
nomore: true
})
this.popTest()
}
},
getInput(e) {
this.setData({
searchValue: e.detail.value
})
},
async getSearchStoreList(e) { // 获取搜索
async getSearch(e) { // 获取搜索
let that = this;
console.log(e);
if (e) {
that.setData({
kw: e.detail.value.input ? e.detail.value.input : e.detail.value,
... ... @@ -97,14 +79,13 @@ Page({
time_id: that.data.time_id,
kw: that.data.kw,
page: that.data.pageNum
}
})
console.log(data);
if (data.data.length > 0) {
if (data.data.length != 0) {
that.setData({
total: data.total,
searchStoreList: that.data.searchStoreList.concat(data.data),
searchStoreList: [...that.data.searchStoreList, ...data.data],
})
wx.hideLoading()
} else {
... ... @@ -113,73 +94,63 @@ Page({
msg: '没有找到与' + '"' + that.data.kw + '"' + '相关的结果',
kw: '',
})
this.popTest()
a.popTest()
wx.hideLoading()
} else {
that.setData({
msg: '暂无数据',
})
this.popTest()
a.popTest('暂无数据')
wx.hideLoading()
}
}
} catch (err) {
console.log(err);
a.popTest(err.msg)
}
},
topTime() { //上架时间
let that = this
let time_id = that.data.time_id
let price_id = that.data.price_id
console.log(time_id);
if (time_id == 2) {
that.setData({
time_id: 1,
page: 1,
searchStoreList: []
})
that.getSearchStoreList()
that.getSearch()
} else {
console.log(time_id);
that.setData({
time_id: 2,
page: 1,
searchStoreList: []
})
console.log(that.data.time_id);
that.getSearchStoreList()
that.getSearch()
}
},
topPrice() { // 价格
let that = this
let price_id = that.data.price_id
console.log(price_id);
if (that.data.price_id == '') {
if (price_id == '') {
that.setData({
price_id: 1,
page: 1,
searchStoreList: []
})
that.getSearchStoreList()
} else if (that.data.price_id == 1) {
that.getSearch()
} else if (price_id == 1) {
that.setData({
price_id: 2,
page: 1,
searchStoreList: []
})
that.getSearchStoreList()
} else if (that.data.price_id == 2) {
that.getSearch()
} else if (price_id == 2) {
that.setData({
price_id: 1,
page: 1,
searchStoreList: []
})
that.getSearchStoreList()
that.getSearch()
}
},
storeDetail(e) {
console.log(e, "普通商品详情");
... ... @@ -202,13 +173,7 @@ Page({
showDialog: !this.data.showDialog
})
},
popTest() {
wx.showToast({
title: this.data.msg,
icon: 'none', //如果要纯文本,不要icon,将值设为'none'
duration: 2000
})
},
... ...
page {
width: 100%;
height: 100%;
background: #f9f9f9;
}
.container {
width: 100%;
height: 100%;
.search_bot {
width: 100%;
height: 100%;
.search_box {
width: 100%;
height: 88rpx;
display: flex;
align-items: center;
padding: 10rpx 0 10rpx 32rpx;
box-sizing: border-box;
background-color: #fff;
.search {
flex: 1;
background-color: #f9f9f9;
border-radius: 15rpx;
position: relative;
height: 68rpx;
input {
font-size: 28rpx;
height: 68rpx;
width: 100%;
padding-left: 52rpx;
box-sizing: border-box;
}
image {
width: 32rpx;
height: 32rpx;
position: absolute;
top: 50%;
left: 10rpx;
transform: translateY(-50%);
}
}
.search_btn {
height: 88rpx;
color: #E8370F;
font-weight: 600;
display: flex;
align-items: center;
justify-content: center;
background-color: transparent;
}
button {
padding: 8rpx 8rpx !important;
}
}
/* 上架时间 */
.putaway_title {
width: 100%;
height: 88rpx;
border-bottom: 1rpx solid #EEEEEE;
display: flex;
background-color: #fff;
align-items: center;
.putaway_time {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
border-right: 1rpx solid #eee;
.time_name {
font-size: 32rpx;
color: #323233;
margin-right: 8rpx;
}
.sanjiao {
width: 32rpx;
height: 32rpx;
image {
width: 100%;
}
}
&:last-child {
border: 0 none;
}
}
}
.store_list {
width: 100%;
padding: 0 14rpx 0;
box-sizing: border-box;
.list_masonry_a {
width: 100%;
.footlist_a {
position: relative;
border-top-left-radius: 10rpx;
border-top-right-radius: 10rpx;
.foot_left_a {
float: left;
width: 50%;
padding: 24rpx 14rpx;
box-sizing: border-box;
.footbox {
width: 100%;
margin: 0 auto 20rpx;
background: #fff;
position: relative;
border-radius: 20rpx;
image {
width: 100%;
border-top-left-radius: 10rpx;
border-top-right-radius: 10rpx;
}
.text_bx {
width: 100%;
padding: 0 18rpx 20rpx;
box-sizing: border-box;
.ster_nams {
width: 100%;
font-size: 28rpx;
font-family: PingFang SC,
PingFang SC-Regular;
font-weight: 400;
text-align: left;
color: #06121e;
line-height: 40rpx;
}
.cen_tite {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 0;
box-sizing: border-box;
.lis_title {
padding: 5rpx 14rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 22rpx;
color: #fff;
background-color: #F02928;
border-radius: 4rpx;
}
.stay {
display: flex;
align-items: center;
justify-content: flex-end;
.numbe {
font-size: 22rpx;
color: #E8370F;
}
.ber_name {
font-size: 22rpx;
color: #06121E;
}
}
}
.price_bx {
width: 100%;
display: flex;
align-items: center;
.pt {
display: flex;
align-items: baseline;
.pt_icon {
font-size: 22rpx;
color: #FF4444;
font-weight: 500;
}
.pt_price {
font-size: 28rpx;
color: #FF4444;
font-weight: 500;
}
}
.del {
margin-left: 30rpx;
font-size: 24rpx;
color: #5B5E63;
text-decoration: line-through;
}
}
}
}
}
.foot_right_a {
float: left;
width: 50%;
padding: 24rpx 14rpx;
box-sizing: border-box;
.footbox {
width: 100%;
margin: 0 auto 20rpx;
background: #fff;
position: relative;
border-radius: 20rpx;
image {
width: 100%;
border-top-left-radius: 10rpx;
border-top-right-radius: 10rpx;
}
.text_bx {
width: 100%;
padding: 0 18rpx 20rpx;
box-sizing: border-box;
.ster_nams {
width: 100%;
font-size: 28rpx;
font-family: PingFang SC,
PingFang SC-Regular;
font-weight: 400;
text-align: left;
color: #06121e;
line-height: 40rpx;
}
.cen_tite {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 0;
box-sizing: border-box;
.lis_title {
padding: 5rpx 14rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 22rpx;
color: #fff;
background-color: #F02928;
border-radius: 4rpx;
}
.stay {
display: flex;
align-items: center;
justify-content: flex-end;
.numbe {
font-size: 22rpx;
color: #E8370F;
}
.ber_name {
font-size: 22rpx;
color: #06121E;
}
}
}
.price_bx {
width: 100%;
display: flex;
align-items: center;
.pt {
display: flex;
align-items: baseline;
.pt_icon {
font-size: 22rpx;
color: #FF4444;
font-weight: 500;
}
.pt_price {
font-size: 28rpx;
color: #FF4444;
font-weight: 500;
}
}
.del {
margin-left: 30rpx;
font-size: 24rpx;
color: #5B5E63;
text-decoration: line-through;
}
}
}
}
}
&::after {
content: '';
clear: both;
display: block;
}
}
}
}
}
}
\ No newline at end of file
... ...
<view class="container">
<form class="search_box" bindsubmit='getSearchStoreList'>
<view class="search_bot">
<form bindsubmit='getSearchStoreList'>
<view class="search_box">
<view class="search">
<image src="{{imagesUrl}}assets/static/img/searchone.png"></image>
<input type="text" placeholder="请输入搜索内容" value="{{kw}}" confirm-type="search" bindconfirm="getSearchStoreList" name="input"></input>
<image src="{{imagesUrl}}assets/static/img/searchone.png"></image>
<input type="text" placeholder="请输入搜索内容" value="{{kw}}" confirm-type="search" bindconfirm="getSearchStoreList" name="input"></input>
</view>
<button class="search_btn" style="width:150rpx!important" formType='submit'>搜索</button>
</view>
</form>
<!-- 上架时间 putaway 价格 -->
<view class="putaway_title">
<view class="putaway_time" bindtap="topTime">
<text>上架时间</text>
<view class="sanjiao">
<image src="{{imagesUrl}}assets/static/img/downsanjiao.png"></image>
</view>
<view class="putaway_time" bindtap="topTime">
<view class="time_name">上架时间</view>
<view class="sanjiao">
<image src="{{imagesUrl}}assets/static/img/downsanjiao.png"></image>
</view>
<view class="price" bindtap="topPrice">
<text>价格</text>
<view class="sanjiao">
<image src="{{imagesUrl}}assets/static/img/downsanjiao.png"></image>
</view>
</view>
<view class="putaway_time" bindtap="topPrice">
<view class="time_name">价格</view>
<view class="sanjiao">
<image src="{{imagesUrl}}assets/static/img/downsanjiao.png"></image>
</view>
</view>
</view>
<view wx:for="{{searchStoreList}}" wx:key="*this" wx:for-item="item">
<view wx:if="{{item.img !=''}}" class="like_list" bindtap="storeDetail" data-num="1" data-id="{{item.goods_id}}">
<view class="list_left">
<image src="{{item.img}}"></image>
</view>
<view class="list_right">
<text class="list_right_content">{{item.goods_name}}</text>
<view class="newzeng">
<view class="status_change">{{item.shop_type}}</view>
<view class="rit_text">
<text class="numPer">{{item.sales_initial}}</text>
<text class="numperson">位车友推荐</text>
<view class="store_list">
<view class='list_masonry_a'>
<view class='footlist_a'>
<view class="foot_left_a">
<block wx:for="{{searchStoreList}}" wx:key="index" wx:for-index="index" wx:for-item="item">
<view class='footbox' wx:if="{{index%2==0}}" bindtap="goDeailItem" data-goods_id="{{item.goods_id}}">
<image class='cover' src="{{item.img}}" mode="widthFix"></image>
<view class="text_bx">
<view class="ster_nams title_content2">{{item.goods_name}}</view>
<view class="cen_tite">
<view class="lis_title">{{item.shop_type}}</view>
<view class="stay">
<view class="numbe">{{item.sales_initial}}</view>
<view class="ber_name">位车友推荐</view>
</view>
</view>
<view class="list_right_box">
<view class="zan_price">
<text class="icon_name">现价:</text>
<text class="money_icon">¥</text>
<text class="price_big">{{item.price}}</text>
</view>
<view class="del">
<text class="money_icon_">¥</text>
<text class="del_price_">{{item.line_price}}</text>
</view>
</view>
</view>
</view>
<view class="like_list_1" wx:else bindtap="storeDetail" data-id="{{item.goods_id}}" data-num="2">
<text class="title_content2">{{item.goods_name}}</text>
<view class="down_next">
<view class="newzeng">
<view class="status_change">{{item.shop_type}}</view>
<view class="rit_text">
<text class="numPer">{{item.sales_initial}}</text>
<text class="numperson">位车友推荐</text>
</view>
<view class="price_bx">
<view class="pt">
<view class="pt_icon">¥</view>
<view class="pt_price">{{item.price}}</view>
</view>
<view class="del">¥{{item.line_price}}</view>
</view>
</view>
<view class="price_dP_">
<view class="zan_price_">
<text class="icon_name_">现价:</text>
<text class="money_icon_">¥</text>
<text class="price_big_">{{item.price}}</text>
</view>
</block>
</view>
<view class="foot_right_a">
<block wx:for="{{searchStoreList}}" wx:key="index" wx:for-index="index" wx:for-item="item">
<view class='footbox' wx:if="{{index%2==1}}" bindtap="goDeailItem" data-goods_id="{{item.goods_id}}">
<image class='cover' src="{{item.img}}" mode="widthFix"></image>
<view class="text_bx">
<view class="ster_nams title_content2">{{item.goods_name}}</view>
<view class="cen_tite">
<view class="lis_title">{{item.shop_type}}</view>
<view class="stay">
<view class="numbe">{{item.sales_initial}}</view>
<view class="ber_name">位车友推荐</view>
</view>
<view class="del">
<text class="money_icon_">¥</text>
<text class="del_price_">{{item.line_price}}</text>
</view>
<view class="price_bx">
<view class="pt">
<view class="pt_icon">¥</view>
<view class="pt_price">{{item.price}}</view>
</view>
<view class="del">¥{{item.line_price}}</view>
</view>
</view>
</view>
</view>
</block>
</view>
</view>
<view class="down_test" wx:if="{{nomore}}">没有更多数据了哦~~</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
page {
width: 100%;
height: 100%;
background: #f9f9f9;
}
.container {
padding: 20rpx;
width: 100%;
height: 100%;
}
.search_box {
display: block;
margin-top: 15rpx;
.container .search_bot {
width: 100%;
height: 70rpx;
/* display: flex; */
height: 100%;
/* 上架时间 */
}
.search {
width: 78%;
background-color: #f9f9f9;
border-radius: 15rpx;
.container .search_bot .search_box {
width: 100%;
height: 88rpx;
display: flex;
justify-content: center;
align-items: center;
float: left;
padding: 10rpx 0 10rpx 32rpx;
box-sizing: border-box;
background-color: #fff;
}
.search_box input {
text-indent: 15rpx;
.container .search_bot .search_box .search {
flex: 1;
background-color: #f9f9f9;
border-radius: 15rpx;
position: relative;
height: 68rpx;
}
.container .search_bot .search_box .search input {
font-size: 28rpx;
height: 70rpx;
line-height: 70rpx;
height: 68rpx;
width: 100%;
padding-left: 52rpx;
box-sizing: border-box;
}
.container .search_bot .search_box .search image {
width: 32rpx;
height: 32rpx;
position: absolute;
top: 50%;
left: 10rpx;
transform: translateY(-50%);
}
.search_box image {
margin-left: 20rpx;
width: 31rpx;
height: 31rpx;
}
.search_box .search_btn {
float: right;
/* flex: 1; */
height: 70rpx;
.container .search_bot .search_box .search_btn {
height: 88rpx;
color: #E8370F;
font-weight: 700;
font-weight: 600;
display: flex;
align-items: center;
justify-content: center;
background-color: transparent;
}
button {
.container .search_bot .search_box button {
padding: 8rpx 8rpx !important;
}
/* 上架时间 */
.putaway_title {
.container .search_bot .putaway_title {
width: 100%;
height: 100rpx;
height: 88rpx;
border-bottom: 1rpx solid #EEEEEE;
display: flex;
background-color: #fff;
align-items: center;
}
.putaway_title .putaway_time {
.container .search_bot .putaway_title .putaway_time {
flex: 1;
height: 100%;
text-align: center;
position: relative;
display: flex;
align-items: center;
justify-content: center;
border-right: 1rpx solid #eee;
}
.putaway_title .putaway_time text {
.container .search_bot .putaway_title .putaway_time .time_name {
font-size: 32rpx;
width: 50%;
line-height: 100rpx;
color: #323233;
margin-right: 8rpx;
}
.putaway_title .putaway_time .sanjiao {
.container .search_bot .putaway_title .putaway_time .sanjiao {
width: 32rpx;
height: 32rpx;
position: absolute;
top: 35rpx;
left: 250rpx;
}
.putaway_title .price {
flex: 1;
text-align: center;
height: 100%;
position: relative;
.container .search_bot .putaway_title .putaway_time .sanjiao image {
width: 100%;
}
.putaway_title .price text {
font-size: 32rpx;
width: 50%;
line-height: 100rpx;
.container .search_bot .putaway_title .putaway_time:last-child {
border: 0 none;
}
.putaway_title .price .sanjiao {
width: 32rpx;
height: 32rpx;
position: absolute;
top: 35rpx;
left: 220rpx;
.container .search_bot .store_list {
width: 100%;
padding: 0 14rpx 0;
box-sizing: border-box;
}
/* 列表 */
.like_list {
.container .search_bot .store_list .list_masonry_a {
width: 100%;
height: 100%;
display: flex;
padding: 30rpx 0;
}
.container .search_bot .store_list .list_masonry_a .footlist_a {
position: relative;
border-top-left-radius: 10rpx;
border-top-right-radius: 10rpx;
}
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_left_a {
float: left;
width: 50%;
padding: 24rpx 14rpx;
box-sizing: border-box;
border-bottom: 1rpx solid #F2F2F2;
}
.like_list .list_left {
width: 208rpx;
height: 208rpx;
flex: 0 0 auto;
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_left_a .footbox {
width: 100%;
margin: 0 auto 20rpx;
background: #fff;
position: relative;
border-radius: 20rpx;
}
.like_list .list_left image {
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_left_a .footbox image {
width: 100%;
height: 100%;
border-top-left-radius: 10rpx;
border-top-right-radius: 10rpx;
}
.like_list .list_right {
padding-left: 40rpx;
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_left_a .footbox .text_bx {
width: 100%;
padding: 0 18rpx 20rpx;
box-sizing: border-box;
flex: 1;
height: 208rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.like_list .list_right .list_right_content {
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_left_a .footbox .text_bx .ster_nams {
width: 100%;
font-size: 28rpx;
line-height: 38rpx;
height: 82rpx;
color: #06121f;
display: -webkit-box;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
}
.like_list .list_right .newzeng {
font-family: PingFang SC, PingFang SC-Regular;
font-weight: 400;
text-align: left;
color: #06121e;
line-height: 40rpx;
}
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_left_a .footbox .text_bx .cen_tite {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 0;
box-sizing: border-box;
}
.like_list .list_right .newzeng .status_change {
padding: 5rpx 10rpx;
color: #E8370F;
border: 1rpx solid #E8370F;
font-size: 24rpx;
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_left_a .footbox .text_bx .cen_tite .lis_title {
padding: 5rpx 14rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 22rpx;
color: #fff;
background-color: #F02928;
border-radius: 4rpx;
}
.like_list .list_right .newzeng .rit_text {
margin-left: 30rpx;
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_left_a .footbox .text_bx .cen_tite .stay {
display: flex;
align-items: center;
justify-content: flex-end;
}
.like_list .list_right .newzeng .rit_text .numPer {
color: #FF444B;
font-size: 24rpx;
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_left_a .footbox .text_bx .cen_tite .stay .numbe {
font-size: 22rpx;
color: #E8370F;
}
.like_list .list_right .newzeng .rit_text .numperson {
font-size: 24rpx;
color: #8C9198;
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_left_a .footbox .text_bx .cen_tite .stay .ber_name {
font-size: 22rpx;
color: #06121E;
}
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_left_a .footbox .text_bx .price_bx {
width: 100%;
display: flex;
align-items: center;
}
.like_list .list_right .list_right_box {
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_left_a .footbox .text_bx .price_bx .pt {
display: flex;
align-items: baseline;
}
.like_list .list_right .list_right_box .del {
margin-left: 30rpx;
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_left_a .footbox .text_bx .price_bx .pt .pt_icon {
font-size: 22rpx;
color: #FF4444;
font-weight: 500;
}
.like_list .list_right .list_right_box .del .money_icon_ {
font-size: 20rpx;
line-height: 42rpx;
color: #8C9198;
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_left_a .footbox .text_bx .price_bx .pt .pt_price {
font-size: 28rpx;
color: #FF4444;
font-weight: 500;
}
.like_list .list_right .list_right_box .del .del_price_ {
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_left_a .footbox .text_bx .price_bx .del {
margin-left: 30rpx;
font-size: 24rpx;
color: #8C9198;
color: #5B5E63;
text-decoration: line-through;
}
.like_list .list_right .list_right_box .zan_price {
display: flex;
align-items: baseline;
line-height: 55rpx;
font-weight: bold;
justify-content: space-between;
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_right_a {
float: left;
width: 50%;
padding: 24rpx 14rpx;
box-sizing: border-box;
}
.like_list .list_right .list_right_box .zan_price .icon_name {
font-size: 28rpx;
color: #FF444B;
}
.like_list .list_right .list_right_box .zan_price .money_icon {
margin-left: 10rpx;
font-size: 20rpx;
line-height: 42rpx;
color: #FF444B;
}
.like_list .list_right .list_right_box .zan_price .price_big {
color: #FF444B;
font-size: 32rpx;
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_right_a .footbox {
width: 100%;
margin: 0 auto 20rpx;
background: #fff;
position: relative;
border-radius: 20rpx;
}
/* 没图片的样式 */
.like_list_1 {
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_right_a .footbox image {
width: 100%;
height: 100%;
padding: 20rpx 0 10rpx;
border-top-left-radius: 10rpx;
border-top-right-radius: 10rpx;
}
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_right_a .footbox .text_bx {
width: 100%;
padding: 0 18rpx 20rpx;
box-sizing: border-box;
border-bottom: 1rpx solid #F2F2F2;
display: flex;
justify-content: space-between;
flex-direction: column;
}
.like_list_1 .down_next .newzeng {
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_right_a .footbox .text_bx .ster_nams {
width: 100%;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC-Regular;
font-weight: 400;
text-align: left;
color: #06121e;
line-height: 40rpx;
}
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_right_a .footbox .text_bx .cen_tite {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 0;
box-sizing: border-box;
}
.like_list_1 .down_next .newzeng .status_change {
padding: 5rpx 10rpx;
color: #E8370F;
border: 1rpx solid #E8370F;
font-size: 24rpx;
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_right_a .footbox .text_bx .cen_tite .lis_title {
padding: 5rpx 14rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 22rpx;
color: #fff;
background-color: #F02928;
border-radius: 4rpx;
}
.like_list_1 .down_next .newzeng .rit_text {
margin-left: 30rpx;
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_right_a .footbox .text_bx .cen_tite .stay {
display: flex;
align-items: center;
justify-content: flex-end;
}
.like_list_1 .down_next .newzeng .rit_text .numPer {
color: #FF444B;
font-size: 24rpx;
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_right_a .footbox .text_bx .cen_tite .stay .numbe {
font-size: 22rpx;
color: #E8370F;
}
.like_list_1 .down_next .newzeng .rit_text .numperson {
font-size: 24rpx;
color: #8C9198;
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_right_a .footbox .text_bx .cen_tite .stay .ber_name {
font-size: 22rpx;
color: #06121E;
}
.like_list_1 .down_next .price_dP_ {
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_right_a .footbox .text_bx .price_bx {
width: 100%;
display: flex;
line-height: 55rpx;
align-items: center;
}
.like_list_1 .down_next .price_dP_ .zan_price_ {
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_right_a .footbox .text_bx .price_bx .pt {
display: flex;
font-weight: bold;
}
.like_list_1 .down_next .price_dP_ .zan_price_ .icon_name_ {
font-size: 28rpx;
color: #FF444B;
}
.like_list_1 .down_next .price_dP_ .zan_price_ .money_icon_ {
margin-left: 10rpx;
font-size: 20rpx;
line-height: 61rpx;
color: #FF444B;
}
.like_list_1 .down_next .price_dP_ .zan_price_ .price_big_ {
color: #FF444B;
font-size: 32rpx;
align-items: baseline;
}
.like_list_1 .down_next .price_dP_ .del {
display: flex;
align-self: baseline;
margin-left: 40rpx;
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_right_a .footbox .text_bx .price_bx .pt .pt_icon {
font-size: 22rpx;
color: #FF4444;
font-weight: 500;
}
.like_list_1 .down_next .price_dP_ .del .money_icon_ {
font-size: 20rpx;
color: #8C9198;
line-height: 55rpx;
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_right_a .footbox .text_bx .price_bx .pt .pt_price {
font-size: 28rpx;
color: #FF4444;
font-weight: 500;
}
.like_list_1 .down_next .price_dP_ .del .del_price_ {
.container .search_bot .store_list .list_masonry_a .footlist_a .foot_right_a .footbox .text_bx .price_bx .del {
margin-left: 30rpx;
font-size: 24rpx;
color: #8C9198;
color: #5B5E63;
text-decoration: line-through;
}
\ No newline at end of file
}
.container .search_bot .store_list .list_masonry_a .footlist_a::after {
content: '';
clear: both;
display: block;
}
... ...
... ... @@ -39,10 +39,6 @@ Page({
},
onLoad: function (options) {
let that = this
console.log(options);
that.setData({
// order_id: options.order_id,
})
that.getStores()
that.getitemCate()
that.getStarModel()
... ... @@ -418,6 +414,15 @@ Page({
url: '/pages/productdetailsImg/productdetailsImg?id=' + jump_id
})
},
onShareAppMessage(options) {
var that = this;
var shareObj = {
title: "车唛优选",
path: '/pages/stores/index',
imageUrl: '',
};
return shareObj;
},
... ...
... ... @@ -169,6 +169,18 @@
{
"name": "pages/V4Sstores/V4Sstores",
"pathName": "pages/V4Sstores/V4Sstores",
"query": "",
"scene": null
},
{
"name": "pages/stores/index",
"pathName": "pages/stores/index",
"query": "",
"scene": null
},
{
"name": "pages/searchList/searchList",
"pathName": "pages/searchList/searchList",
"scene": null
}
]
... ...
var _createClass=function(){function a(e,c){for(var b=0;b<c.length;b++){var d=c[b];d.enumerable=d.enumerable||false;d.configurable=true;if("value" in d){d.writable=true}Object.defineProperty(e,d.key,d)}}return function(d,b,c){if(b){a(d.prototype,b)}if(c){a(d,c)}return d}}();function _classCallCheck(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}var ERROR_CONF={KEY_ERR:311,KEY_ERR_MSG:"key格式错误",PARAM_ERR:310,PARAM_ERR_MSG:"请求参数信息有误",SYSTEM_ERR:600,SYSTEM_ERR_MSG:"系统错误",WX_ERR_CODE:1000,WX_OK_CODE:200};var BASE_URL="https://apis.map.qq.com/ws/";var URL_SEARCH=BASE_URL+"place/v1/search";var URL_SUGGESTION=BASE_URL+"place/v1/suggestion";var URL_GET_GEOCODER=BASE_URL+"geocoder/v1/";var URL_CITY_LIST=BASE_URL+"district/v1/list";var URL_AREA_LIST=BASE_URL+"district/v1/getchildren";var URL_DISTANCE=BASE_URL+"distance/v1/";var Utils={location2query:function location2query(c){if(typeof c=="string"){return c}var b="";for(var a=0;a<c.length;a++){var e=c[a];if(!!b){b+=";"}if(e.location){b=b+e.location.lat+","+e.location.lng}if(e.latitude&&e.longitude){b=b+e.latitude+","+e.longitude}}return b},getWXLocation:function getWXLocation(c,b,a){wx.getLocation({type:"gcj02",success:c,fail:b,complete:a})},getLocationParam:function getLocationParam(b){if(typeof b=="string"){var a=b.split(",");if(a.length===2){b={latitude:b.split(",")[0],longitude:b.split(",")[1]}}else{b={}}}return b},polyfillParam:function polyfillParam(a){a.success=a.success||function(){};a.fail=a.fail||function(){};a.complete=a.complete||function(){}},checkParamKeyEmpty:function checkParamKeyEmpty(c,b){if(!c[b]){var a=this.buildErrorConfig(ERROR_CONF.PARAM_ERR,ERROR_CONF.PARAM_ERR_MSG+b+"参数格式有误");c.fail(a);c.complete(a);return true}return false},checkKeyword:function checkKeyword(a){return !this.checkParamKeyEmpty(a,"keyword")},checkLocation:function checkLocation(c){var a=this.getLocationParam(c.location);if(!a||!a.latitude||!a.longitude){var b=this.buildErrorConfig(ERROR_CONF.PARAM_ERR,ERROR_CONF.PARAM_ERR_MSG+" location参数格式有误");c.fail(b);c.complete(b);return false}return true},buildErrorConfig:function buildErrorConfig(a,b){return{status:a,message:b}},buildWxRequestConfig:function buildWxRequestConfig(c,a){var b=this;a.header={"content-type":"application/json"};a.method="GET";a.success=function(d){var e=d.data;if(e.status===0){c.success(e)}else{c.fail(e)}};a.fail=function(d){d.statusCode=ERROR_CONF.WX_ERR_CODE;c.fail(b.buildErrorConfig(ERROR_CONF.WX_ERR_CODE,result.errMsg))};a.complete=function(d){var e=+d.statusCode;switch(e){case ERROR_CONF.WX_ERR_CODE:c.complete(b.buildErrorConfig(ERROR_CONF.WX_ERR_CODE,d.errMsg));break;case ERROR_CONF.WX_OK_CODE:var f=d.data;if(f.status===0){c.complete(f)}else{c.complete(b.buildErrorConfig(f.status,f.message))}break;default:c.complete(b.buildErrorConfig(ERROR_CONF.SYSTEM_ERR,ERROR_CONF.SYSTEM_ERR_MSG))}};return a},locationProcess:function locationProcess(f,e,c,a){var d=this;c=c||function(g){g.statusCode=ERROR_CONF.WX_ERR_CODE;f.fail(d.buildErrorConfig(ERROR_CONF.WX_ERR_CODE,g.errMsg))};a=a||function(g){if(g.statusCode==ERROR_CONF.WX_ERR_CODE){f.complete(d.buildErrorConfig(ERROR_CONF.WX_ERR_CODE,g.errMsg))}};if(!f.location){d.getWXLocation(e,c,a)}else{if(d.checkLocation(f)){var b=Utils.getLocationParam(f.location);e(b)}}}};var QQMapWX=function(){function b(i){_classCallCheck(this,b);if(!i.key){throw Error("key值不能为空")}this.key=i.key}_createClass(b,[{key:"search",value:function f(i){var l=this;i=i||{};Utils.polyfillParam(i);if(!Utils.checkKeyword(i)){return}var k={keyword:i.keyword,orderby:i.orderby||"_distance",page_size:i.page_size||10,page_index:i.page_index||1,output:"json",key:l.key};if(i.address_format){k.address_format=i.address_format}if(i.filter){k.filter=i.filter}var n=i.distance||"1000";var j=i.auto_extend||1;var m=function m(o){k.boundary="nearby("+o.latitude+","+o.longitude+","+n+","+j+")";wx.request(Utils.buildWxRequestConfig(i,{url:URL_SEARCH,data:k}))};Utils.locationProcess(i,m)}},{key:"getSuggestion",value:function h(i){var k=this;i=i||{};Utils.polyfillParam(i);if(!Utils.checkKeyword(i)){return}var j={keyword:i.keyword,region:i.region||"全国",region_fix:i.region_fix||0,policy:i.policy||0,output:"json",key:k.key};wx.request(Utils.buildWxRequestConfig(i,{url:URL_SUGGESTION,data:j}))}},{key:"reverseGeocoder",value:function a(i){var k=this;i=i||{};Utils.polyfillParam(i);var j={coord_type:i.coord_type||5,get_poi:i.get_poi||0,output:"json",key:k.key};if(i.poi_options){j.poi_options=i.poi_options}var l=function l(m){j.location=m.latitude+","+m.longitude;wx.request(Utils.buildWxRequestConfig(i,{url:URL_GET_GEOCODER,data:j}))};Utils.locationProcess(i,l)}},{key:"geocoder",value:function g(i){var k=this;i=i||{};Utils.polyfillParam(i);if(Utils.checkParamKeyEmpty(i,"address")){return}var j={address:i.address,output:"json",key:k.key};wx.request(Utils.buildWxRequestConfig(i,{url:URL_GET_GEOCODER,data:j}))}},{key:"getCityList",value:function c(i){var k=this;i=i||{};Utils.polyfillParam(i);var j={output:"json",key:k.key};
wx.request(Utils.buildWxRequestConfig(i,{url:URL_CITY_LIST,data:j}))}},{key:"getDistrictByCityId",value:function d(i){var k=this;i=i||{};Utils.polyfillParam(i);if(Utils.checkParamKeyEmpty(i,"id")){return}var j={id:i.id||"",output:"json",key:k.key};wx.request(Utils.buildWxRequestConfig(i,{url:URL_AREA_LIST,data:j}))}},{key:"calculateDistance",value:function e(i){var k=this;i=i||{};Utils.polyfillParam(i);if(Utils.checkParamKeyEmpty(i,"to")){return}var j={mode:i.mode||"walking",to:Utils.location2query(i.to),output:"json",key:k.key};var l=function l(m){j.from=m.latitude+","+m.longitude;wx.request(Utils.buildWxRequestConfig(i,{url:URL_DISTANCE,data:j}))};if(i.from){i.location=i.from}Utils.locationProcess(i,l)}}]);return b}();module.exports=QQMapWX;
\ No newline at end of file
... ...