Просмотр исходного кода

[首页增加门店列表]

tags/富茂链客4.1.0
meo 6 лет назад
Родитель
Сommit
97a8cb59c4
11 измененных файлов: 239 добавлений и 1 удалений
  1. +1
    -0
      app.json
  2. Двоичные данные
      assets/images/search.png
  3. +5
    -1
      config/config.js
  4. +5
    -0
      pages/discountCardList/discountCardList.wxss
  5. +96
    -0
      pages/index/searchbar/index.js
  6. +3
    -0
      pages/index/searchbar/index.json
  7. +12
    -0
      pages/index/searchbar/index.wxml
  8. +76
    -0
      pages/index/searchbar/index.wxss
  9. +6
    -0
      pages/main/index.js
  10. +7
    -0
      pages/main/index.wxml
  11. +28
    -0
      pages/main/index.wxss

+ 1
- 0
app.json Просмотреть файл

@@ -5,6 +5,7 @@
"pages/spellGroup/spellGroup",
"pages/complete/index",
"pages/main/index",
"pages/index/searchbar/index",
"pages/bargain/bargainDatail/bargainDatail",
"pages/bargain/bargain",
"pages/cardorder/index/index",


Двоичные данные
assets/images/search.png Просмотреть файл

До После
Ширина: 80  |  Высота: 80  |  Размер: 4.7 KiB

+ 5
- 1
config/config.js Просмотреть файл

@@ -235,7 +235,11 @@ var config = {
/**
*查询差1个的团购信息
*/
queryRemainOne:'/orderGroup/queryRemainOne'
queryRemainOne:'/orderGroup/queryRemainOne',
/**
* *分页列表接口
*/
merchantList:"/merchant/list"
},
weapp: {
AppId: weappId


+ 5
- 0
pages/discountCardList/discountCardList.wxss Просмотреть файл

@@ -79,6 +79,11 @@ page{
line-height: 65rpx;
color: #333;
text-align: center;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
width: 320rpx;
margin: 0 auto;
}
.info view:nth-child(1) {
display: flex;


+ 96
- 0
pages/index/searchbar/index.js Просмотреть файл

@@ -0,0 +1,96 @@
const Http = require("../../../utils/HttpBasics");
const imgurl = require("../../../utils/imgurl");
const config = require("../../../config/config");
const QR = require("../../../utils/memberqrcode.js");
let app = getApp();
Page({

/**
* 页面的初始数据
*/
data: {
teljpgUrl: imgurl.teljpg.url,
},

/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {

},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {

},

/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
// merchantList
let that = this;
that.getList(10,1)
},
getList(pageSize,pageNum){
let that = this;
Http.get({
url: config.api.merchantList,
data: {
pageNum: pageNum,
pageSize: pageSize
}
}).then(res => {
that.setData({
merchantVoList: res.data.list
})
console.log(res)
}).catch(err => {
console.log(err)
})
},
phone: function (e) {
let that = this;
if (e.currentTarget.dataset.merchantlinkphone) {
wx.makePhoneCall({
phoneNumber: e.currentTarget.dataset.merchantlinkphone
});
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {

},

/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {

}
})

+ 3
- 0
pages/index/searchbar/index.json Просмотреть файл

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "门店搜索"
}

+ 12
- 0
pages/index/searchbar/index.wxml Просмотреть файл

@@ -0,0 +1,12 @@
<view class='posi'>
<view class='posi_logo' wx:for="{{merchantVoList}}" wx:key="index">
<view>
<image src='{{item.merchantImgUrl}}'></image>
</view>
<view>
<text>{{item.merchantName}}</text>
<text>{{item.addr}}{{item.buildingName}}{{item.floorName}}</text>
</view>
<image bindtap='phone' data-merchantLinkPhone='{{item.merchantLinkPhone}}' class="tel" src="{{teljpgUrl}}" mode="widthFix" />
</view>
</view>

+ 76
- 0
pages/index/searchbar/index.wxss Просмотреть файл

@@ -0,0 +1,76 @@
.posi {
position: relative;
width: 92%;
margin: 0 auto;
}

.posi>view:nth-child(2) {
width: 100%;
height: 87rpx;
display: flex;
justify-content: space-between;
line-height: 87rpx;
}

.posi>view:nth-child(2) text:nth-child(1) {
font-size: 30rpx;
color: #a9a9a9;
}

.posi>view:nth-child(2) text:nth-child(2) {
font-size: 30rpx;
color: #a9a9a9;
}

.posi_logo {
width: 100%;
display: flex;
padding: 20rpx 0;
background: #fff;
height: 100rpx;
margin-bottom: 20rpx;
}

.posi_logo view:nth-child(1) {
width: 100rpx;
height: 100rpx;
border-radius: 16rpx;
}

.posi_logo view:nth-child(1) image {
display: block;
width: 100rpx;
height: 100rpx;
border-radius: 16rpx;
border: 1px solid #e5e5e5;
}

.posi_logo view:nth-child(2) {
display: flex;
flex-direction: column;
flex: 8;
padding-left: 30rpx;
}

.posi_logo view:nth-child(2) text:nth-child(1) {
font-size: 32rpx;
color: #333;
letter-spacing: 0;
}

.posi_logo view:nth-child(2) text:nth-child(2) {
font-size: 24rpx;
color: #b8b8b8;
padding-top: 3rpx;
width: 450rpx;
height: 36rpx;
overflow: hidden;
}
.tel {
right: 0;
top: 0;
bottom: 0;
margin: auto;
width: 50rpx;
height: 50rpx;
}

+ 6
- 0
pages/main/index.js Просмотреть файл

@@ -75,6 +75,12 @@ Page({
showQrcode: false
})
},
//搜索门店
searchbar:function(){
wx.navigateTo({
url: '/pages/index/searchbar/index',
})
},
//适配不同屏幕大小的canvas
setCanvasSize: function() {
var size = {};


+ 7
- 0
pages/main/index.wxml Просмотреть файл

@@ -1,5 +1,12 @@

<view class="container">
<!-- 门店列表展示 -->
<view class='search'>
<view class='searchbar' bindtap='searchbar'>
<text>请输入要搜索的门店</text>
<image src='./../../assets/images/search.png' mode='widthFix'></image>
</view>
</view>
<c-banner wx:key="unique" list="{{list}}" />
<!-- 折扣卡 -->
<view class='section'>


+ 28
- 0
pages/main/index.wxss Просмотреть файл

@@ -121,4 +121,32 @@ page {
.memberIds{
padding-top: 30rpx;
font-size: 30rpx;
}
.search{
background:rgba(2, 192, 255, 1);
height: 76rpx;
padding: 20rpx 0;
}
.searchbar{
position: relative;
width: 685rpx;
height: 76rpx;
margin: 0 auto;
background: #fff;
border-radius:60rpx;
}
.searchbar image{
position: absolute;
width: 40rpx;
left: 20rpx;
top:0;
bottom: 0;
margin: auto;
}
.searchbar text{
font-size: 32rpx;
line-height: 76rpx;
color: #555555;
display: inline-block;
margin-left: 70rpx;
}

Загрузка…
Отмена
Сохранить