-
Status changed to merged
-
mentioned in commit 92d09d36f513c4c50d3ca3bddbd8e2c9aae11070
Showing
7 changed files
components/diy_searchbox/diy_searchbox.wxml
| 1 | <!--pages/diy_ss/diy_ss.wxml--> | 1 | <!--pages/diy_ss/diy_ss.wxml--> |
| 2 | -<view class='ss' wx:if="{{object.style==1}}"> | ||
| 3 | - <view bindtap='go_url' data-url="/pages/goods/search/search" class="s1_gk_a1"> | ||
| 4 | - <view class='s_ge'> | ||
| 5 | - <image src='{{imghost}}/miniapp/images/search.png'></image> | ||
| 6 | - <text>在店铺内搜索</text> | ||
| 7 | - </view> | ||
| 8 | - </view> | 2 | +<block wx:if="{{object.style==1}}"> |
| 3 | +<view class="{{object.is_top==1?'abs_top':''}}"> | ||
| 4 | + <view class='ss' > | ||
| 5 | + <view bindtap='go_url' data-url="/pages/goods/search/search" class="s1_gk_a1"> | ||
| 6 | + <view class='s_ge'> | ||
| 7 | + <image src='{{imghost}}/miniapp/images/search.png'></image> | ||
| 8 | + <text>在店铺内搜索</text> | ||
| 9 | + </view> | ||
| 10 | + </view> | ||
| 11 | + </view> | ||
| 9 | </view> | 12 | </view> |
| 13 | +<view wx:if="{{object.is_top}}" style="height: 120rpx;"></view> | ||
| 14 | +</block> | ||
| 15 | + | ||
| 16 | + | ||
| 17 | +<block wx:if="{{object.style==2}}"> | ||
| 10 | 18 | ||
| 11 | -<view class='ss2' wx:if='{{object.style==2}}' style='background-color:{{object.top_bgcolor}}'> | 19 | +<view class="ss2 {{object.is_top==1?'abs_top2':''}}" style='background-color:{{object.top_bgcolor}}' > |
| 12 | <view class='s2_left'> | 20 | <view class='s2_left'> |
| 13 | <navigator url="/pages/index/index/index" class="s1_gk_a1"> | 21 | <navigator url="/pages/index/index/index" class="s1_gk_a1"> |
| 14 | <image src='/public/static/images/model/nav.png'></image> | 22 | <image src='/public/static/images/model/nav.png'></image> |
| @@ -18,7 +26,7 @@ | @@ -18,7 +26,7 @@ | ||
| 18 | <view class='s2_cen' style='background-color:{{object.inner_bgcolor}}'> | 26 | <view class='s2_cen' style='background-color:{{object.inner_bgcolor}}'> |
| 19 | <navigator url="/pages/goods/search/search" class="s1_gk_a2"> | 27 | <navigator url="/pages/goods/search/search" class="s1_gk_a2"> |
| 20 | <image src='/public/static/images/model/select.png'></image> | 28 | <image src='/public/static/images/model/select.png'></image> |
| 21 | - <text>在店铺内搜索</text> | 29 | + <text>在店铺内搜索-{{object.is_top}}</text> |
| 22 | </navigator> | 30 | </navigator> |
| 23 | </view> | 31 | </view> |
| 24 | 32 | ||
| @@ -27,4 +35,8 @@ | @@ -27,4 +35,8 @@ | ||
| 27 | <image src='/public/static/images/model/car.png'></image> | 35 | <image src='/public/static/images/model/car.png'></image> |
| 28 | </navigator> | 36 | </navigator> |
| 29 | </view> | 37 | </view> |
| 30 | -</view> | ||
| 31 | \ No newline at end of file | 38 | \ No newline at end of file |
| 39 | +</view> | ||
| 40 | + | ||
| 41 | +<view wx:if="{{object.is_top==1}}" style="height: 100rpx;"></view> | ||
| 42 | + | ||
| 43 | +</block> | ||
| 32 | \ No newline at end of file | 44 | \ No newline at end of file |
components/diy_searchbox/diy_searchbox.wxss
| @@ -75,4 +75,12 @@ margin-top:20rpx; | @@ -75,4 +75,12 @@ margin-top:20rpx; | ||
| 75 | width: 35rpx; | 75 | width: 35rpx; |
| 76 | height: 30rpx; | 76 | height: 30rpx; |
| 77 | margin-left: 20rpx; | 77 | margin-left: 20rpx; |
| 78 | +} | ||
| 79 | + | ||
| 80 | +.abs_top{ | ||
| 81 | + position: fixed; z-index: 10; background-color: #fff; | ||
| 82 | +} | ||
| 83 | + | ||
| 84 | +.abs_top2{ | ||
| 85 | + position: fixed; z-index: 10; | ||
| 78 | } | 86 | } |
| 79 | \ No newline at end of file | 87 | \ No newline at end of file |
pages/goods/goodsInfo/goodsInfo.js
| @@ -1401,10 +1401,11 @@ Page({ | @@ -1401,10 +1401,11 @@ Page({ | ||
| 1401 | e.data.data.pageData.splice(0, 0, th.data.def_pick_store); //添加 | 1401 | e.data.data.pageData.splice(0, 0, th.data.def_pick_store); //添加 |
| 1402 | } | 1402 | } |
| 1403 | 1403 | ||
| 1404 | + /*---- | ||
| 1404 | //--获取线下库存-- | 1405 | //--获取线下库存-- |
| 1405 | - if(this.data.sales_rules){ | 1406 | + if(th.data.sales_rules){ |
| 1406 | 1407 | ||
| 1407 | - } | 1408 | + }---*/ |
| 1408 | 1409 | ||
| 1409 | 1410 | ||
| 1410 | //单总量超出5个的时候 | 1411 | //单总量超出5个的时候 |
pages/store/index.js
0 → 100644
| 1 | +var o=getApp().globalData.setting; | ||
| 2 | +Page({ | ||
| 3 | + data:{ | ||
| 4 | + is_get_local_ok:0, | ||
| 5 | + is_gps:0, | ||
| 6 | + lat:null, | ||
| 7 | + lon:null, | ||
| 8 | + page:1, | ||
| 9 | + cat_list:null, | ||
| 10 | + pick_list:null, | ||
| 11 | + url:o.imghost, | ||
| 12 | + is_no_more:0, | ||
| 13 | + key_word:'', //关键字搜索 | ||
| 14 | + cat_id:0, //分类ID | ||
| 15 | + }, | ||
| 16 | + | ||
| 17 | + onShow:function(){ | ||
| 18 | + | ||
| 19 | + }, | ||
| 20 | + | ||
| 21 | + //调用视频接口 | ||
| 22 | + onLoad:function(e){ | ||
| 23 | + var th=this; | ||
| 24 | + wx.getLocation({ | ||
| 25 | + type: 'wgs84', | ||
| 26 | + success: function(res) { | ||
| 27 | + th.data.lat = res.latitude; | ||
| 28 | + th.data.lon = res.longitude; | ||
| 29 | + th.data.is_get_local_ok = 1; | ||
| 30 | + }, | ||
| 31 | + fail: function(res) { | ||
| 32 | + th.data.is_get_local_ok = 1; | ||
| 33 | + if (res.errCode == 2) { | ||
| 34 | + getApp().confirmBox("请开启GPS定位", null, 25000, !1); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + } | ||
| 38 | + }) | ||
| 39 | + //--获取门店分类--- | ||
| 40 | + getApp().request.get("/api/weshop/storagecategory/page", { | ||
| 41 | + data: { | ||
| 42 | + store_id: o.stoid, | ||
| 43 | + is_show: 1, | ||
| 44 | + pageSize: 300 | ||
| 45 | + }, | ||
| 46 | + success:function(res){ | ||
| 47 | + if(res.data.code==0){ | ||
| 48 | + th.setData({cat_list:res.data.data.pageData}) | ||
| 49 | + } | ||
| 50 | + }, | ||
| 51 | + }) | ||
| 52 | + this.get_sto(); | ||
| 53 | + }, | ||
| 54 | + | ||
| 55 | + //---------拿出门店分类和门店------------ | ||
| 56 | + get_sto() { | ||
| 57 | + var th = this; | ||
| 58 | + var timer_get = setInterval(function() { | ||
| 59 | + if (th.data.is_get_local_ok == 0) return false; | ||
| 60 | + clearInterval(timer_get); | ||
| 61 | + th.get_list(); | ||
| 62 | + }, 500) | ||
| 63 | + | ||
| 64 | + }, | ||
| 65 | + | ||
| 66 | + get_list:function(){ | ||
| 67 | + if(this.data.is_no_more==1) return false; | ||
| 68 | + var th=this,req = getApp().request; | ||
| 69 | + var dd = { | ||
| 70 | + store_id: o.stoid, | ||
| 71 | + isstop: 0, | ||
| 72 | + pageSize: 10, | ||
| 73 | + page:th.data.page | ||
| 74 | + } | ||
| 75 | + if(th.data.key_word!="" && th.data.key_word!=undefined) { | ||
| 76 | + dd.keyword=th.data.key_word; | ||
| 77 | + } | ||
| 78 | + if(th.data.cat_id){ | ||
| 79 | + dd.category_id=th.data.cat_id; | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + wx.showLoading(); | ||
| 83 | + //----------获取门店--------- | ||
| 84 | + req.promiseGet("/api/weshop/pickup/list", { | ||
| 85 | + data: dd, | ||
| 86 | + }).then(res => { | ||
| 87 | + wx.hideLoading(); | ||
| 88 | + if(res.data.code==0){ | ||
| 89 | + if(res.data.data.pageData.length<=0){ | ||
| 90 | + th.data.is_no_more=1; return false; | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + th.data.page=dd.page+1 | ||
| 94 | + var pick_list=th.data.pick_list; | ||
| 95 | + if(!pick_list) pick_list=[]; | ||
| 96 | + pick_list=pick_list.concat(res.data.data.pageData); | ||
| 97 | + th.setData({ | ||
| 98 | + pick_list:pick_list | ||
| 99 | + }) | ||
| 100 | + } | ||
| 101 | + }) | ||
| 102 | + }, | ||
| 103 | + | ||
| 104 | + //---加载更多是靠这个函数---- | ||
| 105 | + onReachBottom: function() { | ||
| 106 | + this.get_list(); | ||
| 107 | + }, | ||
| 108 | + | ||
| 109 | + lose_focus:function(e){ | ||
| 110 | + var key_word = e.detail.value; | ||
| 111 | + this.data.key_word=key_word; | ||
| 112 | + }, | ||
| 113 | + | ||
| 114 | + | ||
| 115 | + phone:function(e){ | ||
| 116 | + var index=e.currentTarget.dataset.index; | ||
| 117 | + var item=this.data.pick_list[index]; | ||
| 118 | + wx.makePhoneCall({ | ||
| 119 | + phoneNumber: item.pickup_phone, | ||
| 120 | + }) | ||
| 121 | + }, | ||
| 122 | + | ||
| 123 | + //分类的下拉 | ||
| 124 | + bindPickerChange: function (e) { | ||
| 125 | + var index = e.detail.value;//这里会获取他的索引值 | ||
| 126 | + var self = this; | ||
| 127 | + var list = self.data.cat_list; | ||
| 128 | + var item = list[index]; | ||
| 129 | + this.data.cat_id=item['cat_id']; | ||
| 130 | + self.setData({ | ||
| 131 | + periodsname: item['cat_name'], | ||
| 132 | + cid: item['cat_id'] | ||
| 133 | + }) | ||
| 134 | + this.data.page=1; | ||
| 135 | + this.setData({ pick_list:null}) | ||
| 136 | + this.get_list(); | ||
| 137 | + | ||
| 138 | + }, | ||
| 139 | + | ||
| 140 | + //搜索关键字 | ||
| 141 | + sear:function(){ | ||
| 142 | + this.data.page=1; | ||
| 143 | + this.setData({ pick_list:null}) | ||
| 144 | + this.get_list(); | ||
| 145 | + }, | ||
| 146 | + | ||
| 147 | + | ||
| 148 | + map: function (e) { | ||
| 149 | + var index = e.currentTarget.dataset.index;//这里会获取他的索引值 | ||
| 150 | + var self = this; | ||
| 151 | + var list = self.data.pick_list; | ||
| 152 | + var item = list[index]; | ||
| 153 | + | ||
| 154 | + wx.openLocation({ | ||
| 155 | + //当前经纬度 | ||
| 156 | + latitude: parseFloat(item.lat), | ||
| 157 | + longitude: parseFloat(item.lon), | ||
| 158 | + //缩放级别默认28 | ||
| 159 | + scale: 28, | ||
| 160 | + //位置名 | ||
| 161 | + name:item.pickup_name, | ||
| 162 | + //详细地址 | ||
| 163 | + address: item.pickup_address, | ||
| 164 | + //成功打印信息 | ||
| 165 | + success: function(res) {}, | ||
| 166 | + //失败打印信息 | ||
| 167 | + fail: function(err) {}, | ||
| 168 | + //完成打印信息 | ||
| 169 | + complete: function(info){}, | ||
| 170 | + }) | ||
| 171 | + }, | ||
| 172 | + | ||
| 173 | + | ||
| 174 | + | ||
| 175 | + | ||
| 176 | +}) | ||
| 0 | \ No newline at end of file | 177 | \ No newline at end of file |
pages/store/index.json
0 → 100644
pages/store/index.wxml
0 → 100644
| 1 | +<view class="bcolor flex jc_sb"> | ||
| 2 | + <view class="sear_inp"> | ||
| 3 | + <view class="sear_btn" bindtap='sear'> | ||
| 4 | + <image src="{{url}}/miniapp/images/search.png" style="width: 30rpx; height: 30rpx; margin-left: 10rpx;"></image> | ||
| 5 | + </view> | ||
| 6 | + <input bindinput ="lose_focus" class="fs28" value=""/> | ||
| 7 | + </view> | ||
| 8 | + <view class="select"> | ||
| 9 | + <picker bindchange="bindPickerChange" value="{{index}}" range="{{cat_list}}" range-key='cat_name'> | ||
| 10 | + <view class="course_icon">{{periodsname?periodsname:"选择分类"}}</view> | ||
| 11 | + </picker> | ||
| 12 | + </view> | ||
| 13 | +</view> | ||
| 14 | +<view> | ||
| 15 | + <view class="box" wx:for="{{pick_list}}"> | ||
| 16 | + <!-- 门店名称 --> | ||
| 17 | + <view class="pickname">{{item.pickup_name}}</view> | ||
| 18 | + <!-- 电话 --> | ||
| 19 | + <view class="mt flex jc_sb" bindtap="phone" data-index="{{index}}" > | ||
| 20 | + <!-- 左边电话 --> | ||
| 21 | + <view>{{item.pickup_phone}}</view> | ||
| 22 | + <!-- 右边按钮 --> | ||
| 23 | + <view class="buttonclass"><image src='{{url}}/miniapp/images/storelist/store_phone.png' class="fmob"></image>一键拔号</view> | ||
| 24 | + </view> | ||
| 25 | + <!-- 电话 --> | ||
| 26 | + <view class="mt flex jc_sb" bindtap="map" data-index="{{index}}"> | ||
| 27 | + <!-- 左边电话 --> | ||
| 28 | + <view class="addr">{{item.fulladdress}}</view> | ||
| 29 | + <!-- 右边按钮 --> | ||
| 30 | + <view class="buttonclass"><image src='{{url}}/miniapp/images/storelist/store_addr.png' class="faddr"></image>地图导航</view> | ||
| 31 | + </view> | ||
| 32 | + </view> | ||
| 33 | +</view> | ||
| 34 | + | ||
| 35 | +<!-- 制作一个圆球导航 --> | ||
| 36 | +<nav_box></nav_box> | ||
| 0 | \ No newline at end of file | 37 | \ No newline at end of file |
pages/store/index.wxss
0 → 100644
| 1 | +.box{ | ||
| 2 | + padding: 10px; | ||
| 3 | + border-bottom: 10px solid #f5f5f5; | ||
| 4 | + color: #000000; | ||
| 5 | +} | ||
| 6 | +.box .pickname { | ||
| 7 | + font-size: 32rpx; | ||
| 8 | + line-height: 80rpx; | ||
| 9 | + border-bottom: 1rpx solid #EEEEEE; | ||
| 10 | +} | ||
| 11 | + | ||
| 12 | +.box .mt { | ||
| 13 | + margin-top: 20rpx; | ||
| 14 | +} | ||
| 15 | +.addr{ width: 75%;color: #848484;} | ||
| 16 | +.buttonclass { | ||
| 17 | + width: 160rpx; | ||
| 18 | + height: 60rpx; | ||
| 19 | + line-height: 60rpx; | ||
| 20 | + text-align: center; | ||
| 21 | + border: solid 1px #c3172d; | ||
| 22 | + border-radius: 20rpx; | ||
| 23 | + font-size: 28rpx; | ||
| 24 | + color: #c3172d; | ||
| 25 | +} | ||
| 26 | +.fmob | ||
| 27 | +{width: 28rpx; | ||
| 28 | +height: 32rpx; | ||
| 29 | +margin-right: 10rpx; | ||
| 30 | +top: 4rpx; | ||
| 31 | +position: relative; | ||
| 32 | +} | ||
| 33 | + | ||
| 34 | +.faddr{ | ||
| 35 | +width: 26rpx; | ||
| 36 | +height: 32rpx; | ||
| 37 | +margin-right: 6rpx; | ||
| 38 | +top: 4rpx; | ||
| 39 | +position: relative; | ||
| 40 | +} | ||
| 41 | + | ||
| 42 | +.bcolor{background-color: #f5f5f5; height: 126rpx;} | ||
| 43 | + | ||
| 44 | +.sear_inp{width: 490rpx; background-color:#eaeaea; height: 80rpx; border-radius:5rpx; margin: 25rpx;} | ||
| 45 | +.sear_inp input{ position: relative; top:10rpx;width: 400rpx; display: inline-block;} | ||
| 46 | +.select{height: 80rpx; width: 220rpx;background-color:#eaeaea; margin:25rpx; font-size: 28rpx; line-height: 80rpx;text-align: center } | ||
| 47 | +.sear_btn{ width: 50rpx; height: 100%; display: inline-block;} | ||
| 48 | + |